-
Notifications
You must be signed in to change notification settings - Fork 0
/
nodemagspins.mx3
54 lines (35 loc) · 1.51 KB
/
nodemagspins.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
setgridsize(128, 32, 1)
setcellsize(500e-9/128, 125e-9/32, 3e-9)
Msat = 800e3
Aex = 13e-12
m = uniform(1, 1, 1)
LEFT := 0
RIGHT := 1
AIR := 2
defregion(LEFT, xrange(-inf, 0))
defregion(RIGHT, xrange(0, inf))
TOL := 1e-4
expectv("L", B_demag.Region(LEFT).Average(), vector(-0.005299, -0.022127, -0.552248), TOL)
expectv("R", B_demag.Region(RIGHT).Average(), vector(-0.005299, -0.022127, -0.552248), TOL)
NoDemagSpins.SetRegion(LEFT, 0)
NoDemagSpins.SetRegion(RIGHT, 1)
expectv("L", B_demag.Region(LEFT).Average(), vector(-0.0103589, -0.02122757, -0.5480939), TOL)
expectv("R", B_demag.Region(RIGHT).Average(), vector(0, 0, 0), 0)
NoDemagSpins.SetRegion(LEFT, 1)
expectv("L", B_demag.Region(LEFT).Average(), vector(0, 0, 0), 0)
expectv("R", B_demag.Region(RIGHT).Average(), vector(0, 0, 0), 0)
FixDt = 1e-14
steps(1000) // test for memleaks
airgap := yrange(0, inf)
SetGeom(airgap.inverse())
defregion(AIR, airgap)
expectv("L", B_demag.Region(LEFT).Average(), vector(0, 0, 0), 0)
expectv("R", B_demag.Region(RIGHT).Average(), vector(0, 0, 0), 0)
expectv("A", B_demag.Region(AIR).Average(), vector(0, 0, 0), 0)
NoDemagSpins.SetRegion(LEFT, 0)
NoDemagSpins.SetRegion(RIGHT, 0)
expectv("L", B_demag.Region(LEFT).Average(), vector(-0.0046074, -0.0391400, -0.53594726), TOL)
expectv("R", B_demag.Region(RIGHT).Average(), vector(-0.0046074, -0.0391400, -0.53594726), TOL)
expectv("A", B_demag.Region(AIR).Average(), vector(-0.000692, 0.0170129, -0.01630170), TOL)
NoDemagSpins.SetRegion(LEFT, 1)
steps(1000) // test for memleaks