Mumax 3.11 problem

61 views
Skip to first unread message

ANIRUDDHA CHAKRABORTY

unread,
Mar 1, 2026, 7:05:47 PMMar 1
to mumax2
In Mumax 3.10 I have an issue: it cannot recognize the freelayerthickness variable that I mentioned in this post 
https://groups.google.com/u/1/g/mumax2/c/KVRC39cq6e0

Now I changed the platform and now use Mumax 3.11. here it can recognize the freelayerthickness variable
But there is another issue I am facing. I tried to record stray field data at a certain distance from the nanomagnet. using B-demag, but the table value is now showing 0 value
. How can I resolve the problem in Mumax 3.11

Script
Na:=64
Nb:=64
l:=2e-9
w:=2e-9
v:=2e-9

d:=6.0e-9
Nc:=ceil(d/v)+45

// CofeB Ms=1.1e6, Aex=1.5e-11, alpha=0.006
//YIG Ms=1.4e5, Aex=3.5e-12, alpha=0.0005
//CoNi Ms=5.8e5, Aex=1.5e-11, alpha=0.01
//Ni Ms=4.8e5, Aex=1.0e-12, alpha=0.01
//FreeLayerThickness=d

setmesh(Na,Nb,Nc,l,w,v,0,0,0)
Ax:=1.5e-11//1.0e-11//1.5e-11//3e-11
alp:=0.01//0.005//0.01//0.01
alpha=alp//NiFe, CoFeB
//h:=d*Nc
rd:=80e-9
ec:=1.1
//GammaLL=(2.1/2.003)*1.76e11
freelayerthickness=d


//For FMR
j_pulse := 1e12 // in (T)  // high pulse for FMR experiment
thick:=3e-9 //Pt thickness



f1 := 6.80e9
//jvar:=j_pulse*sin(2*pi*f1*t)
//j = vector(0, 0, j_pulse*sin(2*pi*f1*t))//

jvar:=j_pulse*exp(-pow(t-5e-12,2)/(2*pow(2e-11,2)))
j=vector(0,0,j_pulse*exp(-pow(t-5e-12,2)/(2*pow(2e-11,2))))
                //  j_pulse*exp(-pow(t-5e-12,2)/(2*pow(2e-11,2))))


xi_SOT:= alp//alp//0.01 //1.0 field like torque and damping like torque ratio (bj/aj)

shiftx:=l+0.5*rd-0.5*Na*l                            
shifty:=w+0.5*rd*ec-0.5*Nb*w
               
shiftz:=0.5*(Nc*v-d)               //(Nc-1)*v//0//0.5*(Nc-2)*v                          
dip:=10
nano1:=cylinder(rd,d).scale(1,ec,1).transl(shiftx,shifty,shiftz)
//nanob:=cylinder(rd,d).scale(ec,1,1).transl(shiftx+rd*ec+dip*l,shifty,shiftz)
//nanoc:=cylinder(rd,d).scale(ec,1,1).transl(shiftx+2*rd*ec+2*dip*l,shifty,shiftz)
//nano4:=cylinder(rd,d).scale(ec,1,1).transl(shiftx,shifty,shiftz-3*d)//.rotz(0.021421441955287)
//nano5:=cylinder(rd,d).scale(ec,1,1).transl(shiftx,shifty,shiftz-4*d)
//nano1:=nanoa.add(nanob).add(nanoc)
setgeom(nano1)//.add(nano2).add(nano3).add(nano4).add(nano5))
//saveas(geom, "nanos")
defregion(1,nano1)
defregion(2,nano1.Inverse())

K:=jvar*thick  // Sheet current density flowing along x direction
//B_ext=vector(208e-3,mu0*K/2,0)  // B in Y direction
th:=0.05*pi
//B_ext=vector(208e-3,0,0)
ms:=0.58e6//0.8e5//1.0e6//1.4e6 //Co change from 1.4e6
ku:=0*3.5e5//1e6//8e5
Msat.setregion(1,ms)
Msat.setregion(2,0)
Ku1.setregion(1, ku)
Ku1.setregion(2, 0)
anisU.setregion(1, vector(0, 0, 1))
save(anisU)
Aex.setregion(1, Ax)
m.setregion(1, uniform(0.1,0.14,0.99))

relax()
//Temp=300



dx1:=ceil(0.5*rd/l)//+dip/2//Na/2//256//Na/2   //;floor(rd*ec/(2*w))
dy1:=ceil(0.5*rd*ec/w)//+2 ///0.5*rd/w+(200e-9)/w-1   //2*floor(rd/(2*w))+52
dz1:=0
for l1:=dz1;l1<dz1+1;l1++ {
for j1 := dx1; j1 < dx1+1; j1++  {
for k1 := dy1; k1 < dy1+1; k1++ {
TableAdd(Crop(B_demag.Comp(0), j1, j1+1, k1, k1+1, l1, l1+1))
TableAdd(Crop(B_demag.Comp(1), j1, j1+1, k1, k1+1, l1, l1+1))
TableAdd(Crop(B_demag.Comp(2), j1, j1+1, k1, k1+1, l1, l1+1))
     //TableAdd(Crop(STTorque.Comp(0), j1, j1+1, k1, k1+1, l1, l1+1))
//TableAdd(Crop(STTorque.Comp(1), j1, j1+1, k1, k1+1, l1, l1+1))
//TableAdd(Crop(STTorque.Comp(2), j1, j1+1, k1, k1+1, l1, l1+1))
}
}
}

//fixedlayer = vector(-sin(0.021421441955287), cos(0.021421441955287), 0)
fixedlayer = vector(1,0, 0)
alphaH:= 0.55 //beta W
pol = alphaH
lambda=1
epsilonprime= xi_SOT*alphaH/2

autosave(B_demag,5e-12)
tableautosave(5e-12)

//saveas(B_demag,"B_demag.ovf")
saveas(Crop(B_demag, 0, Na, 0, Nb, 0, 1), "B_demag_layer_0.ovf")
//saveas(Crop(B_demag, 0, Na, 0, Nb, 14, 15), "B_demag_layer14.ovf")
//saveas(Crop(B_demag, 0, Na, 0, Nb, 44, 45), "B_demag_layer44.ovf")
//tableautosave(1e-12)
run(2e-9)
//tableautosave(5e-12)
//run(0.5e-9)
//saveas(B_demag,"B_demag.ovf")
save(m)

output:
The output file is attached herewith 



Thanks
Aniruddha 
Grad student, VCU
 
table.txt

Josh Lauzier

unread,
Mar 22, 2026, 6:50:42 AM (3 days ago) Mar 22
to mumax2
Hi,

This looks to be related to a change made in 3.11 to restrict the demag field so that B_demag=0 when Msat=0 (ie, the stray field will be 0). There is a fix that is being pushed, but you will have to recompile the latest version or wait for the next version to be posted. For details, see this github issue.

If you want to go back to 3.10 for now until the newest version comes, I would recommend downloading a fresh copy of 3.10. I reran your script on mumax3.10 and it works perfectly. So either there is a change in your mumax code, or there is an issue with the file. In particular, if you are on Windows make sure to check for any hidden characters (depending on what program you use to edit, sometimes it can put in whitespace or wrong endline/newlinecharacters that does not get parsed properly). This will cause seemingly arbitrary errors. Also they don't always show up when you copy paste them to places like this board, making it difficult to find. You can see previous discussions like this one.

In regards to your other post: By default, the freelayerthickness will use the entire thickness of the simulation. It does not know if there are empty layers. So you will need to set freelayerthickness explicitly. An alternative would be to implement SOT using custom fields instead. This is also shown in the same tutorial, and will give the same result, and avoids needing FreeLayerThickness.

For damping, it is not directly tied to film thickness, mathematically. It's just set by alpha. But you can get different effective damping by varying the structure. This comes not from the damping itself, but how B_eff changes due to changes in structure. I suppose one think you could look at is to save the entire damping term in the LLG equation, the alpha (m cross (m cross) B_eff) term? ( If you are comparing to real systems, some of this will also be phemonological. The change in damping is due to thinks like losses at interfaces, that is not something captured directly in mumax. Basically you would have to use an effective alpha to mimic those, or depending on the effect you could have J vary through the thickness). For the mathematical form used by mumax, you can check the mumax paper "the design and verification of mumax3" to see each term, but the only term that has an explicit thickness dependence is the Slonczewski stuff (and SOT). There are some terms that depend on cell size but not film thickness separately from that.

Best,
Josh L.
Reply all
Reply to author
Forward
0 new messages