On the computation of hysterisis and closure domains in micromagnetism