Skip to content

Commit

Permalink
v3.5.3 with improved GUI, disabled bulk DMI, 4096th commit
Browse files Browse the repository at this point in the history
  • Loading branch information
barnex committed May 15, 2014
1 parent 93e8f68 commit 193b575
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"
)

const VERSION = "mumax 3.5.3 alpha"
const VERSION = "mumax 3.5.3"

var UNAME = VERSION + " " + runtime.GOOS + "_" + runtime.GOARCH + " " + runtime.Version() + " (" + runtime.Compiler + ")"

Expand Down
39 changes: 20 additions & 19 deletions engine/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,41 @@ import (
)

var (
Aex ScalarParam // Exchange stiffness
Dex ScalarParam // interfacial DMI strength
Dx, Dy, Dz ScalarParam // bulk DMI strength
B_exch vAdder // exchange field (T) output handle
lex2 aexchParam // inter-cell exchange in 1e18 * Aex / Msat
dex2 dexchParam // inter-cell DMI in 1e9 * Dex / Msat
dx2, dy2, dz2 dexchParam // inter-cell DMI in 1e9 * Dex / Msat
E_exch *GetScalar // Exchange energy
Edens_exch sAdder // Exchange energy density
ExchCoupling sSetter // Average exchange coupling with neighbors. Useful to debug inter-region exchange
Aex ScalarParam // Exchange stiffness
Dex ScalarParam // interfacial DMI strength
//Dx, Dy, Dz ScalarParam // bulk DMI strength
B_exch vAdder // exchange field (T) output handle
lex2 aexchParam // inter-cell exchange in 1e18 * Aex / Msat
dex2 dexchParam // inter-cell DMI in 1e9 * Dex / Msat
//dx2, dy2, dz2 dexchParam // inter-cell DMI in 1e9 * Dex / Msat
E_exch *GetScalar // Exchange energy
Edens_exch sAdder // Exchange energy density
ExchCoupling sSetter // Average exchange coupling with neighbors. Useful to debug inter-region exchange
)

func init() {
Aex.init("Aex", "J/m", "Exchange stiffness", []derived{&lex2})
Dex.init("Dex", "J/m2", "Interfacial Dzyaloshinskii-Moriya strength", []derived{&dex2})
Dx.init("Dx", "J/m2", "Bulk Dzyaloshinskii-Moriya strength", []derived{&dx2})
Dy.init("Dy", "J/m2", "Bulk Dzyaloshinskii-Moriya strength", []derived{&dy2})
Dz.init("Dz", "J/m2", "Bulk Dzyaloshinskii-Moriya strength", []derived{&dz2})
//Dx.init("Dx", "J/m2", "Bulk Dzyaloshinskii-Moriya strength", []derived{&dx2})
//Dy.init("Dy", "J/m2", "Bulk Dzyaloshinskii-Moriya strength", []derived{&dy2})
//Dz.init("Dz", "J/m2", "Bulk Dzyaloshinskii-Moriya strength", []derived{&dz2})
B_exch.init("B_exch", "T", "Exchange field", AddExchangeField)
E_exch = NewGetScalar("E_exch", "J", "Exchange energy (normal+DM)", GetExchangeEnergy)
Edens_exch.init("Edens_exch", "J/m3", "Exchange energy density (normal+DM)", addEdens(&B_exch, -0.5))
registerEnergy(GetExchangeEnergy, Edens_exch.AddTo)
DeclFunc("ext_ScaleExchange", ScaleInterExchange, "Re-scales exchange coupling between two regions.")
lex2.init()
dex2.init(&Dex)
dx2.init(&Dx)
dy2.init(&Dy)
dz2.init(&Dz)
//dx2.init(&Dx)
//dy2.init(&Dy)
//dz2.init(&Dz)
ExchCoupling.init("ExchCoupling", "arb.", "Average exchange coupling with neighbors", exchangeDecode)
}

// Adds the current exchange field to dst
func AddExchangeField(dst *data.Slice) {
inter := !Dex.isZero()
bulk := !(Dx.isZero() && Dy.isZero() && Dz.isZero())
bulk := false // !(Dx.isZero() && Dy.isZero() && Dz.isZero()) // TODO: re-enable
switch {
case !inter && !bulk:
cuda.AddExchange(dst, M.Buffer(), lex2.Gpu(), regions.Gpu(), M.Mesh())
Expand All @@ -56,8 +56,9 @@ func AddExchangeField(dst *data.Slice) {
util.AssertMsg(Msat.IsUniform() && Aex.IsUniform() && Dex.IsUniform(), "DMI: Msat, Aex, Dex must be uniform")
cuda.AddDMI(dst, M.Buffer(), lex2.Gpu(), dex2.Gpu(), regions.Gpu(), M.Mesh()) // dmi+exchange
case bulk && !inter:
util.AssertMsg(Msat.IsUniform() && Aex.IsUniform() && Dx.IsUniform() && Dy.IsUniform() && Dz.IsUniform(), "DMI: Msat, Aex, Dex must be uniform")
cuda.AddDMIBulk(dst, M.Buffer(), lex2.Gpu(), dx2.Gpu(), dy2.Gpu(), dz2.Gpu(), regions.Gpu(), M.Mesh()) // dmi+exchange
panic("disabled")
//util.AssertMsg(Msat.IsUniform() && Aex.IsUniform() && Dx.IsUniform() && Dy.IsUniform() && Dz.IsUniform(), "DMI: Msat, Aex, Dex must be uniform")
//cuda.AddDMIBulk(dst, M.Buffer(), lex2.Gpu(), dx2.Gpu(), dy2.Gpu(), dz2.Gpu(), regions.Gpu(), M.Mesh()) // dmi+exchange
case inter && bulk:
util.Fatal("Cannot have induced and interfacial DMI at the same time")
}
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 193b575

Please sign in to comment.