diff --git a/engine/config.go b/engine/config.go index dfeb14fc..05c07a3f 100644 --- a/engine/config.go +++ b/engine/config.go @@ -13,6 +13,7 @@ func init() { DeclFunc("Uniform", Uniform, "Uniform magnetization in given direction") DeclFunc("Vortex", Vortex, "Vortex magnetization with given circulation and core polarization") DeclFunc("Antivortex", AntiVortex, "Antivortex magnetization with given circulation and core polarization") + DeclFunc("Radial", Radial, "Radial magnetization with given charge and core polarization") DeclFunc("NeelSkyrmion", NeelSkyrmion, "Néél skyrmion magnetization with given charge and core polarization") DeclFunc("BlochSkyrmion", BlochSkyrmion, "Bloch skyrmion magnetization with given chirality and core polarization") DeclFunc("TwoDomain", TwoDomain, "Twodomain magnetization with with given magnetization in left domain, wall, and right domain") @@ -111,6 +112,17 @@ func AntiVortex(circ, pol int) Config { } } +func Radial(charge, pol int) Config { + return func(x, y, z float64) data.Vector { + r2 := x*x + y*y + r := math.Sqrt(r2) + mz := 0.0 + mx := (x * float64(charge) / r) + my := (y * float64(charge) / r) + return noNaN(data.Vector{mx, my, mz}, pol) + } +} + // Make a vortex wall configuration. func VortexWall(mleft, mright float64, circ, pol int) Config { h := GetMesh().WorldSize()[Y]