An adaptive FEM for 3D magnetostatic problems involving non-linear material
s and permanent magnets is presented. The problems are formulated in terms
of scalar potentials and discretized on a tetrahedral mesh using linear sha
pe functions. Local error is estimated by approximately solving an independ
ent differential problem in each tetrahedral element.