Skip to content

Commit

Permalink
fix issue mumax#63
Browse files Browse the repository at this point in the history
  • Loading branch information
barnex committed Feb 27, 2016
1 parent 36e5b0e commit 94fb4b7
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions engine/ext_rmsurfacecharge.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package engine
import (
"fmt"
"github.com/mumax/3/data"
"github.com/mumax/3/mag"
"github.com/mumax/3/util"
"math"
)
Expand All @@ -26,20 +25,13 @@ func RemoveLRSurfaceCharge(region int, mxLeft, mxRight float64) {
B_ext.Add(compensateLRSurfaceCharges(Mesh(), mxLeft, mxRight, bsat), nil)
}

// Returns the saturation magnetization in Tesla.
// Cannot be set. Set Msat and bsat() will automatically be updated.
func bSat() float64 {
util.AssertMsg(Msat.IsUniform(), "Remove surface charge: Msat must be uniform")
return mag.Mu0 * Msat.GetRegion(0)
}

func compensateLRSurfaceCharges(m *data.Mesh, mxLeft, mxRight float64, bsat float64) *data.Slice {
h := data.NewSlice(3, m.Size())
H := h.Vectors()
world := m.WorldSize()
cell := m.CellSize()
size := m.Size()
q := cell[Z] * cell[Y]
q := cell[Z] * cell[Y] * bsat
q1 := q * mxLeft
q2 := q * (-mxRight)

Expand Down

0 comments on commit 94fb4b7

Please sign in to comment.