Domain wall simulation¶
Initialize a domain wall configuration with the --init dw option:
$ llg3d --solver opencl --n_profile 1 --precision single --init dw --T 1300 --Jy 81 --Jz 81 --N 20
Initializing OpenCL solver...
Initializing context...
---
x y z
J 300 81 81
L 2.99000000e-07 8.00000000e-08 8.00000000e-08
d 1.00000000e-09 1.00000000e-09 1.00000000e-09
---
dV = 1.00000000e-27
V = 1.91360000e-21
ntot = 1968300
ncell = 1913600
---
Failed to read file: /tmp/dep-acf35a.d
/builds/llg3d/llg3d/.venv/lib/python3.11/site-packages/pyopencl/__init__.py:570: CompilerWarning: Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.
lambda: self._prg.build(options_bytes, devices),
build program: kernel 'predict' was part of a lengthy uncached source build (assuming cached by ICD) (0.20 s)
element : Cobalt
N = 20
dt = 1e-14
Jx = 300
Jy = 81
Jz = 81
dx = 1e-09
T = 1300.0
H_ext = 0.0
init_type : dw
result_file : run.npz
start_averaging = 4000
n_mean = 1
n_profile = 1
solver : opencl
precision : single
blocking = False
seed = 12345
device : auto
profiling = False
verbosity : INFO
np = 1
0%| | 0/20 [00:00<?, ?it/s]Failed to read file: /tmp/dep-5fe647.d
build program: kernel 'rng_gen_philox4x32_normal' was part of a lengthy uncached source build (assuming cached by ICD) (0.26 s)
5%|▌ | 1/20 [00:00<00:05, 3.45it/s]
40%|████ | 8/20 [00:00<00:00, 25.37it/s]
75%|███████▌ | 15/20 [00:00<00:00, 39.55it/s]
100%|██████████| 20/20 [00:00<00:00, 35.52it/s]N iterations = 20
total_time [s] = 0.585
time/ite [s/ite] = 2.924e-02
efficiency [s/ite/pt] = 1.486e-08
CFL = 7.543e-02
Saving run.npz
This will create a domain wall in the yz plane at the center of the sample. The magnetization will point in the +x direction on the left side of the wall and in the -x direction on the right side of the wall.
The --n_profile 1 option specifies that the magnetization profile along the x direction
will be saved every time step.
Longitudinal profiles are created by averaging the magnetization
in the yz plane and stored in the x_profiles key of the result file:
$ llg3d.info run.npz
...
results/records
x_profiles
t
shape: (21,), dtype: float64
m1
shape: (21, 300), dtype: float32
m2
shape: (21, 300), dtype: float32
m3
shape: (21, 300), dtype: float32
xyz_average
shape: (21, 2), dtype: float64
Now, to vizualize the domain wall profile at different time steps (see llg3d.post.x_profiles):
$ llg3d.x_profiles run.npz -m 1 -t ::2 -i x_profiles_2.png
Written to x_profiles_2.png
