Skip to content

Commit 31dec69

Browse files
author
davidcorteso
committed
Updated sandboox example
1 parent 88636c3 commit 31dec69

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

sandbox/more-dmi/isolated_sk_sim.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
import fidimag.common.constant as C
66

77

8-
R_sk = 2
9-
10-
118
def init_m(r):
9+
"""
10+
Initial magnetisation profile; a dot to obtain a skyrmion
11+
"""
12+
R_sk = 2
1213
rho = np.sqrt(r[0] ** 2 + r[1] ** 2)
1314
if rho < R_sk:
1415
return (0, 0, -1)
@@ -37,11 +38,27 @@ def init_m(r):
3738
sim.add(fidimag.micro.Zeeman((0, 0, Bz / C.mu_0)))
3839

3940
# sim.add(fidimag.micro.DMI(D, dmi_type='interfacial'))
40-
sim.add(fidimag.micro.DMI([D, D], dmi_type='D_n'))
41+
42+
# For a C_n material, there is a kind of instability when one of the DM
43+
# constants is larger than approx 0.7 times the other DM constant
44+
sim.add(fidimag.micro.DMI([D, 0.6 * D], dmi_type='C_n'))
4145

4246
sim.set_m(init_m)
4347

4448
sim.driver.do_precession = False
4549
sim.driver.alpha = 0.9
4650

4751
sim.relax()
52+
53+
# ----------------------------------------------------------------------------
54+
# Plot the 2D system
55+
56+
import matplotlib.pyplot as plt
57+
58+
m = sim.spin.reshape(-1, 3)
59+
plt.figure(figsize=(8, 8))
60+
plt.quiver(mesh.coordinates[:, 0], mesh.coordinates[:, 1],
61+
m[:, 0], m[:, 1],
62+
m[:, 2], cmap='RdYlBu'
63+
)
64+
plt.show()

0 commit comments

Comments
 (0)