In [6]:
import random
import oommfc as oc
import discretisedfield as df
%matplotlib inline
random.seed(9999)
p1 = (0, 0, 0)
p2 = (100e-9, 10e-9, 10e-9)
cell = (10e-9, 10e-9, 10e-9)
mesh = oc.Mesh(p1=p1, p2=p2, cell=cell)
def random_m(pos):
mx = 2*random.random() - 1
my = 2*random.random() - 1
mz = 2*random.random() - 1
return mx, my, mz
Ms = 8e6 # magnetisation saturation (A/m)
random_field = df.Field(mesh, value=random_m, norm=Ms)
random_field.plot_slice("y", 0);
In [7]:
system = oc.System(name="zeeman_tutorial")
gamma = 2.211e5 # gyrotropic ration
alpha = 0.5 # Gilbert damping
system = oc.System(name="exchange_dmi_tutorial")
system.hamiltonian = oc.Exchange(A=8e-11) + oc.DMI(D=1.6e-2)
system.dynamics = oc.Precession(gamma=gamma) + oc.Damping(alpha=alpha)
system.m = random_field
td = oc.TimeDriver()
td.drive(system, t=0.5e-9, n=1)
system.m.plot_slice("y", 0);
In [ ]: