Examples#

Worked, executable examples — in suggested reading order:

  • Cuboid demagnetization — two hard cuboid magnets; mesh-refinement convergence against FEM reference data.

  • Soft magnets — a hard magnet next to a high-permeability soft cuboid; field comparison against FEM.

  • U-core electromagnet — current sources driving a soft core: a swept multi-turn coil built with the polyline helpers, the field on a plane above the poles, and a cuboid- vs tetrahedral-mesh comparison.

  • Solvers and performance — direct vs. iterative solver: agreement guarantee, scaling of wall time and memory, and how the model topology decides which interaction paths do the work.

  • Arbitrary shapes with tetrahedral meshes — meshing a TriangularMesh magnet with TetGen, validated against the exact soft-sphere solution.