Documentation ¶
Overview ¶
package mag provides magnetism-specific constants and the demag kernel.
Index ¶
- Constants
- func CalcDemagKernel(inputSize, pbc [3]int, cellsize [3]float64, accuracy float64) (kernel [3][3]*data.Slice)
- func CalcMFMKernel(mesh *d.Mesh, lift, tipsize float64) (kernel [3]*d.Slice)
- func DemagKernel(inputSize, pbc [3]int, cellsize [3]float64, accuracy float64, cacheDir string) (kernel [3][3]*data.Slice)
- func LoadKernel(fname string) (kernel *data.Slice, err error)
- func LoadMFMKernel(fname string) (kernel *d.Slice, err error)
- func MFMKernel(mesh *d.Mesh, lift, tipsize float64, cacheDir string) (kernel [3]*d.Slice)
- func SaveKernel(fname string, kernel *data.Slice, info data.Meta) error
- func SaveMFMKernel(fname string, kernel *d.Slice) error
Constants ¶
const ( Mu0 = 4 * math.Pi * 1e-7 // Permeability of vacuum in Tm/A MuB = 9.2740091523e-24 // Bohr magneton in J/T Kb = 1.380650424e-23 // Boltzmann's constant in J/K Qe = 1.60217646e-19 // Electron charge in C )
const ( X = 0 Y = 1 Z = 2 )
const SMALL_N = 5
Use 2N-1 padding instead of 2N for sizes up to SMALL_N. 5 seems a good choice since for all n<=5, 2*n-1 only has prime factors 2,3,5,7 (good CUFFT performance). starting from 6 it becomes problematic so we use 2*n.
Variables ¶
This section is empty.
Functions ¶
func CalcDemagKernel ¶
func CalcDemagKernel(inputSize, pbc [3]int, cellsize [3]float64, accuracy float64) (kernel [3][3]*data.Slice)
Calculates the magnetostatic kernel by brute-force integration of magnetic charges over the faces and averages over cell volumes.
func CalcMFMKernel ¶
Kernel for the vertical derivative of the force on an MFM tip due to mx, my, mz. This is the 2nd derivative of the energy w.r.t. z.
func DemagKernel ¶
func DemagKernel(inputSize, pbc [3]int, cellsize [3]float64, accuracy float64, cacheDir string) (kernel [3][3]*data.Slice)
Obtains the demag kernel either from cacheDir/ or by calculating (and then storing in cacheDir for next time). Empty cacheDir disables caching.
Types ¶
This section is empty.