Charge-based recursive fast-multipole micromagnetics

Several methods exist for computing the magnetostatic field of a discretized magnetization distribution in micromagnetics. In principle, this field can be computed either from the magnetization or from its divergence, the equivalent magnetic charge density. However, these are computationally quite different, since for a flux-closure configuration, the magnetization can be very large, though the charge density and the resulting magnetostatic field are very small. In this paper we show how a fast multipole formulation, previously implemented to calculate the field from the magnetization density, can be modified to calculate the field from the magnetic charge density instead. We give examples of systems in which the charge formulation converges much faster (as the multipole order is increased) to the correct field than does the magnetization formulation. The fast multipole formulation (FMM) used in this paper is based on a Cartesian formulation of the FMM, for which we have developed several recursive techniques to simplify its implementation by eliminating hard coding of formulas.