The micromagnetism poses particular emphasis in the exact calculation of the demagnetizing field. In the continuous micromagnetic approach it is described by the Maxwell equation in the absence of currents and, therefore, there exists a potential called scalar magnetostatic potential that satisfies:
The sources of the magnetostatic field are called magnetostatic charges. The surface charge is defined as and the volume charge as . The magnetostatic energy integral extends to all the space, not only the ferromagnetic body, and the minimization of the magnetostatic energy will seek the reduction of the field outside the ferromagnetic body. This can be achieved reducing of the magnetic charges and that fact is stated as the pole avoidance principle. This field gives origin to domains and magnetization inhomogeneities. The generic solution of a field from its sources is found in traditional electromagnetism
In micromagnetic calculations most of the computation time is spent in the calculation of the magnetostatic field. The dipolar interaction is non-local and long ranged. The field in dipole-dipole representation is a sum of elements, where N is the number of atomic moments and the numerical integration of Eq. (2.30) scales like and this represents too much computational time even for today advanced computers. Due to this reason, several advanced methods have been used to solve the magnetostatic problem. The methods used are Fast Fourier Transform(FFT) [Yuan 92], Finite Element Method (FEM) [Chen 97], hybrid FEM - Boundary Element Method (FEM-BEM) [Fredkin 90], Fast Multipole Method (FMM) [Brown 04] and other advanced methods. The efficiency of each method depends on the implementation and on the simulated physical problem. We use a different method called the Dynamic Alternating Direction Implicit (DADI) [Gibbons 98]. The underlying principle of this method is to add a fictitious time derivative to Eq. (2.27):
The operator is replaced by its finite difference equivalent. For example the contribution is
This method needs the addition of free (zero magnetization) space in the simulated region to allow the potential to slowly tend to its infinity value. This value is arbitrary because the equation is differential and we choose it, for convenience, to be zero. This is also the case in FEM and FFT methods(zero-padding). The hybrid FEM-BEM method presents the advantage of not requiring discretization elements outside the simulated sample. In the DADI method periodic boundary is easily implemented if we consider . The resulting tridiagonal system is replaced then by a periodic tridiagonal system, which is also very simple to solve.