In this tutorial, we compute and relax a skyrmion in an interfacial-DMI material thin film using periodic boundary conditions.
import discretisedfield as df
import micromagneticmodel as mm
import oommfc as oc
%matplotlib inline
We define mesh in cuboid through corner points p1
and p2
, and discretisation cell size cell
. To define periodic boundary conditions, we pass an additional argument pbc
. This argument can be any iterable (list, tuple, string, set) containing strings 'x'
, 'y'
, and/or 'z'
. Let us assume we want the periodic boundary conditions in $x$ and $y$ directions.
region = df.Region(p1=(-50e-9, -50e-9, 0), p2=(50e-9, 50e-9, 10e-9))
mesh = df.Mesh(region=region, cell=(5e-9, 5e-9, 5e-9), pbc="xy")
Now, we can define the system object:
system = mm.System(name="skyrmion")
system.energy = (
mm.Exchange(A=1.6e-11)
+ mm.DMI(D=4e-3, crystalclass="Cnv")
+ mm.UniaxialAnisotropy(K=0.51e6, u=(0, 0, 1))
+ mm.Zeeman(H=(0, 0, 0.2e5))
)
Ms = 1.1e6
def m_init(pos):
x, y, z = pos
if (x**2 + y**2) ** 0.5 < 10e-9:
return (0, 0, -1)
else:
return (0, 0, 1)
# create system with above geometry and initial magnetisation
system.m = df.Field(mesh, dim=3, value=m_init, norm=Ms)
Finally we can minimise the energy and plot the magnetisation.
# minimize the energy
md = oc.MinDriver()
md.drive(system)
# Plot relaxed configuration: vectors in z-plane
system.m.plane("z").mpl()
2020/03/06 15:22: Running OOMMF (skyrmion.mif) ... (1.0 s)
# Plot z-component only:
system.m.z.plane("z").mpl()
# 3d-plot of z-component
system.m.z.k3d_voxels(norm_field=system.m.norm)
Output()
md.delete(system)