Modelling hysteresis loops for finite element magnetic field calculations