Hello,
When I run your script (with the changes), I am not getting that error. It's giving the "
*engine.RegionwiseScalar as float64" for Msat, for trying to do Msat+=.
Again, that's because there is some shortcutting. Msat is not just a float (so it doesn't have access to +=), it's setting Msat for the entire universe behind the scenes. You can set it by using a dummy variable float to increment. The following script seems to run without errors:
setgridsize(256,128,1)
setcellsize(1e-9,1e-9,1e-9)
film:=cuboid(256e-9,128e-9,1e-9)
setgeom(film)
saveas(geom,"film")
setpbc(4,0,0)
Msat=221e2
Aex=2.6e-13
Dind=8.0e-6
Ku1=0.18e4
AnisU=vector(0,0,1)
alpha=0.1
i:=0
Msat_float:=221e3
m=neelskyrmion(-1,1).transl(-100e-9,0,0)
for (ext_bubblepos.average()[0]<1e-9) || (ext_bubblepos.average()[0]>128e-9) || (ext_bubblepos.average()[0]<(-128e-9)){
Msat_float+=Msat_float
Msat=Msat_float
m=neelskyrmion(-1,1).transl(-100e-9,0,0)
minimize()
i++
print(i)
}
Basically, Msat is not actually float, but it can take a float argument/assignment (and it does stuff behind the scenes with it).
Best,
Josh L.