2.2 Forward Problem
2.2.6 Numerical Algorithms and Preconditioning
whereuis the vector of the nodal potentialsuj,Uthe vector of the electrode potentialsUm
andIthe current vector. The Galerkin formulation for the Peits implementation (chapter 4) can be obtained, by proceeding accordingly with the weak formulation (2.17) as the starting point. In the following section, the resulting system of equations is simply written asAx=b.
2.2.6 Numerical Algorithms and Preconditioning
The overwhelming majority of linear systems of equations stemming from the finite element method are solved with the conjugate gradient (CG) algorithm (very well explained in Shewchuk, 1994), because they are positive-definite, square, symmetric, large and sparse. To improve the convergence of CG on large problems,preconditioningshould be used (Shewchuk, 1994). Preconditioning improves the condition number of the system matrixκ(A)of the system
Ax=b, (2.24)
by finding a symmetric, positive-definite matrixMthat approximatesA. IfMis easier to invert thanAandκ(M−1A)κ(A), then the system
M−1Ax=M−1b (2.25)
requires less CG iterations to converge than the original problem. The preconditioned CG method is then given by the algorithm
Algorithm 1Preconditioned Conjugate Gradient
k= 0,x0 =initial guess
r0=b−Ax0
d0 =M−1r0
whilestopping criterion not fulfilleddo
τk= r> kM −1r k d>kAdk xk+1=xk+τkdk rk+1=rk−τkAdk βk+1= r>k+1M−1r k+1 r> kM−1rk dk+1=M−1rk+1+βk+1dk k=k+ 1 end while
where the main difficulty is to find a preconditioner which improves the convergence well enough to make up for the cost of computingM−1rk in each iteration. The aim of such a
preconditioner is to move the eigenvalues as close together as possible. In that senseM=A would be the perfect preconditioner, but since preconditioning is only considered becauseAis difficult to invert, this is a very bad option.
A preconditioner which is very easy to invert is theJacobi preconditioner, which is a diagonal matrix with the diagonal entries ofA(i.e. the matrixAis scaled along the coordinate axes rather than along the eigenvector axes, ifM=Awere used). Jacobi preconditioning already improves the speed of CG significantly. There are, however, more efficient preconditioners.
TheCholesky decompositionis a method to representAas the product of a lower triangular matrixL and its transposeA = LL>. (LL>)−1rk is then solved by forward and back sub-
stitution. For sparse systems such as the ones from FEM implementations the full Cholesky decomposition is rarely used. Instead, anincomplete Cholesky decompositionis used as precon- ditioner. This is an approximationKsimilar toL, which can for instance be obtained by the same algorithm, but instead of storing all entries ofLonly the ones in the same position as the non-zero entries ofAare stored inK. Cholesky decomposition is generally faster than the similar LU decomposition.
Multigrid algorithmsare very effective for solving systems of discretised partial differential equations, and are based on the idea to support the convergence of the full problem by repeatedly adding a correction of the residual from a coarser version of the same problem. Intuitively this can be thought of as an iterative global communication of local errors. While high-frequency components of the residual are corrected on the fine level, the coarse level corrects for low- frequency components. This can be done in several hierarchical layers using recursion.Geometric multigrid(reviewed e.g. in Wesseling and Oosterlee, 2001) constructs several coarse grids based on the fine grid. Then the correction terms are computed using discrete systems constructed on these coarse grids. However, the construction of coarse grids can be difficult if the fine grid is unstructured and the underlying geometry is complicated. For these reasonsalgebraic multigrid methods (reviewed in Stüben, 2001) have been developed, which construct the coarser levels directly from the system matrix. This makes AMG very easy to use, as it can be applied to any discretised system without having to supply geometric informations. Forl = 1, ..., L levels
Al=PTl−1Al−1Pl−1with theprolongation matrix Pl−1, a basic multigrid algorithm takes the
Algorithm 2Basic Multigrid Method
Perform some pre-smoothing iterations onAlxl=bl
Restrict the residual to a coarser level: bl+1=PTl (bl−Alxl)
ifl+ 1 =Lthen
SolveAl+1xl+1=bl+1with a direct method
else
Set the initial guessxl+1= 0
Recursively call the Multigrid Algorithm:xl+1= MG(xl+1,bl+1)
end if
Prolongxl+1and add toxl:xl=xl+Plxl+1
Perform some post-smoothing iterations onAlxl=bl
The pre- and post-smoothing iterations are also calledrelaxation steps. By reducing the tolerance of the MG algorithm, it can be used as a very efficient preconditioner for iterative Krylov subspace methods such as CG. Two fast and parallel implementations of AMG are BoomerAMG from Hypre (Henson and Yang, 2002) and ML from Trilinos (Tuminaro and Tong, 2000).