Documentation#
Warning This package is experimental and in development phase, breaking API changes may happen at any time.
Magpylib-Material-Response is an extension to the Magpylib library, providing magnetic field analysis for soft materials and demagnetization of hard magnets. Leveraging the Method of Moments, it calculates the self-consistent magnetic material response by meshing sources into an arbitrary number of unit cells.
Key features:
apply_demag— self-consistent demagnetization of magpylibCollectionobjects, with per-cell scalar or anisotropic susceptibility and external field support.Two solvers, one physics — an exact dense solver and an FFT-accelerated iterative solver that agree to solver tolerance for any input; meshes with tens of thousands of cells solve in seconds.
Analytical interactions — volume-averaged Newell tensors for cuboid cells (generalized to different cell sizes), point matching for everything else.
Meshing helpers — cuboids, cylinders, and arbitrary closed surfaces via tetrahedral meshing (
mesh_TriangularMesh, using TetGen).
Installation#
pip install magpylib-material-response
or with conda:
conda install -c conda-forge magpylib-material-response
Tetrahedral meshing of TriangularMesh magnets requires the optional
TetGen dependency:
pip install magpylib-material-response[tetgen]
See the documentation for a quickstart, worked examples, and the method description.
Getting started