Documentation
¶
Index ¶
- Constants
- Variables
- func AsyncSave(fname string, s *data.Slice, info data.Meta)
- func AutoSave(quant Slicer, period float64)
- func Average(s Slicer) []float64
- func Close()
- func Const(e script.Expr) bool
- func DeclConst(name string, value float64, doc string)
- func DeclFunc(name string, f interface{}, doc string)
- func DeclLValue(name string, value script.LValue, doc string)
- func DeclPure(name string, f interface{}, doc string)
- func DeclROnly(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 Doc(nComp int, name, unit string) doc
- func Download(q Slicer) *data.Slice
- func EulerStep(e *solver)
- func Eval(code string, gui *gui.Doc)
- func Expect(msg string, have, want, maxError float64)
- func Fprintln(filename string, msg ...interface{})
- func GetMaxTorque() float64
- func GetShiftPos() float64
- func GetTotalEnergy() float64
- func HeunStep(e *solver)
- func Index2Coord(i, j, k int) data.Vector
- func Info(nComp int, name, unit string, m *data.Mesh) info
- func InjectAndWait(task func())
- func LoadFile(fname string) *data.Slice
- func MakeVector(x, y, z float64) data.Vector
- func Mesh() *data.Mesh
- func NewSlice(ncomp, Nx, Ny, Nz int) *data.Slice
- func NewSolver(y *data.Slice, torqueFn, postStep func(*data.Slice), dt_si, dt_mul float64, ...) solver
- func OverrideExchangeLength(region1, region2 int, exlen float64)
- func PostStep(f func())
- func Run(seconds float64)
- func RunWhile(condition func() bool)
- func Save(q Slicer)
- func SaveAs(q Slicer, fname string)
- func Serve(port string)
- func SetGeom(s Shape)
- func SetMesh(Nx, Ny, Nz int, cellSizeX, cellSizeY, cellSizeZ float64)
- func SetOD(od string, force bool)
- func SetSolver(typ int)
- func Shift(dx int)
- func Steps(n int)
- func TableAdd(col TableData)
- func TableAutoSave(period float64)
- func TableSave()
- func ThermSeed(seed int)
- func WorldSize() [3]float64
- type Config
- type DataTable
- type GetScalar
- type GetVector
- type Param
- type Regions
- type ScalarParam
- func (p *ScalarParam) Eval() interface{}
- func (p *ScalarParam) GetRegion(region int) float64
- func (p *ScalarParam) InputType() reflect.Type
- func (p *ScalarParam) IsUniform() bool
- func (p *ScalarParam) Mesh() *data.Mesh
- func (p *ScalarParam) Region(r int) *selectRegion
- func (p *ScalarParam) SetRegion(region int, f script.ScalarFunction)
- func (p *ScalarParam) SetValue(v interface{})
- func (p *ScalarParam) TableData() []float64
- func (p *ScalarParam) Type() reflect.Type
- type Shape
- func Cell(k, j, i int) Shape
- func Circle(diam 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 Layers(a, b int) Shape
- func Rect(sidex, sidey float64) 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 Slicer
- type TableData
- type VectorParam
- func (p *VectorParam) Eval() interface{}
- func (p *VectorParam) GetRegion(region int) [3]float64
- func (p *VectorParam) InputType() reflect.Type
- func (p *VectorParam) IsUniform() bool
- func (p *VectorParam) Mesh() *data.Mesh
- func (p *VectorParam) Region(r int) *selectRegion
- func (p *VectorParam) SetRegion(region int, f script.VectorFunction)
- func (p *VectorParam) SetValue(v interface{})
- func (p *VectorParam) TableData() []float64
- func (p *VectorParam) Type() reflect.Type
Constants ¶
const NREGION = 256 // maximum number of regions. (!) duplicated in CUDA
const VERSION = "mumax3.3.1"
Variables ¶
var (
Ku1, Kc1 ScalarParam // uniaxial and cubic anis constants
AnisU, AnisC1, AnisC2 VectorParam // unixial and cubic anis axes
B_anis adder // field due to uniaxial anisotropy (T)
E_anis = NewGetScalar("E_anis", "J", "Anisotropy energy (uni+cubic)", getAnisotropyEnergy)
)
Anisotropy variables
var ( Msat ScalarParam Bsat derivedParam M_full, B_demag setter E_demag = NewGetScalar("E_demag", "J", "Magnetostatic energy", getDemagEnergy) EnableDemag = true // enable/disable demag field )
demag variables
var ( M magnetization // reduced magnetization (unit length) B_eff, Torque setter )
var ( Aex ScalarParam Dex ScalarParam B_exch adder // exchange field (T) output handle E_exch = NewGetScalar("E_exch", "J", "Exchange energy (normal+DM)", getExchangeEnergy) )
var ( Solver solver Time float64 // time in seconds // todo: hide? setting breaks autosaves Inject = make(chan func()) // injects code in between time steps. Used by web interface. )
var ( Temp ScalarParam B_therm adder E_therm = NewGetScalar("E_therm", "J", "Thermal energy", getThermalEnergy) )
var ( Alpha ScalarParam Xi, Pol ScalarParam Lambda, EpsilonPrime ScalarParam FixedLayer VectorParam LLTorque setter // Landau-Lifshitz torque/γ0, in T STTorque adder // Spin-transfer torque/γ0, in T J excitation // Polarized electrical current density MaxTorque = NewGetScalar("maxTorque", "T", "Maximum torque over all cells", GetMaxTorque) )
var ( B_ext excitation E_Zeeman = NewGetScalar("E_Zeeman", "J", "Zeeman energy", getZeemanEnergy) )
var (
E_total = NewGetScalar("E_total", "J", "Total energy", GetTotalEnergy)
)
var FFTM fftm // FFT of m
var (
KeepAlive = func() time.Time { return time.Time{} } // overwritten by gui server
)
var OD = "./" // Output directory
var StartTime = time.Now()
var Table = *newTable("table") // output handle for tabular data (average magnetization etc.)
var UNAME = VERSION + " " + runtime.GOOS + "_" + runtime.GOARCH + " " + runtime.Version() + " (" + runtime.Compiler + ")"
var World = script.NewWorld()
Functions ¶
func AsyncSave ¶
Asynchronously save slice to file. Slice should be on CPU and not be written after this call.
func DefRegionCell ¶
func Fprintln ¶
func Fprintln(filename string, msg ...interface{})
Append msg to file. Used to write aggregated output of many simulations in one file.
func GetShiftPos ¶
func GetShiftPos() float64
func Index2Coord ¶
converts cell index to coordinate, user coordinates
func InjectAndWait ¶
func InjectAndWait(task func())
inject code into engine and wait for it to complete.
func OverrideExchangeLength ¶
Defines the exchange coupling between different regions by specifying the exchange length of the interaction between them.
lex := sqrt(2*Aex / Msat)
In case of different materials it is not always clear what the exchange between them should be, especially if they have different Msat. By specifying the exchange length, it is up to the user to decide which Msat to use. A negative length may be specified to obtain antiferromagnetic coupling.
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 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.
func SetOD ¶
SetOD sets the output directory where auto-saved files will be stored. The -o flag can also be used for this purpose.
func TableAutoSave ¶
func TableAutoSave(period float64)
Types ¶
type Config ¶
Magnetic configuration returns m vector for position (x,y,z)
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.
type GetScalar ¶
type GetScalar struct { // contains filtered or unexported fields } // TODO: unexport
func NewGetScalar ¶
INTERNAL
type GetVector ¶
type GetVector struct {
// contains filtered or unexported fields
}
func NewGetVector ¶
INTERNAL
type Param ¶
type Param interface { NComp() int Unit() string IsUniform() bool // contains filtered or unexported methods }
displayable in GUI Parameters section
type Regions ¶
type Regions struct {
// contains filtered or unexported fields
}
type ScalarParam ¶
type ScalarParam struct {
// contains filtered or unexported fields
}
specialized param with 1 component
func (*ScalarParam) Eval ¶
func (p *ScalarParam) Eval() interface{}
func (*ScalarParam) GetRegion ¶
func (p *ScalarParam) GetRegion(region int) float64
func (*ScalarParam) InputType ¶
func (p *ScalarParam) InputType() reflect.Type
func (*ScalarParam) SetRegion ¶
func (p *ScalarParam) SetRegion(region int, f script.ScalarFunction)
func (*ScalarParam) SetValue ¶
func (p *ScalarParam) SetValue(v interface{})
func (*ScalarParam) TableData ¶
func (p *ScalarParam) TableData() []float64
Parameter TableData is region 0
func (*ScalarParam) Type ¶
func (p *ScalarParam) Type() reflect.Type
type Shape ¶
geometrical shape for setting sample geometry
func (Shape) Repeat ¶
Infinitely repeats the shape with given period in x, y, z. A period of 0 or infinity means no repetition.
type TableData ¶
type TableData interface { TableData() []float64 // TODO: output float32s only Name() string Unit() string NComp() int }
can be saved in table
type VectorParam ¶
type VectorParam struct {
// contains filtered or unexported fields
}
func (*VectorParam) Eval ¶
func (p *VectorParam) Eval() interface{}
func (*VectorParam) GetRegion ¶
func (p *VectorParam) GetRegion(region int) [3]float64
func (*VectorParam) InputType ¶
func (p *VectorParam) InputType() reflect.Type
func (*VectorParam) SetRegion ¶
func (p *VectorParam) SetRegion(region int, f script.VectorFunction)
func (*VectorParam) SetValue ¶
func (p *VectorParam) SetValue(v interface{})
func (*VectorParam) TableData ¶
func (p *VectorParam) TableData() []float64
Parameter TableData is region 0
func (*VectorParam) Type ¶
func (p *VectorParam) Type() reflect.Type
Source Files
¶
- adder.go
- anisotropy.go
- array.go
- asyncio.go
- autosave.go
- average.go
- buffered.go
- config.go
- demag.go
- derivedparam.go
- energy.go
- engine.go
- euler.go
- exchange.go
- excitation.go
- ext_makedefects.go
- ext_makegrains.go
- fftm.go
- geom.go
- gui.go
- heun.go
- html.go
- info.go
- inputparam.go
- inregion.go
- lutdata.go
- magnetization.go
- numbers.go
- od.go
- plot.go
- regions.go
- render.go
- run.go
- scalarparam.go
- script.go
- setter.go
- shape.go
- shift.go
- solver.go
- table.go
- temperature.go
- torque.go
- util.go
- vectorparam.go
- zeeman.go