/*
	Micromagnetic standard problem 4,
	with 3D discretization
	all the spins are fixed
	so there should be no dynamics in the system
	and the final state should be equal to the initial one
*/

// geometry
	setgridsize(128, 32, 2)
	setcellsize(500e-9/128, 125e-9/32, 3e-9/2)

// material
	Msat = 800e3
	Aex = 13e-12
	frozenspins = 1
	m  = uniform(1, .1, 0)

// relax
	relax()
	TOL := 1e-4
	expectv("m", m.average(), vector(0.9950371980667114, 0.09950374066829681, 0), TOL)

// reversal
	alpha = 0.02
	B_ext = vector(-24.6E-3, 4.3E-3, 0)
	run(1e-9)
	expectv("m", m.average(), vector(0.9950371980667114, 0.09950374066829681, 0), TOL)
