• No results found

4.2 Iterative Methods for Linear Systems

4.2.4 Multigrid Methods

4.2.4.1 Geometric Multigrid (GMG)

Multigrid methods are motivated by a couple of basic considerations: first, many iterative methods have a strong error smoothing effect if they are employed for discrete elliptic (and parabolic) problems, and second, the smooth error can be well expressed on the coarser grid where its approximation is computationally cheaper. In this subsection, we will introduce some common notation and describe the linear GMG method. We first introduce the discrete problems on the fine grid (which we refer to here as grid L, see below) such that

ALuL= bL, (4.14)

Chapter 4. Solution Algorithms for Algebraic Systems 38

Algorithm 1 Linear Geometric Multigrid GMG V-cycle Function vL= LMG V-cycle (AL, vL, bL, L)

1: Update the solution vL by applying ν1 iterations of the selected smoother on the fine grid (Pre-smoother)

2: Calculate the residual, rL= bL− ALvL

3: Restrict the residual, rL−1 = ILL−1(rL)

4: Set the initial guess eL−1 to be 0

5: if (L− 1 = Lmin) then Solve the problem on the coarsest grid (AL−1eL−1= rL−1)

6: elseeL−1= LMG V-cycle (AL−1, eL−1, rL−1, L− 1)

7: Interpolate the erroreL−1 from coarse grid to fine grid eL= IL−1L (eL−1)

8: Calculate the correction vL= vL+ eL

9: Update the solution vL by applying ν2 iterations of the selected smoother on the fine grid (Post-smoother)

Grid level 1 Grid level 2 Grid level 3 Grid level 4 Finest grid

Coarsest grid

x y

Figure 4.2: An illustration of the geometric multigrid grid hierarchy using four grid levels in two dimensions.

39 4.2. Iterative Methods for Linear Systems

where ALis the coefficient matrix, uLis the exact solution vector to the system of equations, bL is the vector of the right-hand side, and the superscript L indicates the fine grid (or level). We seek vL which indicates an approximate solution to the system of equations. The error eL, is the difference between the true solution uL and the approximate solution vL, and is given by

eL= uL− vL. (4.15)

We will then compute the residual (or defect) rL on the fine grid which is defined as follows:

rL= bL− ALvL, (4.16)

and satisfies the error equation as follows,

ALeL= rL. (4.17)

Importantly, the residual rLmay be computed, however, the error eLis usually unknown. Note that the relation between the error and the residual in the linear multigrid, can be recognized from:

ALeL= AL(uL− vL)

= ALuL− ALvL

= bL− ALvL

= rL.

(4.18)

In a GMG we use a sequence (ΩL) of finite-dimensional (coarser) grids such that

L−1 ⊂ ΩL, L = 2, ..., J, (4.19)

where ΩJ is the finest grid, on which the solution is desired. Hence, we choose the grids such that they form a hierarchy

1⊂ Ω2⊂ Ω3⊂ ... ⊂ ΩJ. (4.20)

Let VL represent the sequence of finite-dimensional function spaces which can be represented on grid ΩL: then

V1⊂ V2⊂ V3⊂ ... ⊂ VJ, (4.21)

where each VL, L = 1, ..., J is defined by grid ΩL. We consider the discretised system of equations (4.14). To develop a linear multigrid V-cycle recursively, we apply two operators to move functions between the different function spaces. These operators are the restriction operator ILL−1, and interpolation (or prolongation) operator IL−1L , where the subscripts and

Chapter 4. Solution Algorithms for Algebraic Systems 40

superscripts L and L− 1 indicate the fine and coarse level, respectively:

ILL−1: VL→ VL−1, L = 2, . . . , J, (4.22) IL−1L : VL−1 → VL, L = 2, . . . , J. (4.23) We want to solve the problem (4.14) on grid ΩL, when L 6= 1 for the exact discrete solution uL ∈ VL. After a number of iterations of linear geometric multigrid has been implemented;

we obtain vL∈ VLwhich is the approximate solution to the exact solution uL. We can obtain the error approximation eL−1 via the error Equation (4.17) but on a coarser grid. To solve the problem

AL−1eL−1 = rL−1 (4.24)

is much less expensive than on the fine level L. There are two ways of forming the matrix AL−1 which are: to discretize the PDEs on the coarse grid (which is what we are doing in this thesis) or to use Galerkin projection approach as described in [28, 130, 137]. We then compute an updated approximation of v as follows:

vupdate = vL + IL−1L eL−1.

This is an exact coarse grid correction, where vL denotes the approximation to (4.14) on grid ΩL, and eL−1 denotes the exact solution to the residual equation on grid ΩL−1. If there are only two grids in the hierarchy, in this case, the coarse grid problem will be solved exactly (though its interpolation onto the fine grid will not be exactly eL). The linear geometric multi-grid algorithm (Algorithm 1) does not solve the error Equation (4.24) exactly, however, instead it computes an approximate update to the solution on the fine grid by recursively solving the coarse grid equation by the same linear multigrid algorithm. Figure 4.2 displays a hierarchy of four uniform grids in 2D, where the coarsest grid is grid level 1 and the finest grid is grid level 4.

Now we discuss the linear multigrid method in more detail, where the superscripts L and L− 1 indicate here the fine and coarse level respectively. We must define three operators on the grid as part of our MG algorithm: restriction, interpolation and smoothing. ILL−1 denotes the restriction operator. We choose the full weighting operator in two-dimensions as a restriction operator from [28] given by

vL−1i,j = 1

16[vL2i−1,2j−1+ vL2i−1,2j+1+ vL2i+1,2j−1+ vL2i+1,2j+1

+ 2 (vL2i,2j−1+ vL2i,2j+1+ v2i−1,2jL + v2i+1,2jL ) + 4 v2i,2jL ],

(4.25)

for 1 ≤ i, j ≤ n2 − 1. The interpolation (or prolongation) operator IL−1L transfers the error approximation eL−1 from the coarse grid to the fine grid, where IL−1L vL−1 = vL. We consider

41 4.2. Iterative Methods for Linear Systems

here the linear interpolation operator in two-dimensions given by v2i,2jL = vi,jL−1,

vL2i+1,2j= 1

2(vi,jL−1+ vi+1,jL−1 ) vL2i,2j+1= 1

2(vi,jL−1+ vi,j+1L−1 ) vL2i+1,2j+1= 1

4(vi,jL−1+ vi+1,jL−1 + vi,j+1L−1 + vL−1i+1,j+1),

(4.26)

where 0≤ i, j ≤ n2 − 1.

Several standard iterative (relaxation) methods, such as the weighted Jacobi, the Gauss-Seidel and the weighted Red-Black-Gauss-Seidel methods, have the smoothing property, which is very important for the multigrid methods as we have mentioned earlier. We can state that it-erative methods possess the smoothing property if these methods are effective at reducing high-frequency components of the error. The purpose of smoothing is to allow the numerical resulting iteration error to be approximated well on a coarser grid. According to reference [47], a formal definition of smoothing property is:

k A (I − P−1A)kxk ≤ η(k) k x kA with η(k) −→ 0 as k −→ ∞, (4.27) for all vectors x ∈ Rn, where k x kA= (x, x)A12 =k xTA x k2, η must be independent of the grid size and P is the preconditioning which is approximate the coefficient matrix A which we will discuss in Subsection 4.2.5.4. In practice, these means that we can obtain a substantial decrease of the high-frequency components of the error by applying a few sweeps of these iter-ative methods on the fine grid (cf [16, 17, 28, 130]).

We have to use a number ν of smoothing steps before and after the coarse grid correction step; it is not necessary for the number of steps before and after to be the same number. We implement ν1 steps of an iterative smoothing method on the fine grid (pre-smoothing step), calculate the residual of the current fine grid approximation, and then restrict the residual to the coarse grid with the restriction operator ILL−1. We then solve the coarse grid residual equation (or approximately solve it using a recursive call). Next, we interpolate the correction applying a prolongation (interpolation) operator IL−1L for the error to the fine grid, then add the interpolated correction to the current fine grid approximation (coarse grid correction step).

We implement ν2steps of an iterative method on the fine grid (post-smoothing step). One MG iteration (V-cycle) of the linear geometric multigrid algorithm is described in Algorithm 1. This iteration can be repeated until a suitable norm of the residual is achieved, or a user-defined stopping criterion is satisfied.

Obtaining an optimal efficiency may be problem dependent but it is often the case that these

Chapter 4. Solution Algorithms for Algebraic Systems 42

procedures converge well. Such V-cycle procedures involve exact solutions on the coarsest grid, with the application of a suitable smoother on each fine grid (cf [16, 17, 28, 111, 138, 145]).

One essential merit for multigrid methods is that the number of V-cycles that are required for convergence is independent of the fine mesh level J. Hence, the V-cycle represented in Algorithm 1 can be repeated until a user-defined stopping criterion is met, usually a suitable norm of the residual. In the following subsection, we describe multigrid cycle strategies in more detail.