$$\require{cancel}$$
In analogy with the electrostatic case, the forces due to the magnetic field acting on the current distribution in a body can be obtained from a magnetic Maxwell stress tensor, see J.A.Stratton, Electromagnetic Theory, section 2.5, (McGraw-Hill, N.Y., 1941). If the magnetic materials in the system are linear so that $$\vec B$$ is proportional to $$\vec H$$, it can be shown that there exists a vector $$\vec T$$M associated with the elements of the stress tensor such that the surface integral of $$\vec T$$M over a closed surface S gives the net force acting on the material in the volume V enclosed by the surface S: it is assumed that the surface S is contained entirely within a fluid that can support no shearing stresses. The magnetic force acting on the material within the volume V can be calculated from
$\overrightarrow{\mathrm{F}}_{M}=\int \int_{S} \overrightarrow{\mathrm{T}}_{M} \cdot \overrightarrow{\mathrm{d} \mathrm{S}}, \label{5.75}$
$\left|\overrightarrow{\mathrm{T}}_{M}\right|=\frac{\overrightarrow{\mathrm{B}} \cdot \overrightarrow{\mathrm{H}}}{2}, \label{5.76}$
and its direction is given by the construction shown in Figure (5.6.14). The stress vector $$\vec T$$M is turned away from the surface normal through an angle that is twice the angle that the magnetic field $$\vec B$$ (or $$\vec H$$) makes with the surface normal. When $$\vec B$$ lies along the surface normal the magnetic force is a tension, but when the field $$\vec B$$ lies in the surface the magnetic force is a pressure.