To run the model, open magnets.pro with Gmsh
and click on the "Run" button in the left panel.
Features addressed in this tutorial
Dual vector and scalar magnetic potentials formulations
Boundary condition at infinity with infinite elements
Maxwell stress tensor and rigid-body magnetic forces
This rather didactic tutorial solves the electromagnetic field
and the rigid-body forces acting on a set of magnetic pieces
of parallelepipedic or cylindrical shape.
The tutorial model proposes both dual 3D magnetostatic formulations:
the magnetic vector potential formulation with spanning-tree gauging,
and the scalar magnetic potential formulation.
As in tutorial 2 (magnetostatic field of an electromagnet), a shell
of so-called infinite elements is used here to impose the exact
zero-field boundary condition at infinity.
The preferred way to compute electromagnetic forces in GetDP
is as an explicit by-product of the Maxwell stress tensor.