Application of an exactly invertible hysteresis model to magnetic field computations