Source-linked AI summary

The design and verification of Mumax3

Arne Vansteenkiste, Jonathan Leliaert, Mykola Dvornik, Felipe Garcia-Sanchez, Bartel Van Waeyenberge

arXiv:1406.7635v3physics.comp-phcond-mat.mes-hall

TL;DR

Micromagnetic simulation needs accurate, scalable tools for modeling time-dependent magnetization in nano- to micro-sized magnets. This paper presents and verifies MuMax3, showing GPU acceleration of 1–2 orders of magnitude over CPU-based simulations while supporting large-scale simulations with low memory requirements.

  • Problem

    Existing micromagnetic simulations require verified tools that can efficiently model time-dependent magnetization dynamics at nano- to micro-scales.

  • Method

    The paper describes MuMax3’s components, verifies them against analytical solutions and micromagnetic standard problems, and evaluates speed and memory consumption.

  • Results

    GPU acceleration provides a 1–2 orders-of-magnitude speed-up over CPU-based micromagnetic simulations, while MuMax3 fits 10–16 million cells in 2 GB of GPU RAM.

  • Takeaways & Limitations

    MuMax3 enables large-scale micromagnetic simulations on inexpensive hardware through GPU acceleration, low memory requirements, and extensible open-source software.

  • Takeaways & Limitations

    MFM images and Voronoi tessellation are implemented only in 2D and have been tested qualitatively.

Abstract

from arXiv · show

We report on the design, verification and performance of mumax3, an open-source GPU-accelerated micromagnetic simulation program. This software solves the time- and space dependent magnetization evolution in nano- to micro scale magnets using a finite-difference discretization. Its high performance and low memory requirements allow for large-scale simulations to be performed in limited time and on inexpensive hardware. We verified each part of the software by comparing results to analytical values where available and to micromagnetic standard problems. mumax3 also offers specific extensions like MFM image generation, moving simulation window, edge charge removal and material grains.

I. INTRODUCTION … III. DYNAMICAL TERMS

MuMax3 is an open-source, GPU-accelerated finite-difference micromagnetic simulator for nano- to micro-sized ferromagnets, designed for accessible, programmable simulations. The paper describes its geometry, material-region, interface, and dynamical-term implementations, and verifies component correctness, standard-problem behavior, performance, and reproducibility.

  • I. INTRODUCTION: MuMax3 computes space- and time-dependent magnetization dynamics in nano- to micro-sized ferromagnets using GPU-accelerated finite-difference discretization.It uses a 2D or 3D grid of orthorhombic cells, with volumetric quantities at cell centers and interfacial quantities on cell faces.
  • I. INTRODUCTION: MuMax3 is open-source Go and CUDA software distributed under GPLv3 and requires an NVIDIA GPU with only the vendor driver as an additional dependency.It runs on Linux, Windows, or Mac platforms.
  • I. INTRODUCTION: The paper verifies individual components against analytical values, evaluates integrated behavior on micromagnetic standard problems, and reports speed and memory consumption.Comparisons typically use OOMMF, which the paper describes as widely used and tested for over more than a decade.
  • A. Material Regions: Material regions use indices between 0 and 256 to select parameters from 256-element lookup tables, preserving memory while supporting distinct materials.Interfacial parameters are stored in a triangular matrix indexed by interacting region numbers, allowing arbitrary exchange coupling between material pairs.
  • B. Geometry: MuMax3 defines complex parametrized magnet geometries through Constructive Solid Geometry, combining rotated, translated, scaled, and boolean-composed shapes.Shapes are represented by functions that return whether a coordinate lies inside them.
  • C. Interface: A dedicated scripting language resembling a subset of Go defines simulations, while native Go libraries enable more powerful input generation and output processing.The web interface can construct, control, and repeat simulations by generating corresponding input files.
  • C. Interface: MuMax3 uses OOMMF’s OVF format for space-dependent input and output, with conversion tools for VTK, gnuplot, CSV, JSON, and image formats.Outputs are also compatible with the MuView 3D rendering software.
  • III. DYNAMICAL TERMS: MuMax3 evolves the unit-length reduced magnetization m(r, t), whose time derivative is called the torque τ with units 1/s.The dynamical-terms section states that τ has three contributions and identifies the Slonczewski spin-transfer torque among them.

A. Landau-Lifshitz torque · B. Magnetostatic field

MuMax3 evolves magnetization using an explicit Landau-Lifshitz torque whose effective field combines applied, magnetostatic, exchange, anisotropy, and thermal contributions. Its magnetostatic solver uses an FFT-accelerated finite-difference convolution, symmetry-reduced kernels, and validation tests covering accuracy and periodic boundaries.

  • A. Landau-Lifshitz torque: The explicit Landau-Lifshitz torque uses gyromagnetic ratio γLL, damping parameter α, and effective field Beff, whose default γLL is user-overridable.Beff includes external, magnetostatic, Heisenberg exchange, Dzyaloshinskii-Moriya exchange, magneto-crystalline anisotropy, and thermal fields.
  • A. Landau-Lifshitz torque: The Landau-Lifshitz torque was validated using a single spin precessing without damping in a constant external field.This validation is shown in Fig. 3.
  • B. Magnetostatic field: Finite-difference discretization evaluates the magnetostatic field as a discrete convolution of magnetization with a demagnetizing kernel.The magnetization is M = Msat m, with Msat denoting saturation magnetization.
  • B. Magnetostatic field: The magnetostatic convolution is FFT-accelerated, while the kernel assumes constant cell magnetization and uses distance- and aspect-ratio-dependent numerical integration.The kernel is initialized on CPU in double precision and truncated to single precision before GPU transfer.
  • B. Magnetostatic field: 9 × or 12 × lower kernel memory usage results from exploiting mirror symmetries and zero elements in 2D or 3D simulations, respectively.This reduction contributes to MuMax3’s relatively low memory requirements.
  • B. Magnetostatic field: Demagnetizing-factor tests for uniformly magnetized cubes achieved 3 or 4 digits of short-range accuracy across varying cell aspect ratios.The cube’s analytically known demagnetizing factor is -1/3 in each direction.
  • B. Magnetostatic field: The single-cell long-range field with Bsat=1 T remained accurate down to about 0.01 µT, the FFT-induced single-precision noise floor.Kernel and field results were compared with the corresponding point-dipole field.
  • B. Magnetostatic field: Periodic-boundary tests found comparable demagnetizing factors between PBC simulations and equivalent larger non-PBC grids for films and rods.The implementation approximately maps gridsize (Nx, Ny, Nz) with PBCs (Px, Py, Pz) to (2PxNx, 2PyNy, 2PzNz) without PBCs.

C. Heisenberg exchange interaction · D. Dzyaloshinskii-Moriya interaction

MuMax3 models Heisenberg exchange with a six-neighbor small-angle approximation and verifies it against an analytical spiral, while handling material interfaces and boundaries explicitly. It also implements thin-film Dzyaloshinskii–Moriya interaction with finite-difference derivatives and compares the resulting domain-wall transformation with prior work.

  • C. Heisenberg exchange interaction: MuMax3 evaluates the Heisenberg exchange field using a six-neighbor small-angle approximation.The approximation uses the six nearest neighbors of the central cell.
  • C. Heisenberg exchange interaction: MuMax3 verifies exchange-energy calculations against the exact energy of a 1D magnetization spiral.The implementation calculates energy from the effective field and compares numerical and analytical forms.
  • C. Heisenberg exchange interaction: 20–30°: neighboring-spin angles should remain below this range for accurate exchange energy by choosing sufficiently small cells.The numerical approximation is accurate when cell size is sufficiently small compared with the exchange length.
  • C. Heisenberg exchange interaction: Neumann boundary conditions: missing neighboring magnetizations are replaced by the central cell’s magnetization.This treatment applies at magnet boundaries.
  • C. Heisenberg exchange interaction: Harmonic mean: MuMax3 averages Aex/Msat between neighboring cells with different material parameters using this inter-region exchange treatment.The scaling factor S is set to 1 by default and can modify coupling between regions, including grains or antiferromagnetically coupled layers.
  • D. Dzyaloshinskii-Moriya interaction: Thin-film out-of-plane symmetry breaking: MuMax3 provides the induced Dzyaloshinskii–Moriya interaction for this geometry.The interaction is formulated through an effective-field term and associated energy density.
  • D. Dzyaloshinskii-Moriya interaction: Bloch-to-Néel wall transformation: varying Dex in a 250 nm wide, 0.6 nm thick Co/Pt film produces results corresponding well to prior work.The DMI implementation is compared with Thiaville et al.’s study of this transformation.
  • D. Dzyaloshinskii-Moriya interaction: Central derivatives: MuMax3 computes spatial derivatives from neighboring magnetizations over twice the cell distance.At boundaries, missing neighbors are replaced using the central magnetization, the selected partial derivative, the cell size, and the boundary normal; these conditions also apply to the Heisenberg exchange field when D is nonzero.

E. Magneto-crystalline anisotropy · F. Thermal fluctuations · G. Zhang-Li Spin-transfer torque

MuMax3 implements and verifies uniaxial and cubic magneto-crystalline anisotropy, finite-temperature fluctuations, and Zhang–Li spin-transfer torque. Thermal simulations agree with the analytical switching-rate model, while the torque implementation is tested against Standard Problem #5.

  • E. Magneto-crystalline anisotropy: MuMax3 implements uniaxial magneto-crystalline anisotropy through an effective-field term defined by first- and second-order constants and an anisotropy-direction unit vector.The corresponding energy density is calculated from the effective field.
  • E. Magneto-crystalline anisotropy: The uniaxial anisotropy energy derived from the effective field is verified in Fig. 7, also testing the associated field.
  • E. Magneto-crystalline anisotropy: MuMax3 implements cubic magneto-crystalline anisotropy with first-, second-, and third-order constants and mutually perpendicular anisotropy directions, computing the third direction automatically.The cubic energy density is likewise computed using the effective field and verified in Fig. 7.
  • F. Thermal fluctuations: MuMax3 provides finite-temperature dynamics through a fluctuating thermal field following Brown, with a newly sampled standard-normal random vector at every time step.The field depends on damping, temperature, saturation magnetization, gyromagnetic ratio, cell volume, and time step.
  • F. Thermal fluctuations: Thermal fluctuations restrict simulations to the Euler and Heun solvers and enforce a fixed time step because the thermal field changes between steps.These constraints avoid feedback issues associated with adaptive time-step algorithms.
  • F. Thermal fluctuations: MuMax3’s temperature-dependent switching-rate simulations for a particle with V =(10 nm)3 and Ku1=1×104 or 2×104 J/m3 correspond well to the analytical Eq.25 model.The verification uses an easy uniaxial-anisotropy macrospin in the high-barrier limit.
  • G. Zhang-Li Spin-transfer torque: MuMax3 includes Zhang–Li spin-transfer torque for electrical current flowing through more than one cell layer, with validity tested using Standard Problem #5.The implementation uses current density, non-adiabaticity, the Bohr magneton, and saturation magnetization expressed in Tesla.

H. Slonczewski Spin-transfer torque … A. Standard Problem #1

MuMax3 implements and verifies Slonczewski spin-transfer torque, multiple Runge–Kutta time integrators, and energy relaxation, then applies these methods to micromagnetic standard problems. Verification includes agreement with OOMMF for torque-driven switching, solver convergence tests, near-equilibrium residual torques, and a qualitative standard-problem #1 solution where reference results disagree.

  • H. Slonczewski Spin-transfer torque: MuMax3 models Slonczewski spin-transfer torque for the free layer, while fixed-layer magnetization is treated as a material parameter on top of it.The fixed layer’s stray field is not included automatically but may be pre-computed and added as a space-dependent external field.
  • H. Slonczewski Spin-transfer torque: −6 mA switching simulations in a 160 nm × 80 nm × 5 nm Permalloy rectangle produced MuMax3 and OOMMF results that corresponded well.The test used P = 0.5669, Λ=2, ϵ′=1, a fixed-layer polarization 20° from x, and uniform initial magnetization along x.
  • A. Dynamics: RK45 is the default dynamical solver, providing 5-th order convergence and a 4-th order error estimate for adaptive time-step control.RK32 provides 3-th order convergence and performs better than RK45 for relaxation, while RK12 is used for finite-temperature simulations because it does not require torque continuity between steps.
  • A. Dynamics: Solver convergence rates were verified by single-spin precession tests, showing 1st, 2nd, 3rd, and 5th order behavior until limited by single-precision arithmetic.Adaptive methods control the error per step toward the preset MaxErr value, whose default is 10−5.
  • B. Energy minimization: Relax disables precession and switches from energy monitoring to torque monitoring near the energy noise floor to approach an energy minimum.Typical residual torques after Relax were 10−4–10−7 γLLT, although convergence to a saddle point or flat energy region remains possible.
  • B. Energy minimization: Relax uses RK23, which requires half as many torque evaluations per step as RK45 near equilibrium and generally performs better in relaxation scenarios.The procedure was used in the presented standard problems and proved adequate.
  • V. STANDARD PROBLEMS: MuMax3 supplied solutions for micromagnetic standard problems #1–4 and #5, using published references or OOMMF 1.2 alpha 5 bis as comparison sources.Standard problem #1 concerns hysteresis loops of a 1 µm × 2 µm × 20 nm Permalloy rectangle for fields approximately parallel to its long and short axes.
  • A. Standard Problem #1: Standard problem #1 could not be quantitatively validated because the submitted reference solutions disagree with one another.MuMax3’s solution used a 2D grid of 3.90625 nm cells, with thermal fluctuations applied after each field step to enable transitions over small energy barriers.

B. Standard Problem #2 … B. Voronoi Tessellation

MuMax3 reproduces established micromagnetic standard-problem results, including analytical and OOMMF benchmarks, while providing extensions for moving simulation windows and 2D grain modeling. These extensions support domain-wall tracking and customizable Voronoi grains but are less generally usable and only qualitatively tested in 2D.

  • B. Standard Problem #2: MuMax3’s standard-problem #2 coercivity results best approach the analytical small-particle limit, testing numerical integration of the demagnetizing kernel.Accurate reproduction requires proper averaging of the magnetostatic field over each cell volume.
  • C. Standard Problem #3: The standard-problem #3 ground-state transition occurs at L=8.47, in quantitative agreement with solutions submitted by Rave et al. and Martins et al.The problem identifies transitions among quasi-uniform, vortex-like, and other stable states.
  • D. Standard Problem #4: MuMax3’s solution to standard problem #4 agrees with OOMMF for dynamic reversal under both prescribed fields.The benchmark uses a 500 nm × 125 nm × 3 nm Permalloy magnet and compares time-dependent and space-dependent magnetization.
  • E. Standard Problem #5: The standard-problem #5 time-dependent average magnetization agrees well with the OOMMF solution when a homogeneous current drives a vortex toward a new equilibrium.The applied current is j = 1012 Am−2 along x.
  • VI. EXTENSIONS: MuMax3’s extensions include MFM images and Voronoi tessellation, but these are implemented only in 2D and have been only qualitatively tested.Extensions are considered more specific to certain needs and less generally usable than the main features.
  • A. Moving frame: The moving-frame extension translates magnetization along the x-axis so the simulation window can follow a region of interest, while optionally maintaining a selected average magnetization component near zero.It can also remove end magnetic charges to model an effectively infinitely long wire without closure domains.
  • B. Voronoi Tessellation: The 2D Voronoi extension generates grain-shaped regions with up to 256 region numbers, whose material parameters can vary to model anisotropy or exchange-coupling differences.When the simulation window moves, new grains are generated from cell-coordinate hashes without storing a map beyond the current grid.

C. Magnetic force microscopy … VIII. CONCLUSION

MuMax3 combines GPU-accelerated micromagnetic simulation with fast MFM generation, high throughput, low memory use, and extensible functionality. Performance depends on sufficiently large, FFT-friendly grids and suitable GPU hardware, enabling large-scale simulations with substantial CPU speed-ups.

  • C. Magnetic force microscopy: MuMax3 generates dynamic AC-mode MFM images from 2D magnetization using convolution-based force derivatives evaluated on the GPU.It supports idealized dipole or monopole tips at arbitrary elevation and aims to produce contrast proportional to actual MFM contrast.
  • C. Magnetic force microscopy: GPU-accelerated FFT implementation makes MFM image generation generally take only a few milliseconds, enabling real-time viewing during magnetization evolution.
  • A. Simulation size: Throughput reaches its nearly constant theoretical behavior at about 256 000 cells on a GTX TITAN; smaller simulations underutilize the GPU.Large simulations are where GPU speed-up is most needed and performance is optimal.
  • A. Simulation size: FFT performance is best for power-of-two and 7-smooth grid sizes, while other sizes can incur penalties of up to about an order of magnitude.The recommended 7-smooth numbers have only factors 2, 3, 5 and 7, and modest grid oversizing can improve performance.
  • B. Hardware: With a proper GPU and sufficiently large grids, MuMax3 achieves a 20–45 × speed-up over a quad-core CPU and an 80–180 × speed-up over a single-core CPU.The comparison uses OOMMF throughput of around 4×10^6 cells/s on a quad-core 2.1 GHz Core i7 CPU.
  • B. Hardware: MicroMagnum’s throughput is nearly indistinguishable from MuMax3’s because both are dominated by CUDA FFT routines.On a GTX650M, their timing differences were comparable to measurement noise.
  • C. Memory use: On a 2 GB GPU, MuMax3 supports about 9 million cells in 2D and 6 million in 3D, or about 2 × more than MicroMagnum v0.2.Lower-order solvers increase capacity to 12×10^6 cells with RK23 or 16×10^6 cells with RK12 in 2D; a 6 GB GTX TITAN or K20XM stores 31 M cells in 2D with RK45.
  • VIII. CONCLUSION: The conclusion attributes 1–2 orders of magnitude CPU speed-up and large-scale simulation capability to GPU acceleration and low memory requirements.MuMax3 is open-source and extensible, with merged extensions including a moving simulation window, edge charge removal, Voronoi tessellation and MFM images.

Appendix A: Input scripts … 5. Sheet demag tensor with PBC (Table II)

Appendix A provides Mumax3 input scripts covering geometry construction, precession, cube demagnetization tensors, long-range demagnetization, and periodic-boundary-condition sheet demagnetization.

  • 1. Geometry (Fig. 2): The geometry script defines a 256 × 128 × 32 grid with 4e-9 m cells and constructs a translated ellipsoid joined to a rotated rectangle.The rectangle is rotated by 20*pi/180 before being translated and added to the ellipsoid.
  • 2. Precession (Fig. 3): The precession script uses a 1 × 1 × 1 grid, 1e-9 m cells, uniform magnetization along x, and an external field of 0.1 along z.Demagnetization is disabled, data are autosaved every 10e-12, and the simulation runs for 3e-9.
  • 3. Cube demag tensor (Table I): The cube demagnetization-tensor scripts vary grid aspect ratios while preserving unit-scale cell dimensions through reciprocal cell-size settings.One script sets grid size to (aspect, aspect, 1) with cell size (1/aspect, 1/aspect, 1), while another uses (1, 1, aspect) with cell size (1, 1, 1/aspect).
  • 3. Cube demag tensor (Table I): The cube tensor scripts write aspect-ratio cases and the Kx.x(), Ky.y(), and Kz.z() tensor components to result.txt.Both in-plane and out-of-plane aspect-ratio arrangements are recorded.
  • 4. Long-range demag (Fig. 4): The long-range demagnetization script uses a 512 × 1 × 1 grid with 1e-9 m cells.This script specifies the one-dimensional simulation geometry used for the long-range demagnetization case.
  • 5. Sheet demag tensor with PBC (Table II): The periodic sheet-demagnetization script evaluates average demagnetizing fields on N × N × 1 grids with PBC sizes i = 2^j.The PBC results are written to pbc.txt.
  • 5. Sheet demag tensor with PBC (Table II): A comparison script replaces PBC with an equivalent enlarged grid and evaluates the demagnetizing field over its central slab.It uses a 2iN × 2iN × 1 grid without PBC and averages the central cN × cN region into nopbc.txt.

6. Rod demag tensor with PBC (Table III) … 9. Uniaxial anisotropy (Fig. 7)

The verification sections define numerical tests for the rod demagnetizing tensor with periodic boundary conditions, exchange energy, DMI-induced wall conversion, and uniaxial anisotropy. The tests compare periodic and nonperiodic evaluations or record energy behavior under specified material and geometry settings.

  • 6. Rod demag tensor with PBC (Table III): The rod demagnetizing-tensor test varies periodicity along one axis and records the averaged demagnetizing field.The periodic length is set as i := pow(2, j), while the grid uses SetPBC(0, 0, i).
  • 6. Rod demag tensor with PBC (Table III): A corresponding large-grid calculation without PBC evaluates the demagnetizing field over a central region for comparison.The central region is defined with defRegion(1, cuboid(c*N, c*N, c*N)), and its average is written to nopbc.txt.
  • 7. Exchange energy (Fig. 5): The exchange-energy test uses a 1024-cell one-dimensional periodic grid with cell size c = 1e-9.It sets SetGridSize(N, 1, 1), SetCellSize(c, c, c), and SetPBC(1, 0, 0).
  • 7. Exchange energy (Fig. 5): The exchange test specifies A = 10e-12 and Msat = 1e6 while disabling the demagnetizing interaction.The setup includes Aex = A, Msat = 1e6, and EnableDemag = false.
  • 7. Exchange energy (Fig. 5): A sinusoidal magnetization is initialized, and the computed exchange energy is compared with vol * A * pow(2*pi*k / (N*c), 2).The transverse components use my := sin(phase) and mz := cos(phase), with phase := (i * k * 2*pi) / N.
  • 8. DM interaction (Fig. 6): The DMI test examines conversion of a Bloch wall to a Néel wall using a two-domain down-up configuration.The passage identifies the test as inspired by Thiaville et al. EPL 100 2012 and places a wall between Bloch and Néel types.
  • 8. DM interaction (Fig. 6): The DMI simulation uses a 128 × 128 × 1 grid with 250e-9/128 in-plane cell sizes and 0.6e-9 thickness.The material parameters include Msat = 1100e3, Aex = 16e-12, alpha = 3, and Ku1 = 1.27E6.
  • 9. Uniaxial anisotropy (Fig. 7): The uniaxial-anisotropy test records energy density versus theta for positive and negative first- and second-order anisotropy constants.It evaluates Ku1 = 1e6, Ku1 = -1e6, Ku2 = 1e6, and Ku2 = -1e6 with the other coefficient set to zero.

10. Cubic anisotropy (Fig. 7) … 14. Standard Problem 1 (Fig. 12)

The sections specify tests of cubic anisotropy, thermal fluctuations, Slonczewski spin-transfer torque, solver convergence and MaxErr, and Standard Problem 1. They provide simulation parameters and procedures for evaluating these cases.

  • 11. Thermal fluctuations (Fig. 8): Thermal-fluctuation simulations vary Temp and Ku1, equilibrate for 10e-9 s, then run for 1e-6 s while autosaving magnetization.The model sets Msat = 1e6, Aex = 0, alpha = 0.1, and disables demagnetization.
  • 12. Slonzewski STT (Fig. 9): The Slonczewski STT test uses a 160e-9 × 80e-9 × 5e-9 m discretized magnet with current = -0.006 A and a 20° fixed-layer direction.It runs for 2e-9 s with table autosaves every 10e-12 s.
  • 13. Solver convergence and MaxErr (Figs. 10 and 11): Solver convergence tests sweep maxErr from 1e-8 to below 1e-2 in multiplicative steps of sqrt(2).The simulations use B = 0.1 Tesla, Msat = 1/mu0, Aex = 10e-12, and disabled demagnetization.
  • 13. Solver convergence and MaxErr (Figs. 10 and 11): For each solver setting, the simulation runs one period and compares the averaged magnetization with the analytical solution m0 = (1/sqrt(2), 0, 1/sqrt(2)).The recorded outputs include runtime/(Step-N0) and the vector-length error between analytical and simulated magnetization.
  • 14. Standard Problem 1 (Fig. 12): Standard Problem 1 uses a 512 × 256 × 1 grid for a 2e-6 × 1e-6 × 20e-9 m sample.Parameters are Aex = 1.3e-11, Msat = 8.0e5, Ku1 = 5.0e2, and an easy axis nominally parallel to the long edge.
  • 14. Standard Problem 1 (Fig. 12): The Standard Problem 1 virgin curve starts from a vortex perturbed with 0.9 times random magnetization and increments B by 1e-3 from 0.0 to Bmax.The field sweep is defined by m = vortex(1, 1).add(0.9, randommag()).

15. Standard Problem 2 (Figs. 13 and 14) … 18. Standard Problem 5 (Fig. 17)

Standard Problems 2–5 define simulation setups that vary geometry, discretization, material parameters, applied fields, and runtime procedures. The scripts measure remanence, coercivity, relaxed magnetization and energy components, dynamic reversal, or time evolution for comparison with the corresponding figures.

  • 15. Standard Problem 2 (Figs. 13 and 14): Standard Problem 2 scans magnet size d from 30 down to 1 while computing the exchange length lex and selecting cells no larger than 0.5lex.The grid is set with nx = 5·2^ilogb(Sizex/(5·0.5·lex)) and ny = nx/5.
  • 15. Standard Problem 2 (Figs. 13 and 14): Standard Problem 2 obtains remanence by relaxing a uniformly initialized magnetization and finds coercivity by incrementally scanning a field along the negative body diagonal.The output records d, remanence.x(), remanence.y(), and bc/Ms.
  • 16. Standard Problem 3 (Fig. 15): Standard Problem 3 uses an N × N × N grid with N := 16, varies the cell size through c := L·lex/N, and relaxes an initial flower state.The script records relaxed magnetization, total, exchange, demagnetizing, and anisotropy energies, Km, and V.
  • 17. Standard Problem 4 (Fig. 16): Standard Problem 4 discretizes a 500e-9 × 125e-9 × 3e-9 sample with Nx = 200 and Ny = 50, applies B_ext = vector(-24.6E-3, 4.3E-3, 0), and runs until mx.average() is nonpositive.The magnetization is saved before each 1e-9 time-unit run.
  • 18. Standard Problem 5 (Fig. 17): Standard Problem 5 uses a 50 × 50 × 5 grid and cell sizes 100e-9/Nx, 100e-9/Nx, and 10e-9/Nz.The setup specifies Msat = 800e3, Aex = 13e-12, alpha = 0.1, and xi = 0.05.
  • 18. Standard Problem 5 (Fig. 17): Standard Problem 5 autosaves the table every 5e-12 and runs the simulation for 10e-9.The procedure is expressed as tableAutoSave(5e-12) followed by run(10e-9).

19. Extension: moving reference frame (Fig. 18) … 22. Benchmark: memory (Fig. 23)

Sections 19–22 present implementation examples for a moving reference frame and MFM imaging, followed by throughput and memory benchmark procedures. The benchmarks specify simulation parameters and record performance or maximum tested grid size under increasing computational load.

  • 19. Extension: moving reference frame (Fig. 18): The moving-reference-frame example uses a 512 × 64 × 1 grid with 2e-9 m in-plane cells and 20e-9 m thickness.The setup defines Nx := 512, Ny := 64, c := 2e-9, and the corresponding grid and cell sizes.
  • 19. Extension: moving reference frame (Fig. 18): It removes surface charges on the mx=1 and mx=-1 sides to mimic an infinitely long wire.The procedure applies ext_rmSurfaceCharge with BoundaryRegion := 0, MagLeft := 1, and MagRight := -1.
  • 19. Extension: moving reference frame (Fig. 18): The simulation drives the sample with J = vector(-3e12, 0, 0) at polarization 0.56 and runs for 5e-9 s.The script sets pol = 0.56, J = vector(-3e12, 0, 0), and Run(5e-9).
  • 20. Extension: Magnetic Force Microscopy (Fig. 20): The MFM example models a 750e-9 m square geometry on a 512 × 512 × 1 grid with 2e-9 m lateral cells and 10e-9 m thickness.The setup uses setgridsize(512, 512, 1), setcellsize(2e-9, 2e-9, 10e-9), and setgeom(rect(750e-9, 750e-9)).
  • 20. Extension: Magnetic Force Microscopy (Fig. 20): MFM images are generated for lift-height indices from 10 through 200 in increments of 10.The loop runs for i:=10; i<=200; i+=10.
  • 21. Benchmark: throughput (Figs. 21 and 22): The throughput benchmark uses Msat = 800e3, Aex = 13e-12, alpha = 0.01, an external field vector(0, 0.01, 0), and 4e-9 m cubic cells.The initial magnetization is uniform(1, 0, 0), and the cell size is set to 4e-9 m in all three directions.
  • 21. Benchmark: throughput (Figs. 21 and 22): For throughput, the script records N2, N2*nevl/wall, and t/nevl after measuring elapsed time and evaluation count.It computes wall := since(start).Seconds() and nevl := Neval() - neval0 before writing benchmark.txt.
  • 22. Benchmark: memory (Fig. 23): The memory benchmark increases e from 5 to below 100, sets n = 128*e, and stops when a one-step simulation runs out of memory.After setgridsize(n, n, 1) and steps(1), it records n*n as the number of cells in mem.txt.
Loading 1406.7635v3…