Skip to content

Commit

Permalink
cleanup temp_red
Browse files Browse the repository at this point in the history
  • Loading branch information
barnex committed Sep 14, 2016
1 parent 2c7f6a5 commit b311fea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
3 changes: 1 addition & 2 deletions engine/demag.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import (

// Demag variables
var (
Msat = NewScalarParam("Msat", "A/m", "Saturation magnetization",
&Bsat, &lex2, &din2, &dbulk2, &temp_red)
Msat = NewScalarParam("Msat", "A/m", "Saturation magnetization", &Bsat, &lex2, &din2, &dbulk2)
Bsat DerivedParam
M_full = NewVectorField("m_full", "A/m", "Unnormalized magnetization", SetMFull)
B_demag = NewVectorField("B_demag", "T", "Magnetostatic field", SetDemagField)
Expand Down
14 changes: 1 addition & 13 deletions engine/temperature.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
)

var (
Temp = NewScalarParam("Temp", "K", "Temperature", &temp_red)
temp_red DerivedParam // reduced temperature = (alpha * Temp) / (mu0 * Msat)
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)
Expand All @@ -32,17 +31,6 @@ func init() {
registerEnergy(GetThermalEnergy, AddThermalEnergyDensity)
B_therm.step = -1 // invalidate noise cache
DeclROnly("B_therm", &B_therm, "Thermal field (T)")

// reduced temperature = (alpha * T) / (mu0 * Msat)
temp_red.init(1, []parent{Alpha, Temp, Msat}, func(p *DerivedParam) {
dst := temp_red.cpu_buf
alpha := Alpha.cpuLUT()
T := Temp.cpuLUT()
Ms := Msat.cpuLUT()
for i := 0; i < NREGION; i++ { // not regions.MaxReg!
dst[0][i] = safediv(alpha[0][i]*T[0][i], mag.Mu0*Ms[0][i])
}
})
}

func (b *thermField) AddTo(dst *data.Slice) {
Expand Down
2 changes: 1 addition & 1 deletion engine/torque.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var (
Alpha = NewScalarParam("alpha", "", "Landau-Lifshitz damping constant", &temp_red)
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")
Expand Down

0 comments on commit b311fea

Please sign in to comment.