Ferrolith is a standalone C++17/CUDA library for computing the demagnetizing field on tetrahedral finite-element meshes. It implements the Fredkin-Koehler scalar potential decomposition with FEM-BEM coupling and is fully GPU-accelerated via cuSPARSE and AMGCL.

Features#

  • Demagnetizing field via the Fredkin-Koehler method with multiple BEM backends (GPU FMM, H2Lib, dense, Galerkin)
  • Shell-transform and volume FMM solvers as alternatives to BEM
  • Exchange field via FEM stiffness matrix with GPU SpMV
  • Magnetocrystalline anisotropy (uniaxial and cubic) via CUDA kernels
  • Zeeman (external) field with GPU accumulate support
  • Composable effective field that owns named field components and evaluates their sum
  • Python interface via pybind11 with NumPy array interop

What You’ll Find Here#