Dear all,
I am currently doing some simulations on Pt/Co multilayers. I need to do a hysteresis, i.e., I need the info of variation in magnetization with applied field, but each time I need to start from a random state. This is because, in experiments, we have skyrmions nucleated at high fields, which are heavily influenced by the inhomogeneity in the multilayer system, which is hard to reproduce in simulations. But when I tried, I couldn't get a proper relaxed state. I guess I am doing something wrong with the ode? I have read your suggestion of using RK45 first and then using SDesc later, but that didn't work either.
Here is the code:
ns = NSClient()
ns.configure(True)
Ms = 1.2e6
A = 18e-12
K1=0.787e6
D=-1.46e-3
damping= 0.2
ns.setmesh('Co_1',[512e-9, 512e-9, 1.6e-9])
N1=7
t1=1.6e-9
tcur=1.6e-9
for i in range(1,N1):
ns.addmesh(f"Co_{i+1}",[0,0,tinter+tcur,512e-9,512e-9,tinter+tcur+t1])
tcur+=t1+tinter
for i in range(1,N1+1):
ns.setparam(f"Co_{i}",'Ms',Ms)
ns.setparam(f"Co_{i}",'A',A)
ns.setparam(f"Co_{i}",'D',D)
ns.setparam(f"Co_{i}",'K1', K1)
ns.setparam(f"Co_{i}",'ea1',(0,0,1))
ns.addmodule(f"Co_{i}",['Zeeman'])#,'demag','iDMexchange','aniuni','heat'])
ns.addmodule(f"Co_{i}",['demag'])
ns.addmodule(f"Co_{i}",['iDMexchange'])
ns.addmodule(f"Co_{i}",['aniuni'])
ns.cellsize(f"Co_{i}",[2e-9,2e-9,1.6e-9])
ns.random(f"Co_{i}")
ns.display(f"Co_{i}",'M')
ns.vecrep(f"Co_{i}", 3)
ns.addmodule('supermesh','sdemag')
ns.curietemperature('supermesh',500)
## set PBCs
ns.pbc('supermesh', 'x', 10)
ns.pbc('supermesh', 'y', 10)
ns.addmaterial('Pt', [0.0, 0.0, -3e-9, 512e-9, 512e-9, 0.0])
ns.addmodule('Pt', 'heat')
ns.tcellsize('Pt',[4e-9, 4e-9, 4e-9])
ns.tmodel(2, 'Pt')
#SiO2 layer
ns.addmaterial('SiO2', [0.0, 0.0, -48e-9, 512e-9, 512e-9, -3e-9])
ns.addmodule('SiO2', 'heat')
ns.tcellsize('SiO2',[8e-9, 8e-9, 8e-9])
ns.meshfocus('supermesh')
ns.temperature(300)
H0 = 100e3
steps=2
for i in range(steps+1):
#ns.meshfocus('supermesh')
Hstep = H0 / steps
H = H0 - i* Hstep
ns.setfield(H,1,0)
ns.setode('LLGStatic', 'RKF45')
ns.setdt(1e-15)
ns.editstagestop(0, 'time', 100e-15)
# ns.editstagestop(0, 'mxh', 1e-1)
ns.Run()
ns.setode('LLGStatic', 'SDesc')
ns.editstagestop(0, 'mxh', 1e-4)
ns.Run()
for j in range(1,N1+1):
ns.meshfocus(f"Co_{j}")
ns.saveovf2mag(os.path.join(SaveFolder_directory_ovf,f'mag_Co_{j}_Field{H}.ovf'),
bufferCommand = False)
ns.random(f"Co_{j}")
ns.reset()
ns.cuda(1)
ns.displaydetail(1e-9)
Looking forward to your reply.
Thankyou
Krishnanjana