-
Notifications
You must be signed in to change notification settings - Fork 0
/
cubic_full.mx3
49 lines (34 loc) · 1.07 KB
/
cubic_full.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
/*
Test cubic anistorpy energy
based on: The design and verification of MuMax3 AIP Advances 4, 107133 (2014); http://dx.doi.org/10.1063/1.4899186
Test for one random-ish angle.
*/
setGridSize(1, 1, 1)
setCellSize(1e-9, 1e-9, 1e-9)
V := pow(1e-9, 3)
AnisC1 = vector(1, 0, 0)
AnisC2 = vector(0, 1, 0)
theta := 23*pi/180
phi := 11*pi/180
m = uniform(sin(phi)*cos(theta), sin(phi)*sin(theta), cos(phi))
TOL := 1e-2
// try to trigger bad XXX_red update:
Msat = 1e3
Kc1 = 1e6; Kc2 = 0; Kc3 = 0
E_total.get()
Msat = 1000e3
expect("easy1", E_anis.get()/V, 35254.015625, TOL)
Kc1 = -1e6; Kc2 = 0; Kc3 = 0
expect("hard1", E_anis.get()/V, -35254.015625, TOL)
Kc1 = 0; Kc2 = 1e6; Kc3 = 0
expect("easy2", E_anis.get()/V, 165.23309326171875, TOL)
Kc1 = 0; Kc2 = -1e6; Kc3 = 0
expect("hard2", E_anis.get()/V, -165.23309326171875, TOL)
Kc1 = 0; Kc2 = 0; Kc3 = 1e6
expect("easy3", E_anis.get()/V, 912.3794555664062, TOL)
// try to trigger bad XXX_red update:
Kc1 = 0; Kc2 = 0; Kc3 = -1e6
Msat = 1e3
E_total.get()
Msat = 1000e3
expect("hard3", E_anis.get()/V, -912.3794555664062, TOL)