It's easier to show than to explain. When a magnet is returned from a function and some property is immediately evaluated, the program gives an error. When that magnet is first given a name it is fine.
from mumaxplus import World, Grid, Ferromagnet
def make_magnet():
world = World((1e-9, 1e-9, 1e-9))
magnet = Ferromagnet(world, Grid((2, 2, 2)))
magnet.msat = 1
magnet.aex = 1
return magnet
# This works
magnet = make_magnet()
print(magnet.exchange_energy())
# This Gives the error `GPUassert: out of memory`
print(make_magnet().exchange_energy())
I guess world instantly gets destroyed in the compact version?
It's easier to show than to explain. When a magnet is returned from a function and some property is immediately evaluated, the program gives an error. When that magnet is first given a name it is fine.
I guess
worldinstantly gets destroyed in the compact version?