A very general magnetostatic problem involving inhomogeneous anisotropic ma
terials filling irregular regions and with mixed boundary conditions is for
mulated in terms of magnetic vector potential. Some restrictions inherent t
o the introduction of a vector potential become apparent and additional con
ditions for the uniqueness of the vector potential naturally arise. The mod
elling of permanent magnets is introduced in both the vector potential and
the field formulations by weakening the regularity requirements on the sour
ce term. The vector potential formulation is also shown to be equivalent to
a penalized formulation widely used in numerical applications.