Documentation ¶
Overview ¶
engine does the simulation bookkeeping, I/O and GUI.
space-dependence: value: space-independent param: region-dependent parameter (always input) field: fully space-dependent field
TODO: godoc everything
Index ¶
- Constants
- Variables
- func AddAnisotropyEnergyDensity(dst *data.Slice)
- func AddAnisotropyField(dst *data.Slice)
- func AddCustomEnergyDensity(dst *data.Slice)
- func AddCustomField(dst *data.Slice)
- func AddEdensTerm(e Quantity)
- func AddExchangeField(dst *data.Slice)
- func AddFieldTerm(b Quantity)
- func AddMagnetoelasticEnergyDensity(dst *data.Slice)
- func AddMagnetoelasticField(dst *data.Slice)
- func AddSTTorque(dst *data.Slice)
- func AutoSave(q Quantity, period float64)
- func AutoSnapshot(q Quantity, period float64)
- func AverageOf(q Quantity) []float64
- func Break()
- func CenterBubble()
- func CenterWall(magComp int)
- func CheckRecoverable(err error)
- func Close()
- func CompileFile(fname string) (*script.BlockStmt, error)
- func Crop(parent Quantity, x1, x2, y1, y2, z1, z2 int) *cropped
- func CropLayer(parent Quantity, layer int) *cropped
- func CropRegion(parent Quantity, region int) *cropped
- func CropX(parent Quantity, x1, x2 int) *cropped
- func CropY(parent Quantity, y1, y2 int) *cropped
- func CropZ(parent Quantity, z1, z2 int) *cropped
- func DeclConst(name string, value float64, doc string)
- func DeclFunc(name string, f interface{}, doc string)
- func DeclLValue(name string, value LValue, doc string)
- func DeclROnly(name string, value interface{}, doc string)
- func DeclTVar(name string, value interface{}, doc string)
- func DeclVar(name string, value interface{}, doc string)
- func DefRegion(id int, s Shape)
- func DefRegionCell(id int, x, y, z int)
- func DoOutput()
- func Download(q Quantity) *data.Slice
- func EigSolve()
- func EnableUnsafe()
- func Eval(code string)
- func Eval1Line(code string) interface{}
- func EvalFile(code *script.BlockStmt)
- func EvalTo(q interface{ ... }, dst *data.Slice)
- func Exit()
- func Expect(msg string, have, want, maxError float64)
- func ExpectV(msg string, have, want data.Vector, maxErr float64)
- func Export(q interface{ ... }, doc string)
- func FifoRing(length int) fifoRing
- func Fprintln(filename string, msg ...interface{})
- func FreezeSpins(dst *data.Slice)
- func GMinimize()
- func GUIAdd(name string, value interface{})
- func GetAnisotropyEnergy() float64
- func GetBusy() bool
- func GetCustomEnergy() float64
- func GetDWxPos() float64
- func GetDemagEnergy() float64
- func GetExchangeEnergy() float64
- func GetMagnetoelasticEnergy() float64
- func GetMagnetoelasticForceDensity(dst *data.Slice)
- func GetMaxAngle() float64
- func GetMaxTorque() float64
- func GetShiftPos() float64
- func GetShiftYPos() float64
- func GetThermalEnergy() float64
- func GetTopologicalCharge() float64
- func GetTopologicalChargeLattice() float64
- func GetTotalEnergy() float64
- func GetZeemanEnergy() float64
- func GoServe(addr string) string
- func Index2Coord(ix, iy, iz int) data.Vector
- func InitAndClose() func()
- func InitIO(inputfile, od string, force bool)
- func InjectAndWait(task func())
- func InterDind(region1, region2 int, value float64)
- func InterExchange(region1, region2 int, value float64)
- func InterpolatePath(fname1, fname2 string, noi int) *data.Slice
- func IsConst(e script.Expr) bool
- func LoadFile(fname string) *data.Slice
- func LogErr(msg ...interface{})
- func LogIn(msg ...interface{})
- func LogOut(msg ...interface{})
- func LogUsedRefs()
- func Madd(a, b Quantity, fac1, fac2 float64) *mAddition
- func Mesh() *data.Mesh
- func MeshOf(q Quantity) *data.Mesh
- func MeshSize() [3]int
- func Minimize()
- func NameOf(q Quantity) string
- func NewScalarMask(Nx, Ny, Nz int) *data.Slice
- func NewSlice(ncomp, Nx, Ny, Nz int) *data.Slice
- func NewVectorMask(Nx, Ny, Nz int) *data.Slice
- func OD() string
- func PostStep(f func())
- func Refer(tag string)
- func Relax()
- func RemoveCustomEnergies()
- func RemoveCustomFields()
- func RemoveLRSurfaceCharge(region int, mxLeft, mxRight float64)
- func Run(seconds float64)
- func RunInteractive()
- func RunWhile(condition func() bool)
- func SanityCheck()
- func Save(q Quantity)
- func SaveAs(q Quantity, fname string)
- func SavePath(q Quantity, noi int)
- func ScaleInterDind(region1, region2 int, scale float64)
- func ScaleInterExchange(region1, region2 int, scale float64)
- func SetBusy(b bool)
- func SetCellSize(cx, cy, cz float64)
- func SetDemagField(dst *data.Slice)
- func SetEffectiveField(dst *data.Slice)
- func SetGNEB(gneb2D, gneb3D int)
- func SetGeom(s Shape)
- func SetGridSize(Nx, Ny, Nz int)
- func SetImagesNumber(Noi int)
- func SetLLTorque(dst *data.Slice)
- func SetMFM(dst *data.Slice)
- func SetMFull(dst *data.Slice)
- func SetMesh(Nx, Ny, Nz int, cellSizeX, cellSizeY, cellSizeZ float64, pbcx, pbcy, pbcz int)
- func SetMeshGNEB(Nx, Ny, Nz, noi int, cellSizeX, cellSizeY, cellSizeZ float64, ...)
- func SetPBC(nx, ny, nz int)
- func SetPhi(dst *data.Slice)
- func SetSolver(typ int)
- func SetSpinAngle(dst *data.Slice)
- func SetTheta(dst *data.Slice)
- func SetTopologicalChargeDensity(dst *data.Slice)
- func SetTopologicalChargeDensityLattice(dst *data.Slice)
- func SetTorque(dst *data.Slice)
- func SetTotalEdens(dst *data.Slice)
- func Shift(dx int)
- func SizeOf(q Quantity) [3]int
- func Snapshot(q Quantity)
- func SnapshotAs(q Quantity, fname string)
- func Steps(n int)
- func TableAdd(col Quantity)
- func TableAddVariable(x script.ScalarFunction, name, unit string)
- func TableAutoSave(period float64)
- func TablePrint(msg ...interface{})
- func TableSave()
- func ThermSeed(seed int)
- func UnitOf(q Quantity) string
- func VPOminimize()
- func ValueOf(q Quantity) *data.Slice
- func Vector(x, y, z float64) data.Vector
- func Voronoi(grainsize float64, numRegions, seed int)
- func Voronoi3d(grainsize float64, startRegion int, numRegions int, inputShape Shape, seed int)
- func YShift(dy int)
- type BackwardEuler
- type Config
- func AntiVortex(circ, pol int) Config
- func BlochSkyrmion(charge, pol int) Config
- func Conical(q, coneDirection data.Vector, coneAngle float64) Config
- func Helical(q data.Vector) Config
- func NeelSkyrmion(charge, pol int) Config
- func RandomMag() Config
- func RandomMagSeed(seed int) Config
- func TwoDomain(mx1, my1, mz1, mxwall, mywall, mzwall, mx2, my2, mz2 float64) Config
- func Uniform(mx, my, mz float64) Config
- func Vortex(circ, pol int) Config
- func VortexWall(mleft, mright float64, circ, pol int) Config
- type DataTable
- func (t *DataTable) Add(output Quantity)
- func (t *DataTable) AddVariable(x script.ScalarFunction, name, unit string)
- func (t *DataTable) Flush() error
- func (i *DataTable) NComp() int
- func (i *DataTable) Name() string
- func (t *DataTable) Println(msg ...interface{})
- func (t *DataTable) Save()
- func (i *DataTable) Unit() string
- func (t *DataTable) Write(p []byte) (int, error)
- type DerivedParam
- type Eig
- type Euler
- type Excitation
- func (e *Excitation) Add(mask *data.Slice, f script.ScalarFunction)
- func (e *Excitation) AddGo(mask *data.Slice, mul func() float64)
- func (e *Excitation) AddTo(dst *data.Slice)
- func (e *Excitation) Average() data.Vector
- func (e *Excitation) Comp(c int) ScalarField
- func (e *Excitation) Eval() interface{}
- func (e *Excitation) EvalTo(dst *data.Slice)
- func (e *Excitation) InputType() reflect.Type
- func (e *Excitation) IsUniform() bool
- func (p *Excitation) MSlice() cuda.MSlice
- func (e *Excitation) Mesh() *data.Mesh
- func (e *Excitation) NComp() int
- func (e *Excitation) Name() string
- func (e *Excitation) Region(r int) *vOneReg
- func (e *Excitation) RemoveExtraTerms()
- func (e *Excitation) Set(v data.Vector)
- func (e *Excitation) SetRegion(region int, f script.VectorFunction)
- func (e *Excitation) SetRegionFn(region int, f func() [3]float64)
- func (e *Excitation) SetValue(v interface{})
- func (e *Excitation) Slice() (*data.Slice, bool)
- func (e *Excitation) Type() reflect.Type
- func (e *Excitation) Unit() string
- type FixedLayerPosition
- type GMinimizer
- type Heun
- type Info
- type LValue
- type Minimizer
- type OutputFormat
- type Param
- type Quantity
- func Add(a, b Quantity) Quantity
- func Const(v float64) Quantity
- func ConstVector(x, y, z float64) Quantity
- func Cross(a, b Quantity) Quantity
- func Div(a, b Quantity) Quantity
- func Dot(a, b Quantity) Quantity
- func Masked(q Quantity, shape Shape) Quantity
- func Mul(a, b Quantity) Quantity
- func MulMV(Ax, Ay, Az, b Quantity) Quantity
- func Normalized(q Quantity) Quantity
- func Shifted(q Quantity, dx, dy, dz int) Quantity
- type RK23
- type RK4
- type RK45DP
- type RK56
- type Regions
- func (r *Regions) Average() float64
- func (r *Regions) EvalTo(dst *data.Slice)
- func (r *Regions) GetCell(ix, iy, iz int) int
- func (r *Regions) Gpu() *cuda.Bytes
- func (r *Regions) HostArray() [][][]byte
- func (r *Regions) HostList() []byte
- func (r *Regions) LoadFile(fname string)
- func (r *Regions) Mesh() *data.Mesh
- func (i *Regions) NComp() int
- func (i *Regions) Name() string
- func (r *Regions) SetCell(ix, iy, iz int, region int)
- func (r *Regions) Slice() (*data.Slice, bool)
- func (i *Regions) Unit() string
- type RegionwiseScalar
- func (p *RegionwiseScalar) Average() float64
- func (p *RegionwiseScalar) Eval() interface{}
- func (p *RegionwiseScalar) GetRegion(region int) float64
- func (p *RegionwiseScalar) InputType() reflect.Type
- func (p *RegionwiseScalar) IsUniform() bool
- func (p *RegionwiseScalar) MSlice() cuda.MSlice
- func (p *RegionwiseScalar) Mesh() *data.Mesh
- func (p *RegionwiseScalar) Name() string
- func (p *RegionwiseScalar) Region(r int) *sOneReg
- func (p *RegionwiseScalar) Set(v float64)
- func (p *RegionwiseScalar) SetRegion(region int, f script.ScalarFunction)
- func (p *RegionwiseScalar) SetRegionFuncGo(region int, f func() float64)
- func (p *RegionwiseScalar) SetRegionValueGo(region int, v float64)
- func (p *RegionwiseScalar) SetValue(v interface{})
- func (p *RegionwiseScalar) Type() reflect.Type
- func (p *RegionwiseScalar) Unit() string
- type RegionwiseVector
- func (p *RegionwiseVector) Average() data.Vector
- func (p *RegionwiseVector) Comp(c int) ScalarField
- func (p *RegionwiseVector) Eval() interface{}
- func (p *RegionwiseVector) GetRegion(region int) [3]float64
- func (p *RegionwiseVector) InputType() reflect.Type
- func (p *RegionwiseVector) IsUniform() bool
- func (p *RegionwiseVector) MSlice() cuda.MSlice
- func (p *RegionwiseVector) Mesh() *data.Mesh
- func (p *RegionwiseVector) Name() string
- func (p *RegionwiseVector) Region(r int) *vOneReg
- func (p *RegionwiseVector) SetRegion(region int, f script.VectorFunction)
- func (p *RegionwiseVector) SetRegionFn(region int, f func() [3]float64)
- func (p *RegionwiseVector) SetValue(v interface{})
- func (p *RegionwiseVector) Type() reflect.Type
- func (p *RegionwiseVector) Unit() string
- type ScalarExcitation
- func (e *ScalarExcitation) Add(mask *data.Slice, f script.ScalarFunction)
- func (e *ScalarExcitation) AddGo(mask *data.Slice, mul func() float64)
- func (e *ScalarExcitation) AddTo(dst *data.Slice)
- func (e *ScalarExcitation) Average() float64
- func (e *ScalarExcitation) Comp(c int) ScalarField
- func (e *ScalarExcitation) Eval() interface{}
- func (e *ScalarExcitation) EvalTo(dst *data.Slice)
- func (e *ScalarExcitation) InputType() reflect.Type
- func (e *ScalarExcitation) IsUniform() bool
- func (p *ScalarExcitation) MSlice() cuda.MSlice
- func (e *ScalarExcitation) Mesh() *data.Mesh
- func (e *ScalarExcitation) NComp() int
- func (e *ScalarExcitation) Name() string
- func (e *ScalarExcitation) Region(r int) *vOneReg
- func (e *ScalarExcitation) RemoveExtraTerms()
- func (e *ScalarExcitation) Set(v float64)
- func (e *ScalarExcitation) SetRegion(region int, f script.ScalarFunction)
- func (e *ScalarExcitation) SetRegionFn(region int, f func() [3]float64)
- func (e *ScalarExcitation) SetValue(v interface{})
- func (e *ScalarExcitation) Slice() (*data.Slice, bool)
- func (e *ScalarExcitation) Type() reflect.Type
- func (e *ScalarExcitation) Unit() string
- type ScalarField
- type ScalarValue
- type Shape
- func Cell(ix, iy, iz int) Shape
- func Circle(diam float64) Shape
- func Cone(diam, height float64) Shape
- func Cuboid(sidex, sidey, sidez float64) Shape
- func Cylinder(diam, height float64) Shape
- func Ellipse(diamx, diamy float64) Shape
- func Ellipsoid(diamx, diamy, diamz float64) Shape
- func GrainRoughness(grainsize, zmin, zmax float64, seed int) Shape
- func ImageShape(fname string) Shape
- func Layer(index int) Shape
- func Layers(a, b int) Shape
- func Rect(sidex, sidey float64) Shape
- func Square(side float64) Shape
- func Universe() Shape
- func XRange(a, b float64) Shape
- func YRange(a, b float64) Shape
- func ZRange(a, b float64) Shape
- func (a Shape) Add(b Shape) Shape
- func (a Shape) Intersect(b Shape) Shape
- func (s Shape) Inverse() Shape
- func (s Shape) Repeat(periodX, periodY, periodZ float64) Shape
- func (s Shape) RotX(θ float64) Shape
- func (s Shape) RotY(θ float64) Shape
- func (s Shape) RotZ(θ float64) Shape
- func (s Shape) Scale(sx, sy, sz float64) Shape
- func (a Shape) Sub(b Shape) Shape
- func (s Shape) Transl(dx, dy, dz float64) Shape
- func (a Shape) Xor(b Shape) Shape
- type Stepper
- type UserErr
- type VPOminimizer
- type VectorField
- type VectorValue
Constants ¶
const ( TILE = 2 // tile size in grains LAMBDA = TILE * TILE // expected grains per tile )
const ( BACKWARD_EULER = -1 EULER = 1 HEUN = 2 BOGAKISHAMPINE = 3 RUNGEKUTTA = 4 DORMANDPRINCE = 5 FEHLBERG = 6 )
Arguments for SetSolver
const ( X = 0 Y = 1 Z = 2 )
const ( SCALAR = 1 VECTOR = 3 )
const CSS = `` /* 756-byte string literal not displayed */
const MAX_GNUPLOTS = 5 // maximum allowed number of gnuplot processes
const NREGION = 256 // maximum number of regions, limited by size of byte.
const TableAutoflushRate = 5 // auto-flush table every X seconds
const VERSION = "mumax 3.10"
Variables ¶
var ( Ku1 = NewScalarParam("Ku1", "J/m3", "1st order uniaxial anisotropy constant") Ku2 = NewScalarParam("Ku2", "J/m3", "2nd order uniaxial anisotropy constant") Kc1 = NewScalarParam("Kc1", "J/m3", "1st order cubic anisotropy constant") Kc2 = NewScalarParam("Kc2", "J/m3", "2nd order cubic anisotropy constant") Kc3 = NewScalarParam("Kc3", "J/m3", "3rd order cubic anisotropy constant") AnisU = NewVectorParam("anisU", "", "Uniaxial anisotropy direction") AnisC1 = NewVectorParam("anisC1", "", "Cubic anisotropy direction #1") AnisC2 = NewVectorParam("anisC2", "", "Cubic anisotorpy directon #2") B_anis = NewVectorField("B_anis", "T", "Anisotropy field", AddAnisotropyField) Edens_anis = NewScalarField("Edens_anis", "J/m3", "Anisotropy energy density", AddAnisotropyEnergyDensity) E_anis = NewScalarValue("E_anis", "J", "total anisotropy energy", GetAnisotropyEnergy) )
Anisotropy variables
var ( B_custom = NewVectorField("B_custom", "T", "User-defined field", AddCustomField) Edens_custom = NewScalarField("Edens_custom", "J/m3", "Energy density of user-defined field.", AddCustomEnergyDensity) E_custom = NewScalarValue("E_custom", "J", "total energy of user-defined field", GetCustomEnergy) )
var ( Msat = NewScalarParam("Msat", "A/m", "Saturation magnetization") M_full = NewVectorField("m_full", "A/m", "Unnormalized magnetization", SetMFull) B_demag = NewVectorField("B_demag", "T", "Magnetostatic field", SetDemagField) Edens_demag = NewScalarField("Edens_demag", "J/m3", "Magnetostatic energy density", AddEdens_demag) E_demag = NewScalarValue("E_demag", "J", "Magnetostatic energy", GetDemagEnergy) EnableDemag = true // enable/disable global demag field NoDemagSpins = NewScalarParam("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.") DemagAccuracy = 6.0 // Demag accuracy (divide cubes in at most N^3 points) )
Demag variables
var ( Edens_total = NewScalarField("Edens_total", "J/m3", "Total energy density", SetTotalEdens) E_total = NewScalarValue("E_total", "J", "total energy", GetTotalEnergy) )
var ( Aex = NewScalarParam("Aex", "J/m", "Exchange stiffness", &lex2) Dind = NewScalarParam("Dind", "J/m2", "Interfacial Dzyaloshinskii-Moriya strength", &din2) Dbulk = NewScalarParam("Dbulk", "J/m2", "Bulk Dzyaloshinskii-Moriya strength", &dbulk2) B_exch = NewVectorField("B_exch", "T", "Exchange field", AddExchangeField) E_exch = NewScalarValue("E_exch", "J", "Total exchange energy (including the DMI energy)", GetExchangeEnergy) Edens_exch = NewScalarField("Edens_exch", "J/m3", "Total exchange energy density (including the DMI energy density)", AddExchangeEnergyDensity) // Average exchange coupling with neighbors. Useful to debug inter-region exchange ExchCoupling = NewScalarField("ExchCoupling", "arb.", "Average exchange coupling with neighbors", exchangeDecode) DindCoupling = NewScalarField("DindCoupling", "arb.", "Average DMI coupling with neighbors", dindDecode) OpenBC = false //gneb-related parameters // GNEB2D = false // GNEB3D = false JZ = 1.0 )
var ( BubblePos = NewVectorValue("ext_bubblepos", "m", "Bubble core position", bubblePos) BubbleDist = NewScalarValue("ext_bubbledist", "m", "Bubble traveled distance", bubbleDist) BubbleSpeed = NewScalarValue("ext_bubblespeed", "m/s", "Bubble velocity", bubbleSpeed) BubbleMz = 1.0 )
var ( DWPos = NewScalarValue("ext_dwpos", "m", "Position of the simulation window while following a domain wall", GetShiftPos) // TODO: make more accurate DWxPos = NewScalarValue("ext_dwxpos", "m", "Position of the simulation window while following a domain wall", GetDWxPos) DWSpeed = NewScalarValue("ext_dwspeed", "m/s", "Speed of the simulation window while following a domain wall", getShiftSpeed) )
var ( B1 = NewScalarParam("B1", "J/m3", "First magneto-elastic coupling constant") B2 = NewScalarParam("B2", "J/m3", "Second magneto-elastic coupling constant") B_mel = NewVectorField("B_mel", "T", "Magneto-elastic filed", AddMagnetoelasticField) F_mel = NewVectorField("F_mel", "N/m3", "Magneto-elastic force density", GetMagnetoelasticForceDensity) Edens_mel = NewScalarField("Edens_mel", "J/m3", "Magneto-elastic energy density", AddMagnetoelasticEnergyDensity) E_mel = NewScalarValue("E_mel", "J", "Magneto-elastic energy", GetMagnetoelasticEnergy) )
var ( Ext_TopologicalCharge = NewScalarValue("ext_topologicalcharge", "", "2D topological charge", GetTopologicalCharge) Ext_TopologicalChargeDensity = NewScalarField("ext_topologicalchargedensity", "1/m2", "2D topological charge density m·(∂m/∂x ✕ ∂m/∂y)", SetTopologicalChargeDensity) )
var ( Ext_TopologicalChargeLattice = NewScalarValue("ext_topologicalchargelattice", "", "2D topological charge according to Berg and Lüscher", GetTopologicalChargeLattice) Ext_TopologicalChargeDensityLattice = NewScalarField("ext_topologicalchargedensitylattice", "1/m2", "2D topological charge density according to Berg and Lüscher", SetTopologicalChargeDensityLattice) )
var ( MaxIter = 1 WritingIter = 1 DoRelax = 0 MinimizeFirst = 1 MinimizeLast = 1 MinimizeEndPoints = 0 )
var ( // These flags are shared between cmd/mumax3 and Go input files. Flag_cachedir = flag.String("cache", os.TempDir(), "Kernel cache directory (empty disables caching)") Flag_gpu = flag.Int("gpu", 0, "Specify GPU") Flag_interactive = flag.Bool("i", false, "Open interactive browser session") Flag_od = flag.String("o", "", "Override output directory") Flag_port = flag.String("http", ":35367", "Port to serve web gui") Flag_selftest = flag.Bool("paranoid", false, "Enable convolution self-test for cuFFT sanity.") Flag_silent = flag.Bool("s", false, "Silent") // provided for backwards compatibility Flag_sync = flag.Bool("sync", false, "Synchronize all CUDA calls (debug)") Flag_forceclean = flag.Bool("f", false, "Force start, clean existing output directory") )
var ( MaxAngle = NewScalarValue("MaxAngle", "rad", "maximum angle between neighboring spins", GetMaxAngle) SpinAngle = NewScalarField("spinAngle", "rad", "Angle between neighboring spins", SetSpinAngle) )
var ( MFM = NewScalarField("MFM", "arb.", "MFM image", SetMFM) MFMLift inputValue MFMTipSize inputValue )
var ( DmSamples int = 10 // number of dm to keep for convergence check StopMaxDm float64 = 1e-6 // stop minimizer if sampled dm is smaller than this )
var ( Time float64 // time in seconds Inject = make(chan func()) // injects code in between time steps. Used by web interface. Dt_si float64 = 1e-15 // time step = dt_si (seconds) *dt_mul, which should be nice float32 MinDt, MaxDt float64 // minimum and maximum time step MaxErr float64 = 1e-5 // maximum error/step Headroom float64 = 0.8 // solver headroom, (Gustafsson, 1992, Control of Error and Convergence in ODE Solvers) LastErr, PeakErr float64 // error of last step, highest error ever LastTorque float64 // maxTorque of last time step NSteps, NUndone, NEvals int // number of good steps, undone steps FixDt float64 // fixed time step? )
Solver globals
var ( FilenameFormat = "%s%06d" // formatting string for auto filenames. SnapshotFormat = "jpg" // user-settable snapshot format )
var (
TotalShift, TotalYShift float64 // accumulated window shift (X and Y) in meter
ShiftMagL, ShiftMagR, ShiftMagU, ShiftMagD data.Vector // when shifting m, put these value at the left/right edge.
ShiftM, ShiftGeom, ShiftRegions bool = true, true, true // should shift act on magnetization, geometry, regions?
)
var ( Temp = NewScalarParam("Temp", "K", "Temperature") E_therm = NewScalarValue("E_therm", "J", "Thermal energy", GetThermalEnergy) Edens_therm = NewScalarField("Edens_therm", "J/m3", "Thermal energy density", AddThermalEnergyDensity) B_therm thermField // Thermal effective field (T) )
var ( Alpha = NewScalarParam("alpha", "", "Landau-Lifshitz damping constant") Xi = NewScalarParam("xi", "", "Non-adiabaticity of spin-transfer-torque") Pol = NewScalarParam("Pol", "", "Electrical current polarization") Lambda = NewScalarParam("Lambda", "", "Slonczewski Λ parameter") EpsilonPrime = NewScalarParam("EpsilonPrime", "", "Slonczewski secondairy STT term ε'") FrozenSpins = NewScalarParam("frozenspins", "", "Defines spins that should be fixed") // 1 - frozen, 0 - free. TODO: check if it only contains 0/1 values FreeLayerThickness = NewScalarParam("FreeLayerThickness", "m", "Slonczewski free layer thickness (if set to zero (default), then the thickness will be deduced from the mesh size)") FixedLayer = NewExcitation("FixedLayer", "", "Slonczewski fixed layer polarization") Torque = NewVectorField("torque", "T", "Total torque/γ0", SetTorque) LLTorque = NewVectorField("LLtorque", "T", "Landau-Lifshitz torque/γ0", SetLLTorque) STTorque = NewVectorField("STTorque", "T", "Spin-transfer torque/γ0", AddSTTorque) J = NewExcitation("J", "A/m2", "Electrical current density") MaxTorque = NewScalarValue("maxTorque", "T", "Maximum torque/γ0, over all cells", GetMaxTorque) GammaLL float64 = 1.7595e11 // Gyromagnetic ratio of spins, in rad/Ts Precess = true DisableZhangLiTorque = false DisableSlonczewskiTorque = false )
var ( MaxForce = 100.0 CIGNEB = 0 Saddle = 0 InterpolateEnergy = 0 PPP = 1.0 )
var ( B_ext = NewExcitation("B_ext", "T", "Externally applied field") Edens_zeeman = NewScalarField("Edens_Zeeman", "J/m3", "Zeeman energy density", AddEdens_zeeman) E_Zeeman = NewScalarValue("E_Zeeman", "J", "Zeeman energy", GetZeemanEnergy) )
var AddEdens_demag = makeEdensAdder(&B_demag, -0.5)
var AddEdens_zeeman = makeEdensAdder(B_ext, -1)
var AddExchangeEnergyDensity = makeEdensAdder(&B_exch, -0.5) // TODO: normal func
var AddThermalEnergyDensity = makeEdensAdder(&B_therm, -1)
var B_eff = NewVectorField("B_eff", "T", "Effective field", SetEffectiveField)
var CorePos = NewVectorValue("ext_corepos", "m", "Vortex core position (x,y) + polarization (z)", corePos)
var ( CurrentSignFromFixedLayerPosition = map[FixedLayerPosition]float64{ FIXEDLAYER_TOP: 1.0, FIXEDLAYER_BOTTOM: -1.0, } )
var DWTiltPMA = NewScalarValue("ext_dwtilt", "rad", "PMA domain wall tilt", dwTiltPMA)
PMA domain wall tilt assuming straight wall.
var (
InputFile string
)
var M magnetization // reduced magnetization (unit length)
var (
Nsub = 10
)
var RelaxTorqueThreshold float64 = -1.
Stopping relax Maxtorque in T. The user can check MaxTorque for sane values (e.g. 1e-3). If set to 0, relax() will stop when the average torque is steady or increasing.
var StartTime = time.Now()
var ( StringFromOutputFormat = map[OutputFormat]string{ OVF1_TEXT: "ovf", OVF1_BINARY: "ovf", OVF2_TEXT: "ovf", OVF2_BINARY: "ovf", DUMP: "dump"} )
var Table = *newTable("table") // output handle for tabular data (average magnetization etc.)
var (
Timeout = 3 * time.Second // exit finished simulation this long after browser was closed
)
global GUI state stores what is currently shown in the web page.
var UNAME = fmt.Sprintf("%s [%s_%s %s(%s) CUDA-%d.%d]", VERSION, runtime.GOOS, runtime.GOARCH, runtime.Version(), runtime.Compiler, cu.CUDA_VERSION/1000, (cu.CUDA_VERSION%1000)/10)
var World = script.NewWorld()
holds the script state (variables etc)
Functions ¶
func AddAnisotropyEnergyDensity ¶
Add the anisotropy energy density to dst
func AddCustomEnergyDensity ¶
Adds the custom energy densities (defined with AddCustomE
func AddCustomField ¶
AddCustomField evaluates the user-defined custom field terms and adds the result to dst.
func AddEdensTerm ¶
func AddEdensTerm(e Quantity)
AddEnergyTerm adds an energy density function (returning Joules/m³) to Edens_total. Needed when AddFieldTerm was used and a correct energy is needed (e.g. for Relax, Minimize, ...).
func AddExchangeField ¶
Adds the current exchange field to dst
func AddFieldTerm ¶
func AddFieldTerm(b Quantity)
AddFieldTerm adds an effective field function (returning Teslas) to B_eff. Be sure to also add the corresponding energy term using AddEnergyTerm.
func AddMagnetoelasticField ¶
func AutoSnapshot ¶
Register quant to be auto-saved as image, every period.
func CenterBubble ¶
func CenterBubble()
This post-step function centers the simulation window on a bubble
func CenterWall ¶
func CenterWall(magComp int)
This post-step function centers the simulation window on a domain wall between up-down (or down-up) domains (like in perpendicular media). E.g.:
PostStep(CenterPMAWall)
func CheckRecoverable ¶
func CheckRecoverable(err error)
func CropRegion ¶
Crop quantity to a box enclosing the given region. Used to output a region of interest, even if the region is non-rectangular.
func DeclLValue ¶
Add an LValue to the script world. Assign to LValue invokes SetValue()
func DeclROnly ¶
Add a read-only variable to the script world. It can be changed, but not by the user.
func DeclTVar ¶
Hack for fixing the closure caveat: Defines "t", the time variable, handled specially by Fix()
func DefRegionCell ¶
func DoOutput ¶
func DoOutput()
Periodically called by run loop to save everything that's needed at this time.
func EnableUnsafe ¶
func EnableUnsafe()
func Fprintln ¶
func Fprintln(filename string, msg ...interface{})
Append msg to file. Used to write aggregated output of many simulations in one file.
func FreezeSpins ¶
func GetCustomEnergy ¶
func GetCustomEnergy() float64
func GetExchangeEnergy ¶
func GetExchangeEnergy() float64
Returns the current exchange energy in Joules.
func GetMagnetoelasticEnergy ¶
func GetMagnetoelasticEnergy() float64
Returns magneto-ell energy in joules.
func GetMaxAngle ¶
func GetMaxAngle() float64
func GetMaxTorque ¶
func GetMaxTorque() float64
func GetShiftYPos ¶
func GetShiftYPos() float64
func GetThermalEnergy ¶
func GetThermalEnergy() float64
func GetTopologicalCharge ¶
func GetTopologicalCharge() float64
func GetTopologicalChargeLattice ¶
func GetTopologicalChargeLattice() float64
func GetZeemanEnergy ¶
func GetZeemanEnergy() float64
func Index2Coord ¶
converts cell index to coordinate, internal coordinates
func InitAndClose ¶
func InitAndClose() func()
Usage: in every Go input file, write:
func main(){ defer InitAndClose()() // ... }
This initialises the GPU, output directory, etc, and makes sure pending output will get flushed.
func InitIO ¶
SetOD sets the output directory where auto-saved files will be stored. The -o flag can also be used for this purpose.
func InjectAndWait ¶
func InjectAndWait(task func())
inject code into engine and wait for it to complete.
func InterExchange ¶
Sets the exchange interaction between region 1 and 2.
func InterpolatePath ¶
Read a magnetization state from .dump file.
func LogUsedRefs ¶
func LogUsedRefs()
func NewScalarMask ¶
func NewVectorMask ¶
func PostStep ¶
func PostStep(f func())
Register function f to be called after every time step. Typically used, e.g., to manipulate the magnetization.
func RemoveLRSurfaceCharge ¶
For a nanowire magnetized in-plane, with mx = mxLeft on the left end and mx = mxRight on the right end (both -1 or +1), add a B field needed to compensate for the surface charges on the left and right edges. This will mimic an infinitely long wire.
func RunWhile ¶
func RunWhile(condition func() bool)
Runs as long as condition returns true, saves output.
func SanityCheck ¶
func SanityCheck()
func ScaleInterDind ¶
Scales the DMI interaction between region 1 and 2.
func ScaleInterExchange ¶
Scales the heisenberg exchange interaction between region1 and 2. Scale = 1 means the harmonic mean over the regions of Aex.
func SetBusy ¶
func SetBusy(b bool)
We set SetBusy(true) when the simulation is too busy too accept GUI input on Inject channel. E.g. during kernel init.
func SetCellSize ¶
func SetCellSize(cx, cy, cz float64)
func SetEffectiveField ¶
Sets dst to the current effective field, in Tesla. This is the sum of all effective field terms, like demag, exchange, ...
func SetGridSize ¶
func SetGridSize(Nx, Ny, Nz int)
func SetImagesNumber ¶
func SetImagesNumber(Noi int)
func SetMesh ¶
Set the simulation mesh to Nx x Ny x Nz cells of given size. Can be set only once at the beginning of the simulation. TODO: dedup arguments from globals
func SetMeshGNEB ¶
func SetSpinAngle ¶
func SnapshotAs ¶
func TableAddVariable ¶
func TableAddVariable(x script.ScalarFunction, name, unit string)
func TableAutoSave ¶
func TableAutoSave(period float64)
func TablePrint ¶
func TablePrint(msg ...interface{})
func VPOminimize ¶
func VPOminimize()
Types ¶
type BackwardEuler ¶
type BackwardEuler struct {
// contains filtered or unexported fields
}
Implicit midpoint solver.
func (*BackwardEuler) Free ¶
func (s *BackwardEuler) Free()
func (*BackwardEuler) Step ¶
func (s *BackwardEuler) Step()
Euler method, can be used as solver.Step.
type Config ¶
Magnetic configuration returns m vector for position (x,y,z)
func AntiVortex ¶
func BlochSkyrmion ¶
func Conical ¶
Conical magnetization configuration. The magnetization rotates on a cone defined by coneAngle and coneDirection. q is the wave vector of the conical magnetization configuration. The magnetization is
m = u*cos(coneAngle) + sin(coneAngle)*( ua*cos(q*r) + ub*sin(q*r) )
with ua and ub unit vectors perpendicular to u (normalized coneDirection)
func NeelSkyrmion ¶
func RandomMagSeed ¶
Random initial magnetization, generated from random seed.
func TwoDomain ¶
Make a 2-domain configuration with domain wall. (mx1, my1, mz1) and (mx2, my2, mz2) are the magnetizations in the left and right domain, respectively. (mxwall, mywall, mzwall) is the magnetization in the wall. The wall is smoothed over a few cells so it will easily relax to its ground state. E.g.:
TwoDomain(1,0,0, 0,1,0, -1,0,0) // head-to-head domains with transverse (Néel) wall TwoDomain(1,0,0, 0,0,1, -1,0,0) // head-to-head domains with perpendicular (Bloch) wall TwoDomain(0,0,1, 1,0,0, 0,0,-1)// up-down domains with Bloch wall
func Uniform ¶
Returns a uniform magnetization state. E.g.:
M = Uniform(1, 0, 0)) // saturated along X
func Vortex ¶
Make a vortex magnetization with given circulation and core polarization (+1 or -1). The core is smoothed over a few exchange lengths and should easily relax to its ground state.
func VortexWall ¶
Make a vortex wall configuration.
func (Config) Add ¶
Returns a new magnetization equal to c + weight * other. E.g.:
Uniform(1, 0, 0).Add(0.2, RandomMag())
for a uniform state with 20% random distortion.
type DataTable ¶
type DataTable struct {
// contains filtered or unexported fields
}
func (*DataTable) AddVariable ¶
func (t *DataTable) AddVariable(x script.ScalarFunction, name, unit string)
type DerivedParam ¶
type DerivedParam struct {
// contains filtered or unexported fields
}
parameter derived from others (not directly settable). E.g.: Bsat derived from Msat
func NewDerivedParam ¶
func NewDerivedParam(nComp int, parents []parent, updater func(*DerivedParam)) *DerivedParam
func (*DerivedParam) EvalTo ¶
uncompress the table to a full array in the dst Slice with parameter values per cell.
func (*DerivedParam) GetRegion ¶
func (p *DerivedParam) GetRegion(r int) []float64
Get value in region r.
type Excitation ¶
type Excitation struct {
// contains filtered or unexported fields
}
An excitation, typically field or current, can be defined region-wise plus extra mask*multiplier terms.
func NewExcitation ¶
func NewExcitation(name, unit, desc string) *Excitation
func (*Excitation) Add ¶
func (e *Excitation) Add(mask *data.Slice, f script.ScalarFunction)
Add an extra mask*multiplier term to the excitation.
func (*Excitation) AddGo ¶
func (e *Excitation) AddGo(mask *data.Slice, mul func() float64)
An Add(mask, f) equivalent for Go use
func (*Excitation) AddTo ¶
func (e *Excitation) AddTo(dst *data.Slice)
func (*Excitation) Average ¶
func (e *Excitation) Average() data.Vector
func (*Excitation) Comp ¶
func (e *Excitation) Comp(c int) ScalarField
func (*Excitation) Eval ¶
func (e *Excitation) Eval() interface{}
func (*Excitation) EvalTo ¶
func (e *Excitation) EvalTo(dst *data.Slice)
func (*Excitation) InputType ¶
func (e *Excitation) InputType() reflect.Type
func (*Excitation) IsUniform ¶
func (e *Excitation) IsUniform() bool
func (*Excitation) MSlice ¶
func (p *Excitation) MSlice() cuda.MSlice
func (*Excitation) Mesh ¶
func (e *Excitation) Mesh() *data.Mesh
func (*Excitation) NComp ¶
func (e *Excitation) NComp() int
func (*Excitation) Name ¶
func (e *Excitation) Name() string
func (*Excitation) Region ¶
func (e *Excitation) Region(r int) *vOneReg
func (*Excitation) RemoveExtraTerms ¶
func (e *Excitation) RemoveExtraTerms()
After resizing the mesh, the extra terms don't fit the grid anymore and there is no reasonable way to resize them. So remove them and have the user re-add them.
func (*Excitation) Set ¶
func (e *Excitation) Set(v data.Vector)
func (*Excitation) SetRegion ¶
func (e *Excitation) SetRegion(region int, f script.VectorFunction)
func (*Excitation) SetRegionFn ¶
func (e *Excitation) SetRegionFn(region int, f func() [3]float64)
func (*Excitation) SetValue ¶
func (e *Excitation) SetValue(v interface{})
func (*Excitation) Type ¶
func (e *Excitation) Type() reflect.Type
func (*Excitation) Unit ¶
func (e *Excitation) Unit() string
type FixedLayerPosition ¶
type FixedLayerPosition int
const ( FIXEDLAYER_TOP FixedLayerPosition = iota + 1 FIXEDLAYER_BOTTOM )
type GMinimizer ¶
type GMinimizer struct {
// contains filtered or unexported fields
}
func (*GMinimizer) Free ¶
func (mini *GMinimizer) Free()
func (*GMinimizer) Step ¶
func (mini *GMinimizer) Step()
type Info ¶
type Info interface { Name() string // number of components (scalar, vector, ...) Unit() string // name used for output file (e.g. "m") NComp() int // unit, e.g. "A/m" }
The Info interface defines the bare minimum methods a quantity must implement to be accessible for scripting and I/O.
type LValue ¶
type LValue interface { SetValue(interface{}) // assigns a new value Eval() interface{} // evaluate and return result (nil for void) Type() reflect.Type // type that can be assigned and will be returned by Eval }
LValue is settable
type OutputFormat ¶
type OutputFormat int
const ( OVF1_TEXT OutputFormat = iota + 1 OVF1_BINARY OVF2_TEXT OVF2_BINARY DUMP )
type Param ¶
type Param interface { NComp() int Name() string Unit() string IsUniform() bool // contains filtered or unexported methods }
displayable quantity in GUI Parameters section
type Quantity ¶
Arbitrary physical quantity.
func Const ¶
Const returns a constant (uniform) scalar quantity, that can be used to construct custom field terms.
func ConstVector ¶
ConstVector returns a constant (uniform) vector quantity, that can be used to construct custom field terms.
func Cross ¶
CrossProduct creates a new quantity that is the cross product of quantities a and b. E.g.:
CrossProct(&M, &B_ext)
func Dot ¶
DotProduct creates a new quantity that is the dot product of quantities a and b. E.g.:
DotProct(&M, &B_ext)
func Masked ¶
Masks a quantity with a shape The shape will be only evaluated once on the mesh, and will be re-evaluated after mesh change, because otherwise too slow
func MulMV ¶
MulMV returns a new Quantity that evaluates to the matrix-vector product (Ax·b, Ay·b, Az·b).
func Normalized ¶
Normalized returns a quantity that evaluates to the unit vector of q
type RK23 ¶
type RK23 struct {
// contains filtered or unexported fields
}
Bogacki-Shampine solver. 3rd order, 3 evaluations per step, adaptive step.
http://en.wikipedia.org/wiki/Bogacki-Shampine_method k1 = f(tn, yn) k2 = f(tn + 1/2 h, yn + 1/2 h k1) k3 = f(tn + 3/4 h, yn + 3/4 h k2) y{n+1} = yn + 2/9 h k1 + 1/3 h k2 + 4/9 h k3 // 3rd order k4 = f(tn + h, y{n+1}) z{n+1} = yn + 7/24 h k1 + 1/4 h k2 + 1/3 h k3 + 1/8 h k4 // 2nd order
type Regions ¶
type Regions struct {
// contains filtered or unexported fields
}
stores the region index for each cell
func (*Regions) LoadFile ¶
Load regions from ovf file, use first component. Regions should be between 0 and 256
type RegionwiseScalar ¶
type RegionwiseScalar struct {
// contains filtered or unexported fields
}
specialized param with 1 component
func NewScalarParam ¶
func NewScalarParam(name, unit, desc string, children ...derived) *RegionwiseScalar
TODO: auto derived
func (*RegionwiseScalar) Average ¶
func (p *RegionwiseScalar) Average() float64
func (*RegionwiseScalar) Eval ¶
func (p *RegionwiseScalar) Eval() interface{}
func (*RegionwiseScalar) GetRegion ¶
func (p *RegionwiseScalar) GetRegion(region int) float64
func (*RegionwiseScalar) InputType ¶
func (p *RegionwiseScalar) InputType() reflect.Type
func (*RegionwiseScalar) Region ¶
func (p *RegionwiseScalar) Region(r int) *sOneReg
func (*RegionwiseScalar) Set ¶
func (p *RegionwiseScalar) Set(v float64)
func (*RegionwiseScalar) SetRegion ¶
func (p *RegionwiseScalar) SetRegion(region int, f script.ScalarFunction)
func (*RegionwiseScalar) SetRegionFuncGo ¶
func (p *RegionwiseScalar) SetRegionFuncGo(region int, f func() float64)
func (*RegionwiseScalar) SetRegionValueGo ¶
func (p *RegionwiseScalar) SetRegionValueGo(region int, v float64)
func (*RegionwiseScalar) SetValue ¶
func (p *RegionwiseScalar) SetValue(v interface{})
func (*RegionwiseScalar) Type ¶
func (p *RegionwiseScalar) Type() reflect.Type
type RegionwiseVector ¶
type RegionwiseVector struct {
// contains filtered or unexported fields
}
vector input parameter, settable by user
func NewVectorParam ¶
func NewVectorParam(name, unit, desc string) *RegionwiseVector
func (*RegionwiseVector) Average ¶
func (p *RegionwiseVector) Average() data.Vector
func (*RegionwiseVector) Comp ¶
func (p *RegionwiseVector) Comp(c int) ScalarField
func (*RegionwiseVector) Eval ¶
func (p *RegionwiseVector) Eval() interface{}
func (*RegionwiseVector) GetRegion ¶
func (p *RegionwiseVector) GetRegion(region int) [3]float64
func (*RegionwiseVector) InputType ¶
func (p *RegionwiseVector) InputType() reflect.Type
func (*RegionwiseVector) Region ¶
func (p *RegionwiseVector) Region(r int) *vOneReg
func (*RegionwiseVector) SetRegion ¶
func (p *RegionwiseVector) SetRegion(region int, f script.VectorFunction)
func (*RegionwiseVector) SetRegionFn ¶
func (p *RegionwiseVector) SetRegionFn(region int, f func() [3]float64)
func (*RegionwiseVector) SetValue ¶
func (p *RegionwiseVector) SetValue(v interface{})
func (*RegionwiseVector) Type ¶
func (p *RegionwiseVector) Type() reflect.Type
type ScalarExcitation ¶
type ScalarExcitation struct {
// contains filtered or unexported fields
}
An excitation, typically field or current, can be defined region-wise plus extra mask*multiplier terms.
func NewScalarExcitation ¶
func NewScalarExcitation(name, unit, desc string) *ScalarExcitation
func (*ScalarExcitation) Add ¶
func (e *ScalarExcitation) Add(mask *data.Slice, f script.ScalarFunction)
Add an extra mask*multiplier term to the excitation.
func (*ScalarExcitation) AddGo ¶
func (e *ScalarExcitation) AddGo(mask *data.Slice, mul func() float64)
An Add(mask, f) equivalent for Go use
func (*ScalarExcitation) AddTo ¶
func (e *ScalarExcitation) AddTo(dst *data.Slice)
func (*ScalarExcitation) Average ¶
func (e *ScalarExcitation) Average() float64
func (*ScalarExcitation) Comp ¶
func (e *ScalarExcitation) Comp(c int) ScalarField
func (*ScalarExcitation) Eval ¶
func (e *ScalarExcitation) Eval() interface{}
func (*ScalarExcitation) EvalTo ¶
func (e *ScalarExcitation) EvalTo(dst *data.Slice)
func (*ScalarExcitation) InputType ¶
func (e *ScalarExcitation) InputType() reflect.Type
func (*ScalarExcitation) IsUniform ¶
func (e *ScalarExcitation) IsUniform() bool
func (*ScalarExcitation) MSlice ¶
func (p *ScalarExcitation) MSlice() cuda.MSlice
func (*ScalarExcitation) Mesh ¶
func (e *ScalarExcitation) Mesh() *data.Mesh
func (*ScalarExcitation) NComp ¶
func (e *ScalarExcitation) NComp() int
func (*ScalarExcitation) Name ¶
func (e *ScalarExcitation) Name() string
func (*ScalarExcitation) Region ¶
func (e *ScalarExcitation) Region(r int) *vOneReg
func (*ScalarExcitation) RemoveExtraTerms ¶
func (e *ScalarExcitation) RemoveExtraTerms()
After resizing the mesh, the extra terms don't fit the grid anymore and there is no reasonable way to resize them. So remove them and have the user re-add them.
func (*ScalarExcitation) Set ¶
func (e *ScalarExcitation) Set(v float64)
func (*ScalarExcitation) SetRegion ¶
func (e *ScalarExcitation) SetRegion(region int, f script.ScalarFunction)
func (*ScalarExcitation) SetRegionFn ¶
func (e *ScalarExcitation) SetRegionFn(region int, f func() [3]float64)
func (*ScalarExcitation) SetValue ¶
func (e *ScalarExcitation) SetValue(v interface{})
func (*ScalarExcitation) Type ¶
func (e *ScalarExcitation) Type() reflect.Type
func (*ScalarExcitation) Unit ¶
func (e *ScalarExcitation) Unit() string
type ScalarField ¶
type ScalarField struct {
Quantity
}
ScalarField enhances an outputField with methods specific to a space-dependent scalar quantity.
func AsScalarField ¶
func AsScalarField(q Quantity) ScalarField
AsScalarField promotes a quantity to a ScalarField, enabling convenience methods particular to scalars.
func Comp ¶
func Comp(parent Quantity, c int) ScalarField
Comp returns vector component c of the parent Quantity
func NewScalarField ¶
func NewScalarField(name, unit, desc string, f func(dst *data.Slice)) ScalarField
NewVectorField constructs an outputable space-dependent scalar quantity whose value is provided by function f.
func (ScalarField) Average ¶
func (s ScalarField) Average() float64
func (ScalarField) Name ¶
func (s ScalarField) Name() string
func (ScalarField) Region ¶
func (s ScalarField) Region(r int) ScalarField
func (ScalarField) Unit ¶
func (s ScalarField) Unit() string
type ScalarValue ¶
type ScalarValue struct {
// contains filtered or unexported fields
}
ScalarValue enhances an outputValue with methods specific to a space-independent scalar quantity (e.g. total energy).
func NewScalarValue ¶
func NewScalarValue(name, unit, desc string, f func() float64) *ScalarValue
NewScalarValue constructs an outputable space-independent scalar quantity whose value is provided by function f.
func (ScalarValue) Average ¶
func (s ScalarValue) Average() float64
func (ScalarValue) Get ¶
func (s ScalarValue) Get() float64
type Shape ¶
geometrical shape for setting sample geometry
func GrainRoughness ¶
func ImageShape ¶
func (Shape) Repeat ¶
Infinitely repeats the shape with given period in x, y, z. A period of 0 or infinity means no repetition.
type Stepper ¶
type Stepper interface { Step() // take time step using solver globals Free() // free resources, if any (e.g.: RK23 previous torque) }
Time stepper like Euler, Heun, RK23
type UserErr ¶
type UserErr string
Special error that is not fatal when paniced on and called from GUI E.g.: try to set bad grid size: panic on UserErr, recover, print error, carry on.
type VPOminimizer ¶
type VPOminimizer struct {
// contains filtered or unexported fields
}
func (*VPOminimizer) Free ¶
func (mini *VPOminimizer) Free()
func (*VPOminimizer) Step ¶
func (mini *VPOminimizer) Step()
type VectorField ¶
type VectorField struct {
Quantity
}
VectorField enhances an outputField with methods specific to a space-dependent vector quantity.
func AsVectorField ¶
func AsVectorField(q Quantity) VectorField
AsVectorField promotes a quantity to a VectorField, enabling convenience methods particular to vectors.
func NewVectorField ¶
func NewVectorField(name, unit, desc string, f func(dst *data.Slice)) VectorField
NewVectorField constructs an outputable space-dependent vector quantity whose value is provided by function f.
func (VectorField) Average ¶
func (v VectorField) Average() data.Vector
func (VectorField) Comp ¶
func (v VectorField) Comp(c int) ScalarField
func (VectorField) HostCopy ¶
func (v VectorField) HostCopy() *data.Slice
func (VectorField) Mesh ¶
func (v VectorField) Mesh() *data.Mesh
func (VectorField) Name ¶
func (v VectorField) Name() string
func (VectorField) Region ¶
func (v VectorField) Region(r int) VectorField
func (VectorField) Unit ¶
func (v VectorField) Unit() string
type VectorValue ¶
type VectorValue struct {
// contains filtered or unexported fields
}
VectorValue enhances an outputValue with methods specific to a space-independent vector quantity (e.g. averaged magnetization).
func NewVectorValue ¶
func NewVectorValue(name, unit, desc string, f func() []float64) *VectorValue
NewVectorValue constructs an outputable space-independent vector quantity whose value is provided by function f.
func (*VectorValue) Average ¶
func (v *VectorValue) Average() data.Vector
func (*VectorValue) Get ¶
func (v *VectorValue) Get() data.Vector
Source Files ¶
- anisotropy.go
- asyncio.go
- autosave.go
- average.go
- backwardeuler.go
- bib.go
- comp.go
- config.go
- crop.go
- customfield.go
- demag.go
- effectivefield.go
- energy.go
- engine.go
- euler.go
- exchange.go
- excitation.go
- ext_angles.go
- ext_bubblepos.go
- ext_centerbubble.go
- ext_centerwall.go
- ext_corepos.go
- ext_dwtilt.go
- ext_magnetoelastic.go
- ext_make3dgrains.go
- ext_makegrains.go
- ext_rmsurfacecharge.go
- ext_topologicalcharge.go
- ext_topologicalchargelattice.go
- geom.go
- gneb_minimizer.go
- gofiles.go
- gui.go
- hessian.go
- heun.go
- html.go
- log.go
- lutdata.go
- magnetization.go
- maxangle.go
- mesh.go
- mfm.go
- minimizer.go
- number.go
- od.go
- oneregion.go
- outputquantities.go
- parameter.go
- plot.go
- quantity.go
- regions.go
- relax.go
- render.go
- rk23.go
- rk4.go
- rk45dp.go
- rk56.go
- run.go
- save.go
- scalar_excitation.go
- script.go
- shape.go
- shift.go
- table.go
- temperature.go
- torque.go
- unsafe.go
- util.go
- vpo_minimizer.go
- zeeman.go