IEEE TRANSACTIONS ON MAGNETICS, VOL. 26, NO. 2, MARCH 1990 zyxwvut 141 USE OF A MULTIGRID SOLVER IN THE MAFIA MODULE S3 FOR ELECTRO- AND MAGNETOSTATIC PROBLEMS F. Krawczyk, T. Weiland Technische Hochschule Darmstadt Theorie elektromagnetischer Felder Schlossgartenstrasse 8, 6100 Darmstadt, Germany zyxwv B. Steffen KernforschungsanlageJiilich GmbH Zentralinstitut fur Angewandte Mathematik PO Box 1913,5170 Jiilich, Germany Abstract SOR zyxwvutsrqpo - schemes are a well tested standard for finite diffe- rence methods (FD) in electromagnetic calculations. For 3D problems requiring high accuracy, the necessary fine meshes give a large number of unknowns and so SOR becomes very slow. In the S3 code we therefore also incorporated a multigrid (MG) scheme, a technique developed for the solution of pro- blems with many unknowns. The performance and accuracy of both schemes have been compared. These tests demonstrated that multigrid is much faster and more accurate than SOR. It also converges for matrices where SOR fails. Introduction As reported [l], the next release [2] of the MAFIA group of codes will include a solver for electro- and magnetostatic problems. It is fully compatible with the MAFIA pre- and postprocessors, M3 and P3. Thus, it also uses the FIT-method (Finite Integration Technique)[3] and staggered grid allocation zyxwvuts [4] to set. up the discrete equations. The reasons for developing "another code" to solve the static Maxwell's-equations are the requirements for an improved formulation of boundary condi- tions for FD in an unbounded domain, faster performance on large problems with the help of a MG solver, and a descrip- tion of the constant-current-driven magnetic field in a way that will avoid, or at least significantly reduce, the cancellation er- rors in the iron that result from the introduction of a scalar potential[5]. The S3 electro- and magnetostatic module exists as a sol- ver for materials with constant, anisotropic permeabilities and permittivities. A version for nonlinear materials is under deve- lopment. Boundary conditions may be Dirichlet, Neumann or 'open' ( towards an unbounded domain ). In the latter case, zyxwvuts d(F) or (optionally) &b(Tj/X will be analytically approxima- ted for each boundary point from the inner charge or constant current distribution[l].This approximation is derived from the general solution of Poisson's equation : where zyxwvutsrqponm m = zyxwvutsrqp E or p acd Q(3 = JJJp(r)d3r' or Q(3 = J Jv pl?(j, 3 . zyxwvuts d2r' and the solution The code has been checked by comparison with analytic cal- culations and the well-tested PROFI[6,7]. For electrostatics, using Dirichlet- or Neumann boundary-conditions, the agree- ment between the two codes is not surprising as the same ap- proach is used. For magnetostatics, this agreement indicates that for the noncritical linear cases our new and much simpler direct solver for the constant-current induced field[6,8] works correctly. The improvements for nonlinear high field problems will be checked after the incorporation of a nonlinear scheme, which is presently under development. The open boundary-conditions have also been checked both analytically and by measurement. These checks indicate a hig- her degree of accuracy as well as a reduction in memory re- quirements, since the meshes can be much smaller than those required with ordinary boundary conditions. Figure 1) and Figure 2) show examples used for checking the code. The calculations of the driftchamber were also a test for the open boundary condi- tions. They indicated a possible influence of a dielectric window on the internal fields. This window was added to the chamber for calibration purposes. The evaluations of this problem are still going on. The correction dipole was a well-tested problem at DESY [lo] and so is an excellent test for S3. I zyxwvutsrqponml 1 II I I ! U i zyxwvu j( I I I / . dielectric material I i ~~~ Figure 1) Forward- and rear-driftchamber of the ZEUS detec- tor,used to check the electrostatic part of the code (calcula.tions and measurements) [9] 0018-9464/90/0300-0747$01.00 0 1990 IEEE