Skip to content

Commit 140c7e6

Browse files
author
davidcorteso
committed
Added example script for testing dmi types
1 parent 2d5b3b5 commit 140c7e6

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

sandbox/more-dmi/isolated_sk_sim.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import numpy as np
2+
import fidimag
3+
from fidimag.micro import Sim
4+
from fidimag.common import CuboidMesh
5+
import fidimag.common.constant as C
6+
7+
8+
R_sk = 2
9+
10+
11+
def init_m(r):
12+
rho = np.sqrt(r[0] ** 2 + r[1] ** 2)
13+
if rho < R_sk:
14+
return (0, 0, -1)
15+
else:
16+
return (0, 0, 1)
17+
18+
19+
dx, dy, dz = 0.25, 0.25, 1
20+
Lx, Ly, Lz = 20, 20, 1
21+
mesh = CuboidMesh(nx=int(Lx/dx), ny=int(Ly/dy), nz=int(Lz/dz),
22+
dx=dx, dy=dy, dz=dz,
23+
x0=-Lx/2, y0=-Ly/2, z0=-Lz/2,
24+
unit_length=1e-9)
25+
26+
sim = Sim(mesh)
27+
28+
Ms = 1.1e6
29+
A = 2e-12
30+
D = 3.9e-3
31+
Ku = 2.5e6
32+
Bz = 1.
33+
34+
sim.set_Ms(Ms)
35+
sim.add(fidimag.micro.UniformExchange(A))
36+
sim.add(fidimag.micro.UniaxialAnisotropy(Ku, axis=(0, 0, 1)))
37+
sim.add(fidimag.micro.Zeeman((0, 0, Bz / C.mu_0)))
38+
39+
# sim.add(fidimag.micro.DMI(D, dmi_type='interfacial'))
40+
sim.add(fidimag.micro.DMI([D, D], dmi_type='D_n'))
41+
42+
sim.set_m(init_m)
43+
44+
sim.driver.do_precession = False
45+
sim.driver.alpha = 0.9
46+
47+
sim.relax()

0 commit comments

Comments
 (0)