forked from mumax/3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixedlayer.mx3
85 lines (63 loc) · 1.77 KB
/
fixedlayer.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
Test of Slonczewski torque implementation
Mykola Dvornik
*/
randomSeed := 1234567
setsolver(4)
randSeed(randomSeed)
Nx := 64
Ny := 32
Nz := 16
sX := 128e-9
sY := 64e-9
sZ := 32e-9
setgridsize(Nx, Ny, Nz)
setcellsize(sX/Nx, sY/Ny, sZ/Nz)
Msat = 800e3
Aex = 13e-12
m = randommagseed(randomSeed)
alpha_v := 0.01
alpha = alpha_v
lambda = 1
Pol = 0.5669
epsilonprime = 0.02
DisableZhangLiTorque = true
gamma_v := 2.211e5 / mu0
gammaLL = gamma_v
Jtot := -0.008 // total current in amps
carea := sX * sY
jc := Jtot / carea
print("Current density is: ", jc)
J = vector(0, 0, jc)
grainSize := 4e-9 // m
maxRegion := 255
ext_makegrains(grainSize, maxRegion, randomSeed)
for i := 0; i < maxRegion; i++ {
FixedLayer.SetRegion(i, vector(randNorm(), randNorm(), randNorm()))
}
print(STtorque.average())
print(torque.average())
save(m)
save(fixedlayer)
TOL := 1e-10
// testing against oommf 2.0a0
// It turnes out that volume averaging with avf2odt does not normalize by the number of cells in z direction
// Hence Nz below
// # ODT 1.0
// ## Desc: Data from vector field file fixedlayer-eprime0.02-Oxs_SpinXferEvolve-evolve-Spin_torque-000000000-0000000.ovf
// ## Active volume: (0,0,0) x (1.28e-07,6.4e-08,3.2e-08)
// ## Cell size: 2e-09 x 2e-09 x 2e-09
// ## Cells in active volume: 32768
// #
// # Table Start
// # Title: Average across active volume
// # Columns:\
// # M_x M_y M_z
// # Units:\
// # rad/s rad/s rad/s
// 585292335.751551 -193932305.309290 -669142900.930218
stt1_v := 585292335.751551 / gamma_v / Nz
stt2_v := -193932305.309290 / gamma_v / Nz
stt3_v := -669142900.930218 / gamma_v / Nz
print(stt1_v, stt2_v, stt3_v)
expectv("STtorque", STtorque.average(), vector(stt1_v, stt2_v, stt3_v), TOL)