<jupyter_start><jupyter_text>Figure 02: StabilityIn this notebook, one data point from Figure 2 in [Beg *et al.* Stable and manipulable Bloch point. *Scientific Reports*, **9**, 7959 (2019)](https://doi.org/10.1038/s41598-019-44462-2) is simulated:This provides all the information necessary to fully create Figure 2.We need to simulate hysteretic behaviour of a $150 \,\text{nm}$ disk, which consists of two layers with different sign of Dzyaloshinskii-Moriya constant $D$. The bottom layer with $D0$ has $10 \,\text{nm}$ thickness. We start by importing the necessary modules and creating the mesh with two regions.<jupyter_code>import oommfc as oc
import discretisedfield as df
%matplotlib inline

d = 150e-9
hb = 20e-9
ht = 10e-9
cell = (5e-9, 5e-9, 2.5e-9)
n = (31, 31, 5)
regions = {'r1': df.Region(p1=(-d/2, -d/2, -hb), p2=(d/2, d/2, 0)),
           'r2': df.Region(p1=(-d/2, -d/2, 0), p2=(d/2, d/2, ht))}
p1 = (-d/2, -d/2, -hb)
p2 = (d/2, d/2, ht)
mesh = oc.Mesh(p1=p1, p2=p2, n=n, regions=regions)<jupyter_output><empty_output><jupyter_text>The mesh domain and the discretisation cells are:<jupyter_code>mesh.k3d()<jupyter_output><empty_output><jupyter_text>or using `matplotlib`:<jupyter_code>mesh.mpl()<jupyter_output><empty_output><jupyter_text>and the two regions we defined are:<jupyter_code>mesh.k3d_regions()<jupyter_output><empty_output><jupyter_text>Now, we need to define the system object, and by setting magnetisation saturation, set the geometry to be a disk.<jupyter_code>D = {'r1': 1.58e-3, 'r2': -1.58e-3, 'r1:r2': 1.58e-9}
Ms = 3.84e5
A = 8.78e-12

def Ms_fun(pos):
    x, y, z = pos
    if x**2 + y**2 <= (d/2)**2:
        return Ms
    else:
        return 0

system = oc.System(name='bloch-point')
system.hamiltonian = oc.Exchange(A=A) + oc.DMI(D=D, crystalclass='T') + oc.Demag()
system.m = df.Field(mesh, dim=3, value=(0, 0, 1), norm=Ms_fun)<jupyter_output><empty_output><jupyter_text>Our sample is now:<jupyter_code>system.m.norm.k3d_nonzero()<jupyter_output><empty_output><jupyter_text>The magnetisation in the horizontal cross-section is:<jupyter_code>system.m.plane('z').k3d_vectors(head_size=30)<jupyter_output><empty_output><jupyter_text>or using `matplotlib`:<jupyter_code>system.m.plane('z').mpl(figsize=(8, 8))<jupyter_output><empty_output><jupyter_text>Now, we can minimise the system's energy by using `MinDriver`.<jupyter_code>md = oc.MinDriver()
md.drive(system, overwrite=True)<jupyter_output>2019/11/28 16:15: Running OOMMF (bloch-point.mif) ... (1.2 s)<jupyter_text>The out-of-plane magnetisation component ($m_{z}$) is now:<jupyter_code>system.m.z.k3d_voxels(norm_field=system.m.norm)<jupyter_output><empty_output><jupyter_text>We can see that two vortices with different orientation emerged. We can inspect this closer by plotting two layers of magnetisation in two different layers:<jupyter_code>import k3d
plot = k3d.plot()
system.m.plane(z=-10e-9, n=(20, 20)).k3d_vectors(plot=plot, color_field=system.m.z, head_size=30)
system.m.plane(z=5e-9, n=(20, 20)).k3d_vectors(plot=plot,color_field=system.m.z, head_size=30)
plot.display()<jupyter_output><empty_output><jupyter_text>We can now plot another cross section and see that the Bloch point emerged.<jupyter_code>system.m.plane('y').mpl(figsize=(10, 5))
system.m.plane('y').k3d_vectors(color_field=system.m.z, head_size=30)
system.m.z.plane('y').k3d_voxels(color_field=system.m.z)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15533411488862836, 'fraction_numerical': 0.05041031652989449, 'mean_word_length': 5.922920892494929, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 48, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '12', 'dir': 'jupyter-structured-clean-dedup', 'id': '374423', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1463, 'n_tokens_neox': 1351, 'n_words': 296, 'path': 'figure-02-stability.ipynb', 'repo_name': 'reproducible-micromagnetics/2019-stable-and-manipulable-bloch-point', 'size': '3412'}