Skip to content

Commit

Permalink
Add zeeman energy test for Jonathan's peace of mind.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnex committed Feb 3, 2015
1 parent 3bfde19 commit 4e144a1
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/zeemanenergy.mx3
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Nx := 128
Ny := 32
Nz := 2

cx := 5e-9
cy := 4e-9
cz := 3e-9

V := Nx * Ny * Nz * cx * cy * cz

SetGridSize(Nx, Ny, Nz)
SetCellSize(cx, cy, cz)

Ms := 100e3
Msat = Ms

M = Uniform(1, 0, 0)

print(E_zeeman)

B := 1e-3

tol := B*Ms*V / 1e5

B_ext = vector(B, 0, 0)
expect("E", E_zeeman, -B*Ms*V, tol)

B_ext = vector(0, B, 0)
expect("E", E_zeeman, 0, tol)

B_ext = vector(-B, 0, 0)
expect("E", E_zeeman, B*Ms*V, tol)

0 comments on commit 4e144a1

Please sign in to comment.