/*
    Symmetry test for bulk DMI in a 1D magnet with Neumann BC.
    Rotating the entire system by 90° should give symmetric result.
    This test is based on the proposed 1D standard problem of bulk DMI:
    https://doi.org/10.1088/1367-2630/aaea1c
*/

N := 100
c := 1e-9
TOL := 1e-7

setcellsize(c, c, c)
setgridsize(N, 1, 1)

msat = 0.86e6
aex = 13e-12
Ku1 = 0.4e6
Dbulk = 3e-3
enabledemag = False
openBC = False

// x-direction
anisU = vector(0, 0, 1)
m = Uniform(0, 0, 1)
minimize()
print("Magnet along X:", m)
m0 := m.Average()

// y-direction
setgridsize(1, N, 1)
anisU = vector(1, 0, 0)
m = Uniform(1, 0, 0)
minimize()
print("Magnet along Y:", m)
expect("alongY", m.Average().X(), m0.Z(), TOL)

// z-direction
setgridsize(1, 1, N)
anisU = vector(0, 1, 0)
m = Uniform(0, 1, 0)
minimize()
print("Magnet along Z:", m)
expect("alongZ", m.Average().Y(), m0.Z(), TOL)
