# feeLLGood – an FEM micromagnetic simulator

FeeLLGood is a simulation code for micromagnetism using finite-element method. Its name stands for * finite element Landau Lifshitz Gilbert object oriented development*. FeeLLGood has been developed over the years at NEEL Institute and Spintec in Grenoble, and is still being extended. The core of the code is made available as open source. You are free to modify and distribute the source code under the GPLv3 licence.

## Theory

FeeLLGood features an unconditionally-convergent second-order (in time) \(\theta\)-scheme for the numerical integration of the Landau-Lifschitz-Gilbert equation, and an optimized computation of the demagnetizing field. The Gilbert equation governing the dynamics of the normalized magnetization \(\mathbf{m}\) is:

\[\frac{\partial \mathbf{m}}{\partial t} = - |\gamma_0| \mathbf{m} \times \mathbf{H}_\text{eff} + \alpha \mathbf{m} \times \frac{\partial \mathbf{m}}{\partial t}\]where \(\gamma_0\) the electron gyromagnetic ratio and \(\alpha\) the Gilbert phenomenological damping parameter. Temperature is zero in the framework of micromagnetisn with LLG, despite attenuation being present through Gilbert damping. This non-linear and non-local partial derivative equation is solved using finite element method, with a weak formulation. The effective field \(\mathbf{H}_\text{eff}\) is:

\[\mathbf{H}_\text{eff} = \frac{2 A}{\mu_0 M_s} \nabla^2 \mathbf{m} - \frac{1}{\mu_0 M_s} \frac{\partial E_a}{\partial \mathbf{m} } + \mathbf{H}_{\mathrm{ext}} + \mathbf{H}_d\]where \(A\) is the exchange constant, \(M_s\) is the magnetization at saturation of the material, \(E_a\) is the anisotropy energy and \(\mathbf{H}_{\mathrm{ext}}\) the external applied field. The anisotropy energy \(E_a\) is either a magneto-cristalline second order uniaxial anisotropy, or a cubic fourth order anisotropy. These optional contributions are only volume contributions, surface anisotropy is not implemented in FeeLLGood.

The demagnetizing field is \(\mathbf{H}_d = -\frac{1}{4 \pi} \int_{\mathcal{V}} \nabla \cdot \mathbf{m} \frac{\mathbf{r}}{r^3} d{\mathcal{V}}\)

This integral is never computed directly, since it would require 6 nested loops for any three dimensional object. It is estimated through the scalar potential, since \(\mathbf{H}_d = -\nabla \Phi_d\)

\(\Phi_d\) is split in volume and surface contributions of the sample, among its volume and its free surface \(\mathcal{S} = \partial \mathcal{V}\) :

\[\Phi_d(\mathbf{r}) = \frac{M_s}{4 \pi} \left[ \int_{\mathcal{V}} \frac{ -\nabla \cdot \mathbf{m} }{ |\mathbf{r}-\mathbf{r'} |} d{\mathcal{V}} + \int_{ \mathcal{S} } \frac{ \mathbf{m} \cdot \mathbf{n} } { { |\mathbf{r}-\mathbf{r'} |} } d{\mathcal{S}} \right]\]The surface density charges \(\mathbf{m} \cdot \mathbf{n}\) and volume density charges \(-\nabla \cdot \mathbf{m}\) are computed in FeeLLGood on tetraedrons and triangles of the mesh of the simulated sample, then the potential \(\Phi_d\) is computed using fast multipole algorithm. It relies on the multipole expansion of the scalar potential of the magnetic charges. It is implemented separately in the external library ScalFMM.

Material parameters are given to the FeeLLGood solver through the mesh file and a yaml file. Some Python example scripts are provided. In the future, the program core will be made available as a Python module, which should help users writing their own custom simulation programs.

### What FeeLLGood can do

- FeeLLGood can solve the magnetization dynamics with good accuracy, and magnetostatics problems.
- It is possible to model a sample including different materials, curved geometries, non-connex samples, multilayers.
- Spin polarization transfer torque effect can be included, with the so-called Thiaville model.
- Time dependant applied field is possible.

### What FeeLLGood cannot do

- FeeLLGood does not include thermal fluctuation of the magnetization, but it is possible to fake temperature using average \(M_s(T)\) values.
- FeeLLGood cannot be used for the simulation of antiferromagnet materials, neither multi-ferroics materials.
- FeeLLGood does not include DMI interactions nor SOT at this date.

## News

- 2024-05-27: release 0.10.0, feeLLGood relies on the GMSH library for reading meshes
- 2024-02-02: feeLLGood can make use of Intel® MKL: see Installation
- 2023-09-22: release 0.9.1 brings a new function syntax for defining the initial magnetization and the applied field
- 2023-09-08: release 0.9.0, using the Eigen library instead of GMM for linear algebra
- 2023-06-14: version 0.8.0 released, with a new expression syntax