Skip to content

Commit

Permalink
turn off temperature during relax
Browse files Browse the repository at this point in the history
  • Loading branch information
barnex committed Dec 9, 2014
1 parent f304193 commit b066763
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion engine/effectivefield.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ func SetEffectiveField(dst *data.Slice) {
B_exch.AddTo(dst) // ...then add other terms
B_anis.AddTo(dst)
B_ext.AddTo(dst)
B_therm.AddTo(dst)
if !relaxing {
B_therm.AddTo(dst)
}
}
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.6"
const VERSION = "mumax 3.6.1"

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

Expand Down
7 changes: 5 additions & 2 deletions engine/relax.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ func init() {
DeclFunc("Relax", Relax, "Try to minimize the total energy")
}

// are we relaxing?
var relaxing = false

func Relax() {
SanityCheck()
pause = false
Expand All @@ -20,14 +23,14 @@ func Relax() {
prevErr := MaxErr
prevFixDt := FixDt
prevPrecess := Precess
//prevTemp := Temp.upd_reg

// ...to restore them later
defer func() {
SetSolver(prevType)
MaxErr = prevErr
FixDt = prevFixDt
Precess = prevPrecess
relaxing = false
// Temp.upd_reg = prevTemp
// Temp.invalidate()
// Temp.update()
Expand All @@ -37,7 +40,7 @@ func Relax() {
SetSolver(BOGAKISHAMPINE)
FixDt = 0
Precess = false
//Temp.Set(0)
relaxing = true

// Minimize energy: take steps as long as energy goes down.
// This stops when energy reaches the numerical noise floor.
Expand Down
2 changes: 1 addition & 1 deletion engine/temperature.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (b *thermField) update() {
}

func GetThermalEnergy() float64 {
if Temp.isZero() {
if Temp.isZero() || relaxing {
return 0
} else {
return -cellVolume() * dot(&M_full, &B_therm)
Expand Down

0 comments on commit b066763

Please sign in to comment.