### Install Git on Linux Source: https://github.com/mumax/3/blob/master/README.md Installs the Git version control system on Linux. ```bash sudo apt install git ``` -------------------------------- ### Check Git Installation Source: https://github.com/mumax/3/blob/master/README.md Verify that Git is installed on your system. ```bash git --version ``` -------------------------------- ### Check mumax3 Installation on Linux Source: https://github.com/mumax/3/blob/master/README.md Verify the mumax3 installation and run a test on Linux. ```bash which mumax3 mumax3 -test ``` -------------------------------- ### Check mumax3 Installation on Windows Source: https://github.com/mumax/3/blob/master/README.md Verify the mumax3 installation and run a test on Windows. ```bat where.exe mumax3.exe mumax3 -test ``` -------------------------------- ### Check Gnuplot Installation Source: https://github.com/mumax/3/blob/master/README.md Verify that gnuplot is installed and accessible. ```bash gnuplot -V ``` -------------------------------- ### Installing ubuntu-drivers-common on WSL Source: https://github.com/mumax/3/blob/master/README.md Installs the `ubuntu-drivers-common` package, which provides the `ubuntu-drivers` command. This is necessary if the command is not found in a WSL environment. ```bash sudo apt install ubuntu-drivers-common ``` -------------------------------- ### Installing Recommended NVIDIA Driver on Ubuntu Source: https://github.com/mumax/3/blob/master/README.md Installs the NVIDIA driver version recommended by the `ubuntu-drivers devices` command. Replace `` with the specific driver version number. ```bash sudo apt install nvidia-driver- ``` -------------------------------- ### Install GCC on Linux Source: https://github.com/mumax/3/blob/master/README.md Installs the GCC compiler on Linux. Be mindful of CUDA version compatibility with GCC versions. ```bash sudo apt-get install gcc ``` -------------------------------- ### Rotating Geometry Example in mumax3 Source: https://github.com/mumax/3/blob/master/doc/templates/examples-template.html This example demonstrates how to define a complex geometry with holes and then rotate it over time. It uses boolean operations to create the shape and a loop to apply rotations and save snapshots of the magnetization. ```mumax3 setgridsize(128, 128, 1) setcellsize(2e-9, 2e-9, 2e-9) d := 200e-9 sq := rect(d, d) // square with side d h := 50e-9 hole := cylinder(h, h) // circle with diameter h hole1 := hole.transl(100e-9, 0, 0) // translated circle #1 hole2 := hole.transl(0, -50e-9, 0) // translated cricle #2 cheese:= sq.sub(hole1).sub(hole2)// subtract the circles from the square (makes holes). setgeom(cheese) msat = 600e3 aex = 12e-13 alpha = 3 // rotate the cheese. for i:=0; i<=90; i=i+30{ angle := i*pi/180 setgeom(cheese.rotz(angle)) m = uniform(cos(angle), sin(angle), 0) minimize() save(m) } ``` -------------------------------- ### Install NVIDIA Driver on Linux Source: https://github.com/mumax/3/blob/master/README.md Installs the NVIDIA driver on Debian-based Linux systems. Ensure you replace '' with the appropriate driver version. ```bash sudo apt install software-properties-gtk sudo add-apt-repository universe sudo add-apt-repository multiverse sudo apt update sudo apt install nvidia-driver- ``` -------------------------------- ### Verifying NVIDIA Driver Installation Source: https://github.com/mumax/3/blob/master/README.md Checks if the NVIDIA driver is installed and running correctly, displaying driver and CUDA versions, GPU details, and active processes. ```bash nvidia-smi ``` -------------------------------- ### Set Initial Magnetization States in mumax3 Source: https://github.com/mumax/3/blob/master/doc/templates/examples-template.html Shows how to initialize magnetization using functions like Uniform, Vortex, TwoDomain, and RandomMag. Demonstrates transformations such as rotation, scaling, and translation applied to magnetization states. Includes examples of setting magnetization within specific shapes or cells, and loading from files. ```mumax3 setgridsize(256, 128, 1) setcellsize(5e-9, 5e-9, 5e-9) m = Uniform(1, 1, 0) // no need to normalize length saveas(m, "uniform") m = Vortex(1, -1) // circulation, polarization saveas(m, "vortex") m = TwoDomain(1,0,0, 0,1,0, -1,0,0) // Néel wall saveas(m, "twodomain") m = RandomMag() saveas(m, "randommag") m = TwoDomain(1,0,0, 0,1,0, -1,0,0).rotz(-pi/4) saveas(m, "twodomain_rot") m = VortexWall(1, -1, 1, 1) saveas(m, "vortexwall") m = VortexWall(1, -1, 1, 1).scale(1/2, 1, 1) saveas(m, "vortexwall_scale") m = Vortex(1,-1).transl(100e-9, 50e-9, 0) saveas(m, "vortex_transl") m = Vortex(1,-1).Add(0.1, randomMag()) saveas(m, "vortex_add_random") m = BlochSkyrmion(1, -1).scale(3,3,1) saveas(m, "Bloch_skyrmion") m = NeelSkyrmion(1,-1).scale(3,3,1) saveas(m, "Néel_skyrmion") ``` ```mumax3 // set m in only a part of space, or a single cell: m = uniform(1, 1, 1) m.setInShape(cylinder(400e-9, 100e-9), vortex(1, -1)) m.setCell(20, 10, 0, vector(0.1, 0.1, -0.9)) // set in cell index [20,10,0] saveas(m, "setInShape_setCell") ``` ```mumax3 //Read m from .ovf file. m.loadfile("myfile.ovf") saveas(m, "loadfile") ``` -------------------------------- ### Save and Table Add Examples Source: https://github.com/mumax/3/blob/master/doc/templates/api-template.html Demonstrates saving output quantities to .ovf files and adding them to the data table. Includes saving/tabling specific regions and adding user-defined variables. ```mumax3 save(B_ext) tableadd(B_ext) tablesave() save(m.Region(1)) TableAdd(m.Region(1)) myField := 0.42 TableAddVar(myField, "B_extra", "T") myField = ... ``` -------------------------------- ### Updating System Packages on Linux Source: https://github.com/mumax/3/blob/master/README.md Ensures your system's package list and installed packages are up-to-date. This is a standard step before installing new software or drivers. ```bash sudo apt update && sudo apt upgrade ``` -------------------------------- ### Checking Installed NVIDIA Drivers on Linux Source: https://github.com/mumax/3/blob/master/README.md Use this command to list installed NVIDIA drivers on a Debian-based Linux system. It helps in identifying existing driver packages before proceeding with a clean installation. ```bash dpkg -l | grep nvidia ``` -------------------------------- ### Rebooting System on Linux Source: https://github.com/mumax/3/blob/master/README.md Applies system-wide changes, including newly installed drivers, by restarting the computer. ```bash sudo reboot ``` -------------------------------- ### Install Gnuplot on Linux Source: https://github.com/mumax/3/blob/master/README.md Install gnuplot on Debian-based Linux distributions for generating graphs. ```bash sudo apt-get install gnuplot ``` -------------------------------- ### ext_dwtilt Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Gets the PMA domain wall tilt in radians. Supports averaging and evaluation. ```APIDOC ## ext_dwtilt ### Description PMA domain wall tilt (rad). ### Methods - Average( ) - EvalTo( Slice ) - Get( ) ``` -------------------------------- ### ext_dwxpos Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Gets the x-position of the simulation window while following a domain wall in meters. Supports averaging and evaluation. ```APIDOC ## ext_dwxpos ### Description Position of the simulation window while following a domain wall (m). ### Methods - Average( ) - EvalTo( Slice ) - Get( ) ``` -------------------------------- ### RandomMag() Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Initializes a random magnetization configuration. This method is useful for starting simulations with a disordered magnetic state. ```APIDOC ## RandomMag() ### Description Initializes a random magnetization configuration. ### Method RandomMag() ### Return Value Config ``` -------------------------------- ### RandomMagSeed(int) Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Initializes a random magnetization configuration using a specified seed for reproducibility. This allows for consistent random starting states in simulations. ```APIDOC ## RandomMagSeed(int) ### Description Initializes a random magnetization configuration with a given seed. ### Method RandomMagSeed(int) ### Parameters #### Path Parameters - **int** (int) - The seed for the random number generator. ``` -------------------------------- ### ext_dwpos Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Gets the position of the simulation window while following a domain wall in meters. Supports averaging and evaluation. ```APIDOC ## ext_dwpos ### Description Position of the simulation window while following a domain wall (m). ### Methods - Average( ) - EvalTo( Slice ) - Get( ) ### Examples [11](examples.html#example11) ``` -------------------------------- ### Check GPU Driver and Compute Capability Source: https://github.com/mumax/3/blob/master/doc/templates/download-template.html Run this command in your terminal to check your installed NVIDIA driver version and GPU compute capability. ```bash nvidia-smi --query-gpu="driver_version,compute_cap" --format="csv" ``` -------------------------------- ### Define Primitive Geometries in mumax3 Source: https://github.com/mumax/3/blob/master/doc/templates/examples-template.html Demonstrates the creation of basic geometric shapes like rectangles, cylinders, circles, ellipsoids, and cuboids using the mumax3 API. Includes examples of transformations like translation and rotation, and boolean operations such as addition, subtraction, and intersection. Edge smoothing can be applied to refine the geometry. ```mumax3 SetGridsize(100, 100, 50) SetCellsize(1e-6/100, 1e-6/100, 1e-6/50) EdgeSmooth = 8 setgeom( rect(800e-9, 500e-9) ) saveas(geom, "rect") setgeom( cylinder(800e-9, inf) ) saveas(geom, "cylinder") setgeom( circle(200e-9).repeat(300e-9, 400e-9, 0) ) saveas(geom, "circle_repeat") setgeom( cylinder(800e-9, inf).inverse() ) saveas(geom, "cylinder_inverse") setgeom( cylinder(800e-9, 600e-9).transl(200e-9, 100e-9, 0) ) saveas(geom, "cylinder_transl") setgeom( ellipsoid(800e-9, 600e-9, 500e-9) ) saveas(geom, "ellipsoid") setgeom( cuboid(800e-9, 600e-9, 500e-9) ) saveas(geom, "cuboid") setgeom( cuboid(800e-9, 600e-9, 500e-9).rotz(-10*pi/180) ) saveas(geom, "cuboid_rotZ") setgeom( layers(0, 25) ) saveas(geom, "layers") setgeom( cell(50, 20, 0) ) saveas(geom, "cell") setgeom( xrange(0, inf) ) saveas(geom, "xrange") ``` ```mumax3 a := cylinder(600e-9, 600e-9).transl(-150e-9, 50e-9, 0 ) b := rect(600e-9, 600e-9).transl(150e-9, -50e-9, 0) setgeom( a.add(b) ) saveas(geom, "logicAdd") setgeom( a.sub(b) ) saveas(geom, "logicSub") setgeom( a.intersect(b) ) saveas(geom, "logicAnd") setgeom( a.xor(b) ) saveas(geom, "logicXor") ``` ```mumax3 setgeom( imageShape("mask.png") ) saveas(geom, "imageShape") ``` -------------------------------- ### Set Mesh (GridSize, CellSize, PBC) Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html A convenience function to set the grid size, cell size, and periodic boundary conditions simultaneously. Use this for a consolidated mesh setup. ```mumax SetMesh(128, 64, 1, 5e-9, 5e-9, 5e-9, 0, 0, 0) ``` -------------------------------- ### ext_dwspeed Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Gets the speed of the simulation window while following a domain wall in meters per second. Supports averaging and evaluation. ```APIDOC ## ext_dwspeed ### Description Speed of the simulation window while following a domain wall (m/s). ### Methods - Average( ) - EvalTo( Slice ) - Get( ) ``` -------------------------------- ### Define Custom Quantity: Topological Charge Density Source: https://github.com/mumax/3/blob/master/doc/templates/api-template.html Example of defining a custom quantity within a script. This demonstrates setting cell size and grid size before defining the quantity. ```mumax3 cs := 1e-9 setcellsize(cs,cs,cs) setgridsize(64,64,1) ``` -------------------------------- ### Initialize Go Module Source: https://github.com/mumax/3/blob/master/README.md Initialize a Go module for the mumax3 project and tidy dependencies. ```bash go mod init github.com/mumax/3 go mod tidy ``` -------------------------------- ### Create 3D Voronoi Tesselation for Grains Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Generates a 3D Voronoi tessellation within a specified shape to create grains. Parameters include grain size, starting region number, number of regions, shape, and a random seed. ```mumax ext_make3dgrains(float64, int, int, Shape, int) ``` -------------------------------- ### Set up and run Standard Problem #4 Source: https://github.com/mumax/3/blob/master/doc/templates/examples-template.html Configures grid size, cell size, material properties, and applies an external magnetic field for Standard Problem #4. It then relaxes the system and saves the magnetic state. ```mumax3 SetGridsize(128, 32, 1) SetCellsize(500e-9/128, 125e-9/32, 3e-9) Msat = 800e3 Aex = 13e-12 alpha = 0.02 m = uniform(1, .1, 0) relax() save(m) // relaxed state autosave(m, 200e-12) tableautosave(10e-12) B_ext = vector(-24.6E-3, 4.3E-3, 0) run(1e-9) ``` -------------------------------- ### Build mumax3 on Linux Source: https://github.com/mumax/3/blob/master/README.md Compile mumax3 from source on a Linux system using make. ```bash make realclean make ``` -------------------------------- ### Load Initial Magnetization from File Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Loads the initial magnetization configuration from an external file (e.g., an OVF file). ```mumax m.LoadFile("config.ovf") ``` -------------------------------- ### Uninstalling NVIDIA Drivers on Linux Source: https://github.com/mumax/3/blob/master/README.md This command removes all installed NVIDIA-related packages from a Debian-based system. It's a preparatory step for a clean driver installation. ```bash sudo apt-get --purge remove '*nvidia*' ``` -------------------------------- ### ext_InitGeomFromOVF Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Initialize geometry, cell count and cell size given a pattern from OVF. ```APIDOC ## ext_InitGeomFromOVF ### Description Initialize geometry, cell count and cell size given a pattern from OVF. ### Parameters #### Path Parameters - **string** (string) - Description not available ``` -------------------------------- ### ext_InitGeomFromOVF Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Initializes geometry, cell count, and cell size from an OVF pattern. Takes a string argument. ```APIDOC ## ext_InitGeomFromOVF ### Description Initializes the geometry, cell count, and cell size of the simulation based on a pattern provided in an OVF file. ### Method Function call ### Endpoint Not applicable (function call) ### Parameters - **pattern** (string) - Required - The path or identifier for the OVF pattern. ### Request Example `ext_InitGeomFromOVF("path/to/your/pattern.ovf")` ### Response None specified ``` -------------------------------- ### OpenBC Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Sets the boundary condition to open (default is false). ```APIDOC ## OpenBC ### Description Use open boundary conditions (default=false) ``` -------------------------------- ### ext_bubblepos Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Gets the bubble core position in meters. Supports averaging and evaluation. ```APIDOC ## ext_bubblepos ### Description Bubble core position (m). ### Methods - Average( ) - EvalTo( Slice ) - Get( ) ``` -------------------------------- ### ext_bubbledist Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Gets the traveled distance of a bubble in meters. Supports averaging and evaluation. ```APIDOC ## ext_bubbledist ### Description Bubble traveled distance (m). ### Methods - Average( ) - EvalTo( Slice ) - Get( ) ``` -------------------------------- ### Set GOPATH and PATH on Linux Source: https://github.com/mumax/3/blob/master/README.md Manually sets the GOPATH and adds the Go bin directory to your PATH. Apply changes by sourcing your .bashrc file. ```bash export GOPATH=$HOME/go export PATH=$GOPATH/bin:$PATH ``` -------------------------------- ### ext_topologicalcharge Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Calculates the 2D topological charge. Supports Average, EvalTo, and Get methods. ```APIDOC ## ext_topologicalcharge ### Description Calculates the 2D topological charge. This method provides access to Average, EvalTo, and Get operations. ### Method Not specified (likely a function call or property access) ### Endpoint Not applicable ### Parameters None explicitly listed for the main function, but methods like EvalTo might take arguments. ### Request Example `ext_topologicalcharge.Average()` `ext_topologicalcharge.EvalTo(slice)` `ext_topologicalcharge.Get()` ### Response Results depend on the method called (e.g., Average, EvalTo, Get). ``` -------------------------------- ### Build mumax3 on Windows Source: https://github.com/mumax/3/blob/master/README.md Build mumax3 executables for Windows using a PowerShell script, specifying CUDA versions and compute capabilities. ```powershell ./deploy_windows.ps1 -CUDA_VERSIONS -CUDA_CC ``` -------------------------------- ### ext_bubblespeed Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Gets the bubble velocity in meters per second. Supports averaging and evaluation. ```APIDOC ## ext_bubblespeed ### Description Bubble velocity (m/s). ### Methods - Average( ) - EvalTo( Slice ) - Get( ) ``` -------------------------------- ### Layer Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Retrieves a single layer (along z-axis) by its integer index, starting from 0. ```APIDOC ## Layer ### Description Retrieves a single layer (along z-axis) by its integer index, starting from 0. ### Signature **Layer**(int) Shape ### Methods - **Add**(Shape) - **Intersect**(Shape) - **Inverse**() - **Repeat**(float64, float64, float64) - **RotX**(float64) - **RotY**(float64) - **RotZ**(float64) - **Scale**(float64, float64, float64) - **Sub**(Shape) - **Transl**(float64, float64, float64) - **Xor**(Shape) ``` -------------------------------- ### Print Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Prints arguments to standard output. ```APIDOC ## Print ### Description Prints to standard output. ### Parameters #### Path Parameters - **...interface {}** (...interface {}) - Description not available ``` -------------------------------- ### AddTo Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Adds a Slice to a configuration. ```APIDOC ## AddTo(Slice) ### Description Adds the contents of a Slice object to the current configuration. This is a direct element-wise addition. ``` -------------------------------- ### ext_hopfindex_twopointstencil Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Calculates the Hopf index using a two-point stencil. Supports Average, EvalTo, and Get methods. ```APIDOC ## ext_hopfindex_twopointstencil ### Description Calculates the Hopf index using a two-point stencil. This method provides access to Average, EvalTo, and Get operations. ### Method Not specified (likely a function call or property access) ### Endpoint Not applicable ### Parameters None explicitly listed for the main function, but methods like EvalTo might take arguments. ### Request Example `ext_hopfindex_twopointstencil.Average()` `ext_hopfindex_twopointstencil.EvalTo(slice)` `ext_hopfindex_twopointstencil.Get()` ### Response Results depend on the method called (e.g., Average, EvalTo, Get). ``` -------------------------------- ### Detecting Recommended NVIDIA Driver on Ubuntu Source: https://github.com/mumax/3/blob/master/README.md This command analyzes your system's hardware and available drivers to recommend the most suitable NVIDIA driver for your GPU. ```bash ubuntu-drivers devices ``` -------------------------------- ### ext_hopfindex_fivepointstencil Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Calculates the Hopf index using a five-point stencil. Supports Average, EvalTo, and Get methods. ```APIDOC ## ext_hopfindex_fivepointstencil ### Description Calculates the Hopf index using a five-point stencil. This method provides access to Average, EvalTo, and Get operations. ### Method Not specified (likely a function call or property access) ### Endpoint Not applicable ### Parameters None explicitly listed for the main function, but methods like EvalTo might take arguments. ### Request Example `ext_hopfindex_fivepointstencil.Average()` `ext_hopfindex_fivepointstencil.EvalTo(slice)` `ext_hopfindex_fivepointstencil.Get()` ### Response Results depend on the method called (e.g., Average, EvalTo, Get). ``` -------------------------------- ### Variable Declaration and Assignment Source: https://github.com/mumax/3/blob/master/doc/templates/api-template.html Demonstrates how to declare new variables using ':=' and assign values to existing variables using '='. Type inference is shown. ```mumax3 i := 7 // defines a new variable i, type automatically detected to be int print(i) // now we can use i i = 5 // assign new value, don't use ':=' str := "hello" // defines str, type automatically is string //str = 1 // would fail, cannot assign int to string ``` -------------------------------- ### ext_corepos Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Gets the vortex core position (x,y) and polarization (z) in meters. Supports averaging and evaluation. ```APIDOC ## ext_corepos ### Description Vortex core position (x,y) + polarization (z) (m). ### Methods - Average( ) - EvalTo( Slice ) - Get( ) ``` -------------------------------- ### Steps(int) Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Runs the simulation for a specified number of time steps. ```APIDOC ## Steps(int) ### Description Runs the simulation for a specified number of time steps. ### Method Steps(numSteps int) ``` -------------------------------- ### Arithmetic Operations and Math Functions Source: https://github.com/mumax/3/blob/master/doc/templates/api-template.html Shows common arithmetic operations and the usage of functions from Go's math library, including a custom power function. ```mumax3 x := pi*(3+4)/5 x = pow(x, 3) x++ y := abs(cbrt(cosh(erf(erfc(gamma(J0(Y0(2)))))))) ``` -------------------------------- ### Const Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Creates a constant, uniform number. Returns a Quantity. ```APIDOC ## Const ### Description Constant, uniform number. ### Parameters #### Path Parameters - **float64** (float64) - Description not available ### Returns - **Quantity** (Quantity) - Description not available ``` -------------------------------- ### ext_topologicalchargelattice Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Calculates the 2D topological charge according to Berg and Lüscher. Supports Average, EvalTo, and Get methods. ```APIDOC ## ext_topologicalchargelattice ### Description Calculates the 2D topological charge using the Berg and Lüscher method. This method provides access to Average, EvalTo, and Get operations. ### Method Not specified (likely a function call or property access) ### Endpoint Not applicable ### Parameters None explicitly listed for the main function, but methods like EvalTo might take arguments. ### Request Example `ext_topologicalchargelattice.Average()` `ext_topologicalchargelattice.EvalTo(slice)` `ext_topologicalchargelattice.Get()` ### Response Results depend on the method called (e.g., Average, EvalTo, Get). ``` -------------------------------- ### Initialize Geometry from OVF File Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Initializes the simulation geometry, cell count, and cell size based on patterns found in an OVF (OOMMF Vector Field) file. ```mumax ext_InitGeomFromOVF(string) ``` -------------------------------- ### ext_hopfindex_solidangle Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Calculates the Hopf index using the Berg-Lüscher lattice method. Supports Average, EvalTo, and Get methods. ```APIDOC ## ext_hopfindex_solidangle ### Description Calculates the Hopf index using the Berg-Lüscher lattice method. This method provides access to Average, EvalTo, and Get operations. ### Method Not specified (likely a function call or property access) ### Endpoint Not applicable ### Parameters None explicitly listed for the main function, but methods like EvalTo might take arguments. ### Request Example `ext_hopfindex_solidangle.Average()` `ext_hopfindex_solidangle.EvalTo(slice)` `ext_hopfindex_solidangle.Get()` ### Response Results depend on the method called (e.g., Average, EvalTo, Get). ``` -------------------------------- ### Layers Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Retrieves a portion of space between two cell layers (inclusive start, exclusive end) by their integer indices. ```APIDOC ## Layers ### Description Retrieves a portion of space between two cell layers (inclusive start, exclusive end) by their integer indices. ### Signature **Layers**(int, int) Shape ### Methods - **Add**(Shape) - **Intersect**(Shape) - **Inverse**() - **Repeat**(float64, float64, float64) - **RotX**(float64) - **RotY**(float64) - **RotZ**(float64) - **Scale**(float64, float64, float64) - **Sub**(Shape) - **Transl**(float64, float64, float64) - **Xor**(Shape) ``` -------------------------------- ### Add Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Adds a configuration to another. ```APIDOC ## Add(float64 Config) ### Description Adds another configuration to the current one. This is typically used for combining different spin configurations. ``` -------------------------------- ### Miscellaneous Methods Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Provides control over solver steps, demagnetization calculations, and program exit. ```APIDOC ## Misc ### ClearPostSteps Clear the postStep array, which contains functions that are executed after each solver step. ### DemagAccuracy Controls accuracy of demag kernel. ### DoPrecess Enables LL precession (default=true). ### EnableDemag Enables/disables demag (default=true). ### Exit Exit from the program. ### Expect Used for automated tests: checks if a value is close enough to the expected value. ### ExpectV Used for automated tests: checks if a vector is close enough to the expected value. ### exx exx component of the strain tensor. ### exy exy component of the strain tensor. ``` -------------------------------- ### B_anis Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Anisotropy field (T). Provides methods to average, get components, evaluate to a slice, copy from host, and access regions. ```APIDOC ## B_anis ### Description Anisotropy field in Tesla (T). This field represents the anisotropy contribution to the total magnetic field. ### Methods - **Average()**: Calculates the average value of the anisotropy field over the entire simulation domain. - **Comp(int)**: Retrieves a specific component (x, y, or z) of the anisotropy field. - **EvalTo(Slice)**: Evaluates the anisotropy field and stores it in a provided Slice object. - **HostCopy()**: Copies the anisotropy field data from the device to the host memory. - **Region(int)**: Accesses a specific region of the anisotropy field. ``` -------------------------------- ### AddGo Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Adds a Go function to a configuration. ```APIDOC ## AddGo(Slice func() float64) ### Description Adds a Go function that returns a float64, defined over a Slice, to the current configuration. This provides a way to incorporate custom logic. ``` -------------------------------- ### SetSolver Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Selects the numerical solver for the simulation. Different solvers offer varying trade-offs between accuracy and performance. ```APIDOC ## SetSolver ### Description Selects the numerical solver for the simulation. Different solvers offer varying trade-offs between accuracy and performance. ### Method SetSolver ### Parameters - **solverType** (int) - The type of solver to use. Options include: 1: Euler 2: Heun 3: Bogacki-Shampine 4: Runge-Kutta (RK4) 5: Dormand-Prince 6: Fehlberg -1: Backward Euler ``` -------------------------------- ### Get Polar Angle Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Retrieves the polar angle in radians. This is a fundamental property often used in spherical coordinate systems. ```mumax ext_theta() ``` -------------------------------- ### Get Azimuthal Angle Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Retrieves the azimuthal angle in radians. This is a fundamental property often used in spherical coordinate systems. ```mumax ext_phi() ``` -------------------------------- ### OVF2_BINARY Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Sets the output format to binary OVF2. ```APIDOC ## OVF2_BINARY ### Description OutputFormat = OVF2_BINARY sets binary OVF2 output. ``` -------------------------------- ### Calculate 2D Topological Charge Density (Lattice Method) Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Calculates the 2D topological charge density according to the Berg and Lüscher method. The result is in units of 1/m2. ```mumax ext_topologicalchargedensitylattice() ``` -------------------------------- ### Run(float64) Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Executes the simulation for a specified duration in seconds. This is the primary method for advancing the simulation time. ```APIDOC ## Run(float64) ### Description Runs the simulation for a specified time in seconds. ### Method Run(float64) ### Parameters #### Path Parameters - **float64** (float64) - The duration in seconds to run the simulation. ``` -------------------------------- ### CropZ Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Crops a quantity to cell ranges along the Z-axis. It takes a Quantity and two integers defining the start and end cell indices. ```APIDOC ## CropZ ### Description Crops a quantity to cell ranges [z1,z2[ along the Z-axis. ### Method CropZ(Quantity, int, int) ### Returns *cropped Quantity ``` -------------------------------- ### Select Driver Function Source: https://github.com/mumax/3/blob/master/doc/templates/download-template.html JavaScript function to generate the download link based on the selected platform and driver (CUDA version). ```javascript function selectDriver() { var driverSelector = document.getElementById("driver"); var platformSelector = document.getElementById("platform"); var platform = platformSelector.options[platformSelector.selectedIndex].value; var cudaVersion = driverSelector.options[driverSelector.selectedIndex].value; var link; if (platform == "windows") { link = "https://mumax.ugent.be/mumax3-binaries/mumax3.12_windows_cuda" + cudaVersion + ".zip"; } else if (platform == "linux") { link = "https://mumax.ugent.be/mumax3-binaries/mumax3.12_linux_cuda" + cudaVersion + ".tar.gz"; } else { link = "#"; } document.getElementById("downloadButton").disabled = false; document.getElementById("downloadLink").href = link; } ``` -------------------------------- ### Initial Magnetization Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Methods for setting the initial magnetization of the simulation, including uniform, regional, and file-based configurations. ```APIDOC ## m (Magnetization) ### Description Represents the reduced magnetization (unit length) of the simulation. Allows setting magnetization uniformly, in specific regions, or by loading configuration files. ### Methods Average( ), Buffer( ), Comp( int ), EvalTo( Slice ), GetCell( int int int ), LoadFile( string ), Quantity( ), Region( int ), Set( Config ), SetArray( Slice ), SetCell( int int int data.Vector ), SetInShape( Shape Config ), SetRegion( int Config ) ### Usage Examples ``` m = uniform(1, 0, 0) m.SetRegion(1, vortex(1, 1)) m.LoadFile("config.ovf") m.SetInShape(circle(50e-9), uniform(0,0,1)) ``` ``` -------------------------------- ### CropY Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Crops a quantity to cell ranges along the Y-axis. It takes a Quantity and two integers defining the start and end cell indices. ```APIDOC ## CropY ### Description Crops a quantity to cell ranges [y1,y2[ along the Y-axis. ### Method CropY(Quantity, int, int) ### Returns *cropped Quantity ``` -------------------------------- ### CropX Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Crops a quantity to cell ranges along the X-axis. It takes a Quantity and two integers defining the start and end cell indices. ```APIDOC ## CropX ### Description Crops a quantity to cell ranges [x1,x2[ along the X-axis. ### Method CropX(Quantity, int, int) ### Returns *cropped Quantity ``` -------------------------------- ### For Loop Control Structure Source: https://github.com/mumax/3/blob/master/doc/templates/api-template.html Illustrates the use of a standard for loop for iteration. ```mumax3 for i:=0; i<10; i++{ print(i) } ``` -------------------------------- ### ext_hopfindex_solidanglefourier Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Calculates the Hopf index using the Berg-Lüscher lattice method with an emergent field Fourier transformed. Supports Average, EvalTo, and Get methods. ```APIDOC ## ext_hopfindex_solidanglefourier ### Description Calculates the Hopf index using the Berg-Lüscher lattice method, applying a Fourier transform to the emergent field. This method provides access to Average, EvalTo, and Get operations. ### Method Not specified (likely a function call or property access) ### Endpoint Not applicable ### Parameters None explicitly listed for the main function, but methods like EvalTo might take arguments. ### Request Example `ext_hopfindex_solidanglefourier.Average()` `ext_hopfindex_solidanglefourier.EvalTo(slice)` `ext_hopfindex_solidanglefourier.Get()` ### Response Results depend on the method called (e.g., Average, EvalTo, Get). ``` -------------------------------- ### Steps Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Executes the simulation for a specified number of time steps. ```APIDOC ## Steps ### Description Executes the simulation for a specified number of time steps. ### Method Steps ### Parameters - **numSteps** (int) - The number of time steps to run the simulation. ``` -------------------------------- ### Run(float64) Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Runs the simulation for a specified duration in seconds. ```APIDOC ## Run(float64) ### Description Runs the simulation for a specified duration in seconds. ### Method Run(time float64) ### Examples [1](examples.html#example1), [7](examples.html#example7), [10](examples.html#example10), [11](examples.html#example11), [12](examples.html#example12), [14](examples.html#example14), [15](examples.html#example15) ``` -------------------------------- ### Aex Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Represents the exchange stiffness material parameter. Supports methods for averaging, evaluating to a slice, getting region-specific values, checking uniformity, and setting values. ```APIDOC ## Aex ### Description Represents the exchange stiffness material parameter (J/m). Supports methods for averaging, evaluating to a slice, getting region-specific values, checking uniformity, and setting values. ### Methods - **Average()**: Calculates the average exchange stiffness. - **EvalTo(Slice)**: Evaluates the exchange stiffness to a slice. - **GetRegion(int)**: Retrieves the exchange stiffness for a specific region. - **IsUniform()**: Checks if the exchange stiffness is uniform. - **MSlice()**: Returns a slice representation of the exchange stiffness. - **Region(int)**: Accesses the exchange stiffness for a specific region. - **Set(float64)**: Sets a uniform exchange stiffness value. - **SetRegion(int, ScalarFunction)**: Sets the exchange stiffness for a specific region using a scalar function. - **SetRegionFuncGo(int, func() float64)**: Sets the exchange stiffness for a specific region using a Go function. - **SetRegionValueGo(int, float64)**: Sets the exchange stiffness for a specific region with a Go-provided float64 value. ``` -------------------------------- ### ext_make3dgrains Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Generates a 3D Voronoi tesselation over a given shape. Arguments include grain size, starting region number, number of regions, shape, and seed. ```APIDOC ## ext_make3dgrains ### Description 3D Voronoi tesselation over shape. ### Parameters #### Path Parameters - **float64** (float64) - grain size - **int** (int) - starting region number - **int** (int) - num regions - **Shape** (Shape) - shape - **int** (int) - seed ``` -------------------------------- ### Simulate hysteresis loop Source: https://github.com/mumax/3/blob/master/doc/templates/examples-template.html Sets up simulation parameters and iteratively applies an external magnetic field, minimizing the system's energy at each step to obtain the hysteresis loop. It uses 'minimize()' for small changes and 'relax()' for high-energy initial states. ```mumax3 SetGridsize(128, 32, 1) SetCellsize(4e-9, 4e-9, 30e-9) Msat = 800e3 Aex = 13e-12 m = randomMag() relax() // high-energy states best minimized by relax() Bmax := 100.0e-3 Bstep := 1.0e-3 TableAdd(B_ext) for B:=0.0; B<=Bmax; B+=Bstep{ B_ext = vector(B, 0, 0) minimize() // small changes best minimized by minimize() tablesave() } for B:=Bmax; B>=-Bmax; B-=Bstep{ B_ext = vector(B, 0, 0) minimize() // small changes best minimized by minimize() tablesave() } for B:=-Bmax; B<=Bmax; B+=Bstep{ B_ext = vector(B, 0, 0) minimize() // small changes best minimized by minimize() tablesave() } ``` -------------------------------- ### Set Solver Type Source: https://github.com/mumax/3/blob/master/doc/templates/api-template.html Change the simulation solver using SetSolver with an integer argument. The default is the RK45 solver. ```mumax3 SetSolver(2) // Heun FixDt = 1e-15 ``` -------------------------------- ### Slonczewski STT MRAM Bit Switching Source: https://github.com/mumax/3/blob/master/doc/templates/examples-template.html Simulates the switching of an MRAM bit using Slonczewski spin-transfer torque. This example models only the free layer explicitly and sets the fixed layer polarization, spacer layer parameters, current polarization, and current density. ```mumax3 // geometry sizeX := 160e-9 sizeY := 80e-9 sizeZ := 5e-9 Nx := 64 Ny := 32 setgridsize(Nx, Ny, 1) setcellsize(sizeX/Nx, sizeY/Ny, sizeZ) setGeom(ellipse(sizeX, sizeY)) // set up free layer Msat = 800e3 Aex = 13e-12 alpha = 0.01 m = uniform(1, 0, 0) // set up spacer layer parameters lambda = 1 Pol = 0.5669 epsilonprime = 0 // set up fixed layer polarization angle := 20 px := cos(angle * pi/180) py := sin(angle * pi/180) fixedlayer = vector(px, py, 0) // send current Jtot := -0.008 // total current in A area := sizeX*sizeY*pi/4 jc := Jtot / area // current density in A/m2 J = vector(0, 0, jc) // schedule output & run autosave(m, 100e-12) tableautosave(10e-12) run(1e-9) ``` -------------------------------- ### ext_centerWall Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Shifts m after each step to keep m_c close to zero. This is an extended functionality. ```APIDOC ## ext_centerWall(int) ### Description Shifts magnetization (m) after each step to ensure the magnetization component (m_c) remains close to zero. ### Parameters #### Path Parameters - **c** (int) - Description not provided in source. ``` -------------------------------- ### Transl Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Translates a configuration by given amounts. ```APIDOC ## Transl(float64, float64, float64) ### Description Translates the current configuration by the specified amounts along the x, y, and z axes. The float64 arguments represent the translation distances for each axis. ``` -------------------------------- ### Material Parameters Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Methods for setting and retrieving material properties like anisotropy constants, saturation magnetization, and temperature. ```APIDOC ## Material Parameters ### Description Methods for setting and retrieving material properties. ### Methods - **Average()**: Calculates the average value of the parameter. - **EvalTo(Slice)**: Evaluates the parameter to a slice. - **GetRegion(int)**: Retrieves the parameter value for a specific region. - **IsUniform()**: Checks if the parameter is uniform across all regions. - **MSlice()**: Returns a slice representation of the parameter. - **Region(int)**: Gets the parameter value for a specific region. - **Set(float64)**: Sets the parameter to a uniform value. - **SetRegion(int, ScalarFunction)**: Sets the parameter value for a specific region using a scalar function. - **SetRegionFuncGo(int, func() float64)**: Sets the parameter value for a specific region using a Go function. - **SetRegionValueGo(int, float64)**: Sets the parameter value for a specific region with a Go-provided float64 value. ### Available Parameters - **Ku1**: 1st order uniaxial anisotropy constant (J/m3) - **Ku2**: 2nd order uniaxial anisotropy constant (J/m3) - **Lambda**: Slonczewski Λ parameter - **Msat**: Saturation magnetization (A/m) - **NoDemagSpins**: Disable magnetostatic interaction per region (default=0, set to 1 to disable). E.g.: NoDemagSpins.SetRegion(5, 1) disables the magnetostatic interaction in region 5. - **Pol**: Electrical current polarization - **Temp**: Temperature (K) - **xi**: Non-adiabaticity of spin-transfer-torque ``` -------------------------------- ### Define Disk Geometry with Anisotropy Source: https://github.com/mumax/3/blob/master/doc/templates/examples-template.html Sets up a disk geometry with different anisotropy in the left and right halves, defining regions and saving material parameters. ```mumax3 N := 128 setgridsize(N, N, 1) c := 4e-9 setcellsize(c, c, c) // disk with different anisotropy in left and right half setgeom(circle(N*c)) defregion(1, xrange(0, inf)) // left half defregion(2, xrange(-inf, 0)) // right half save(regions) Ku1.setregion(1, .1e6) anisU.setRegion(1, vector(1, 0, 0)) Ku1.setregion(2, .2e6) ani sU.setRegion(2, vector(0, 1, 0)) save(Ku1) save(anisU) Msat = 800e3 // sets it everywhere save(Msat) Aex = 12e-13 alpha = 1 m.setRegion(1, uniform(1, 1, 0)) m.setRegion(2, uniform(-1, 1, 0)) saveas(m, "m_inital") run(.1e-9) saveas(m, "m_final") ``` -------------------------------- ### OVF1_BINARY Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Sets the output format to binary OVF1. ```APIDOC ## OVF1_BINARY ### Description OutputFormat = OVF1_BINARY sets binary OVF1 output. ``` -------------------------------- ### LoadFile Source: https://github.com/mumax/3/blob/master/doc/static/api3111.html Loads data from a specified file, supporting formats like OVF and dump. This is essential for initializing simulation states or importing external data. ```APIDOC ## LoadFile (string) ### Description Load a data file (ovf or dump). ### Parameters #### Path Parameters - **filePath** (string) - Required - The path to the data file to be loaded. ### Methods - **CPUAccess**() - **Comp**(int) - **DevPtr**(int) - **Disable**() - **Free**() - **GPUAccess**() - **Get**(int, int, int, int) - **Host**() - **HostCopy**() - **Index**(int, int, int) - **IsNil**() - **Len**() - **MemType**() - **Scalars**() - **Set**(int, int, int, int, float64) - **SetScalar**(int, int, int, float64) - **SetVector**(int, int, int, data.Vector) - **Size**() - **Tensors**() - **Vectors**() ```