From 5865b9c55b300283719256a1bf20e9a7f2731d69 Mon Sep 17 00:00:00 2001 From: Arne Vansteenkiste Date: Fri, 30 Sep 2016 09:24:23 +0200 Subject: [PATCH] backport test/dmienergy-vardmi.mx3 --- test/dmienergy-vardmi.mx3 | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 test/dmienergy-vardmi.mx3 diff --git a/test/dmienergy-vardmi.mx3 b/test/dmienergy-vardmi.mx3 new file mode 100644 index 000000000..721116b9c --- /dev/null +++ b/test/dmienergy-vardmi.mx3 @@ -0,0 +1,46 @@ +/* + Test energy dissipation in presence of DMI with variable D. + This failed before commit 4ee9bfa710758113b357d62edd26d4494048d07e (fix region dependent dind) +*/ + +N := 64 +setgridsize(N, N, 1) +c := 1.15e-9 / 2 +d := 1.15e-9 +setcellsize(c, c, d) +//maxerr = 1e-5 + +defregion(0, xrange(0, inf)) +defregion(1, xrange(-inf, 0)) +defregion(2, yrange(-inf, 0)) + +Aex = 20e-12 +Ku1 = 5.9e5 +Msat = 6e5 +AnisU = vector(0, 0, 1) + +ext_enableunsafe() + +Dind.setRegion(0, 4e-3) +Dind.setRegion(1, 2e-3) +Dind.setRegion(2, -3e-3) + +m = uniform(1, 1, 1) +alpha = 0.001 + +tableAdd(E_total) +tableAutosave(1e-12) + +E0 := E_total.Get() +print("E0", E0, "J") + +run(10e-12) +E1 := E_total.Get() +print("E1", E1, "J") + +run(10e-12) +E2 := E_total.Get() +print("E2", E2, "J") + +expect("delta1", E1-E0, -5.4119e-20, 0.01e-20) +expect("delta2", E2-E0, -6.8447e-20, 0.01e-20)