C++ mpi module for stochmagnet_main Package
dipolar/demagnetized fields computing package

dipolar/demagnetized fields computing package contains dipolar/demagnetized fields computing used for dipolar operators package for Stoch Magnet module

dipolar/demagnetized fields computing package contains dipolar/demagnetized fields computing used for dipolar operators package for Stoch Magnet module

The package computes the demagnetized field in macro cells.

The network is discretized in macro cells grid with a fixed cell size which is prefered to be a multiple of the unit cell size.

The position \(p_{c}\) of each macro cell c is defined from the magnetic center of mass of the particles of the macro cell:

\( \displaystyle p_{c}=\displaystyle \frac{\sum_{p_j \in \omega_{c}} \mu_s^j . p_j}{\sum_{p_j \in \omega_{c}} \mu_s^j} \)

where \(\omega_{c} \) is the domain of the macro cell at index c.

The magnetization field at a macro cell is the sum of the atomic moments of the particles in the macro cell: \( M_{c}=\displaystyle \sum_{p_j \in \omega_{c}} \tilde \mu^j_s . S_j \)

The demagnetized field within each macro cell c is \( H^c_{dem}=\displaystyle \frac{\mu_0. \mu_B }{4.\pi . (10^{-10})^3} \left ( \sum_{q\neq c} \frac{3 <M^q,u_{cq}>_3.u_{cq} - M^q}{r^3_{cq}} \right) - \frac{\mu_0.\mu_B}{3.V_c} M^c \)

where \(r_{cq} \) if the distance between macro cells \(c\) and \(q\) in Angstrom and the unit vector \(u_{cq}=\frac{r_{cq}}{|r_{cq}|}\) and \(V_c\) is the effective volume of the macro cell defined by:

\( V_c = n^a_c . \frac{a^3}{N_a}\) when \(n^a_c\) is the number of particles inside the macro cell c, \(a\) is the unit cell size and \(N_a\) the number of atoms in the unit cell size.

The last term of equation represents the demagnetized field generated by the particles in the macro cell to themselves.

The dipolar field of each particle is the demagnetized field defined of the macro cell to which it belongs.

The adimensionized formulation is \( H^c_{dem}=\displaystyle \frac{1}{4.\pi}. \left ( \sum_{q\neq c} \frac{3 <M^q,u_{cq}>_3.u_{cq} - M^q}{r^3_{cq}} \right) - \frac{Na}{3.n^a_c.a^3} M^c \)

If the demagnetized field is considered as external field applied on each particle of the macro cell such that the Energy of the spin i is considered as a Zeeman energy: \( E^i_{dem}=-\mu_s <H^{c}_{dem},S_i> \) and total energy of the system \( E_{dem}=\sum_i E^i_{dem} \) where \(c \) is the macro cell containing the spin i.

If the demagnetized field is not considered as an external field but a field that changes at any time: the computation of the dipolar field is computed from direction of magnetic moment S on particles p to magnetic field H on particles with intermediate computation on magnetization field M and demagnetized field \(H^{dem}\) on macro cells c:

\( S_p \mapsto M_c \mapsto H^{dem}(M_c) \mapsto H_p \).

In that case the energy of the spin i located in a macro cell c is:

\(E_i=-<H^{dem}_c,M_c>-\frac{1}{2} . \frac{\mu_0}{3.V_p} <M_c,M_c> \)

With this formula we can easily verify that \( \displaystyle \frac{1}{\mu_s}\frac{dE_i}{dS_i}.\delta=-H_i=-H^{dem}_c \).

As H is linear, the complete energy of the system can also be computed with the general formula: \( E=-\frac{1}{2} \mu_s \sum_p <H_p,S_p> \)

The package contains the classes :

This package has openmp and mpi implementations:

The UML organization of the package is as follow: