A novel adaptive finite element method for the numerical simulation of magnetic fields with nonlinear materials is presented. The proposed method incorporates functions of both mesh refinement and mesh coarsening. Instead of explicitly eliminating unnecessary nodes in the mesh, the proposed mesh coarsening algorithm only needs a single mesh. The procedure is to apply constraints to those degrees of freedom with small estimated error. This process avoids solution interpolation errors due to changes from a fine mesh to a coarse mesh and can be implemented readily. The slave-master technique is adopted to eliminate the constrained degrees of freedom in the linear system, which has the same effect as mesh coarsening. Implementation details of the algorithm are presented and numerical examples are tested to showcase the effectiveness of the proposed method.