mag

package
v0.0.0-...-8a1f1be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2022 License: CC-BY-3.0, Freetype, GPL-3.0-or-later Imports: 8 Imported by: 0

Documentation

Overview

package mag provides magnetism-specific constants and the demag kernel.

Index

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 CalcMFMKernel

func CalcMFMKernel(mesh *d.Mesh, lift, tipsize float64) (kernel [3]*d.Slice)

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.

func LoadKernel

func LoadKernel(fname string) (kernel *data.Slice, err error)

func LoadMFMKernel

func LoadMFMKernel(fname string) (kernel *d.Slice, err error)

func MFMKernel

func MFMKernel(mesh *d.Mesh, lift, tipsize float64, cacheDir string) (kernel [3]*d.Slice)

func SaveKernel

func SaveKernel(fname string, kernel *data.Slice, info data.Meta) error

func SaveMFMKernel

func SaveMFMKernel(fname string, kernel *d.Slice) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL