Abstract:The Helmholtz equations for the secondary fields are almost the same as those for the total fields; the main differences are the addition of source terms involving the primary fields and the conductivity (TM mode) or magnetic permeability (TE mode) difference between the abnormal body and the host. In this paper a forward code was proposed using the finite element method, in which not only the conductivity but also the magnetic permeability differences were considered. In order to increase the calculation accuracy and efficiency, some special technologies were adopted. First, Green’s theorem was used to treat the source term of the secondary field equations as the volume integral and boundary integrals at elements. Next, the contraction grid algorithm was designed based on the binary tree structure. The advantage of the mesh was that it greatly reduced the number of nodes with almost the same precision as the uncontracting mesh. Moreover, sparse linear system of equations was solved by using the LDLT method, in order to reduce the calculation time. The sparse matrix symbolic analysis method based on the minimum fill in element were adopted before the LDLT. Finally, the two models were tested. The results showed that the calculation accuracy and efficiency were greatly improved by using the treatment method of secondary filed source term, the domain discrete method and the LDLT.