Relaxing an arbitrary shape

21 views
Skip to first unread message

Ayush Gupta

unread,
May 5, 2025, 2:06:20 AMMay 5
to Boris Computational Spintronics
Hi,
I am trying to peform simulation for an arbitrary shape (SHNO). But from what I can see it is not relaxing properly. Can you suggest where exactly the error is or anything else that may work?
from NetSocks import NSClient
from NetSocks import Shape


ns = NSClient(1542, 'localhost')
ns.configure(True)

#Make a ferromagnetic mesh with given rectangle, cubic cellsize, and set modules
C = ns.Ferromagnet([0, 0, 0, 200e-9, 200e-9, 5e-9], [2e-9, 2e-9, 5e-9])
C.modules(['demag', 'exchange', 'Zeeman', 'aniuni', 'transport'])
ns.loadovf2mag("initial_m.ovf")
C.param.K1 = 5e3
C.param.Ms = 716e3


C.param.A = 13e-12
C.param.ea1 = [0, 1, 0]

ns.cuda(1)

# Set the magnetization 5° off the z-axis
ns.setangle(5, 0)

# Set static LLG ODE
ns.setode('LLG', 'RK4')

# Relax
ns.Relax(['mxh', 1e-5])



initial_m.ovf

Serban Lepadatu

unread,
May 5, 2025, 2:27:10 AMMay 5
to Boris Computational Spintronics
Hi,

You are using a dynamic method to relax the magnetization, RK4, which is a fixed time-step method. The default time-step is 500fs, and this is too large for the cellsize set, so the solution diverges. You will need a smaller time-step for convergence (to be determined), or else use an adaptive time-step method, e.g. RKF45.

However, for simply relaxing the magnetization dynamic methods are inefficient. You should use the steepest descent solver, i.e.:

ns.setode('LLGStatic', 'SDesc')

This would replace the current setting ns.setode('LLG', 'RK4').

Regards,
Serban

Reply all
Reply to author
Forward
0 new messages