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 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 MFMKernel(mesh *d.Mesh, lift, tipsize float64) (kernel [3]*d.Slice)
- func SaveKernel(fname string, kernel *data.Slice) error
Constants ¶
View Source
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 )
View Source
const ( X = 0 Y = 1 Z = 2 )
View Source
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 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.
Click to show internal directories.
Click to hide internal directories.