Three-dimensional finite element program for magnetic field problems