Astron. Astrophys. 350, 1051-1059 (1999)

## 4. A vector potential formulation

### 4.1. Gauge for fixed on

To ensure that is divergence free (Eq. (2)) we use the vector potential representation for . Since in BVP (10)-(12) is fixed, the vector potential should be determined such that

This representation is not yet unique, since if is a potential for then:

where is an arbitrary scalar function, is also a vector potential for . Uniqueness is obtained by the choice of a particular gauge. There are several possible choices (Dautray & Lions 1982), but these do not in general take into account Eq. (11) (one well known choice is for example and ).

Our gauge is fixed by imposing that is the unique vector potential such that :

where the subscript t in stands for the trace (when it exists) of the operator or the field on the boundary (in particular in cartesian coordinates: on the plane with and standing for the unit vector normal to the current boundary plane ). Note also that one readily gets:

where . The proof that is unique is straightforward since from Eqs. (20)-(23) one gets that is the unique solution of a Laplace equation:

(note that is also obtained once solving a Laplace equation on , and is also unique once is prescribed on the border of the boundary ).

Then with this choice of Gauge, is the unique vector potential that satisfies:

where is the operator defined on such that (i.e., ) and where is the unique solution of

where is the Laplacian operator on (i.e., )

### 4.2. BVP for

One can then rewrite BVP(10)-((12) in terms of the potential vector that is then the unique solution of the following BVP (referred to hereafter as BVP-A):

and

The solution of the linear elliptic mixed Dirichlet-Neumann BVP is in general regular .

One can then prove that:

Proof: Applying the operator to both sides of Eq. (37) and using Eq. (2) for , one gets:

Whence is the unique solution tending to zero at infinity for this BVP. Note that since the initial potential magnetic field clearly satisfies (where stands for the associated electric current), this property is preserved for all .

### 4.3. A two-level iteration procedure

Let us define the sequence and the mononotic increasing sequence such that:

where is a `'small enough" real number, and P is a `'large enough" integer.

One can then generate a more general sequence of linear BVP for given by:

and

One may initialize the iteration procedure for , with the unique solution of BVP(13)-(15) (which would be equivalent to choose ). A possible choice for is for P given:

One clearly notices that for every value of p one needs to solve a sequence of linear BVPs for all . This corresponds to a progressive injection of at the boundary which turns out to improve convergence of the classical Grad-Rubin scheme.

### 4.4. Numerical implementation

We have developed a code called EXTRAPOL, based on the method described in the previous sections.

• i) The computational domain is supposed to be the bounded cubic box (instead of the infinite upper half space), that we discretize as using a non-uniform structured mesh for finite difference approximation. This staggered mesh used for the the various components of the vector potential , the magnetic field and , is the same as the one used in our MHD code METEOSOL used for three-dimensional dynamic evolution (Amari et al. 1996).

• ii) We use as a boundary condition for BVP (37)-(40) on the lateral and top boundaries of the box, , which owing to our gauge choice (Eqs. (22)-23)) is equivalent to impose on these boundaries:

This type of boundary conditions, whose aim is to mimic the far field behaviour at infinity (as one would expect for the magnetic field in the actual infinite half-space), implies that the top and lateral boundaries of the box have to be chosen sufficiently far away from the main region of interest. This can be achieved at relatively low cost since our mesh is not uniform, and therefore large cells can be put in the far-field region.
• iii) The various differential operators (Eqs. (47)-(53)) are then dicretized on this mesh to second order accuracy. The Laplacian operator (in the Dirichlet-Neuman BVP (50)-(53)) leads to a 7 diagonal sparse positive definite matrix. The corresponding linear system is solved by use of an iterative method, in which the matrix is not stored but the matrix-vector product is generated explicitly by the operator (and only one more array is stored for building a preconditioner to accelerate the convergence of the method). This memory space saving allows the method to be implemented on a workstation with reasonable central memory size, and not only on supercomputers. We actually run the code on both machine types although the results presented here correspond to runs performed on a CRAY C90 machine.

• iv) The numerical solution of Eqs. (47)-(49) is performed by using a characteristics method approach, since those curves are the field lines. Let be the characteristics, solution of

for given in (the prime symbol standing for differentiation with respect to the parameter that runs along the characteristics). Then for any node on which is defined, one gets as

where is the intersection of with . Since is known at the nodes that do not in general coincide with , an interpolation from its four nearest neighbors eventually gives . We have then derived two methods: a) In the first one, once a step is chosen for field line integration, one goes backwards along the characteristics using a second order predictor-corrector scheme. Clearly one can save computation time by avoiding going back up to . This is achieved by marking the nodes in the domain where has already been computed, and then linearly interpolating from its nearest neighbors as soon as the current node is surrounded by such marked nodes. b) In a second method (Pironneau 1988) one avoids fixing a step by using a slightly less accurate scheme that consists in going backwards along the characteristics following the faces of each cubic cell that is centered on an -node, approximating the characteristic curve by a polygonal line made of the segments where and is the intersection of the line with the boundary of the cubic -cell that contains and (with ). This method is then faster than the previous one since there is no step size to be fixed a priori. Unlike for the first method, in a non-uniform mesh, each cell is crossed in `one step' only, which makes this method faster in the big cells region. Despite this difference in the computational speed we have kept the two methods available because of their slight accuracy difference.

© European Southern Observatory (ESO) 1999

Online publication: October 14, 1999