forked from mumax/3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenergy.mx3
56 lines (43 loc) · 1.17 KB
/
energy.mx3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
Test different energy contributions,
reference solutions from OOMMF (energy.mif).
*/
l := 512e-9
w := 256e-9
d := 40e-9
c := 4e-9
vol := l * w * d * (pi/4)
setcellsize(c, c, d)
setgridsize(128, 64, 1)
setgeom(ellipse(l, w))
Msat = 860E3
Aex = 13E-12
Ku1 = 50
alpha = 3
anisU = vector(1,0,0)
m = vortex(1, 1)
relax()
E1_tot := E_total.get()
E1_exc := E_exch.get()
E1_ani := E_anis.get()
E1_dem := E_demag.get()
E1_zee := E_zeeman.get()
B_ext = vector(100e-3, 0, 0)
relax()
E2_tot := E_total.get()
E2_exc := E_exch.get()
E2_ani := E_anis.get()
E2_dem := E_demag.get()
E2_zee := E_zeeman.get()
// OOMMF energy density differences:
OOMMF_tot := (12274.249330 - (-56507.645615 ) ) * vol
OOMMF_exc := ( 5038.693945 - ( 71.438905 ) ) * vol
OOMMF_ani := ( 19.517039 - ( 0.271210 ) ) * vol
OOMMF_dem := ( 7216.038345 - ( 29186.031229 ) ) * vol
OOMMF_zee := ( 0 - (-85765.386961 ) ) * vol
tol := 1e-18
expect("E_anis" , E1_ani - E2_ani, OOMMF_ani, 1e-21)
expect("E_zeeman", E1_zee - E2_zee, OOMMF_zee, tol)
expect("E_exch" , E1_exc - E2_exc, OOMMF_exc, tol)
expect("E_demag" , E1_dem - E2_dem, OOMMF_dem, tol)
expect("E_total" , E1_tot - E2_tot, OOMMF_tot, tol)