24
Introduction to Multigrid Methods J.-F. Remacle Universit´ e catholique de Louvain 1

meca2300-lecture4

Embed Size (px)

DESCRIPTION

lecture

Citation preview

Page 1: meca2300-lecture4

Introduction to Multigrid Methods

J.-F. Remacle

Universite catholique de Louvain

1

Page 2: meca2300-lecture4

Suggested readings

• Briggs, “A Multigrid Tutorial,” SIAM publications, 1987.

• Briggs, Henson, and McCormick, “A Multigrid Tutorial, 2nd Edi-

tion,” SIAM publications, 2000.

• Hackbusch, “Multi-Grid Methods and Applications,” 1985.

• Hackbusch and Trottenburg, “Multigrid Methods, Springer- Ver-

lag, 1982”

• Stuben and Trottenburg, “Multigrid Methods,” 1987.

• Wesseling, “An Introduction to Multigrid Methods,” Wylie, 1992

2

Page 3: meca2300-lecture4

First observation toward multigrid

Many relaxation schemes have the smoothing property, where oscilla-tory modes of the error are eliminated effectively, but smooth modesare damped very slowly.

35 of 119

Weighted Jacobi RelaxationSmooths the Error

• Initial error:

• Error after 35 iteration sweeps:

0 0 . 5 1

- 2

- 1

0

1

2

0 0 . 5 1

- 2

- 1

0

1

2

Many relaxationschemes

have the smoothingproperty, where

oscillatorymodes of the error

areeliminated

effectively, butsmooth modes are

dampedvery slowly.

N

j

N

j

N

jv jk

!"#

!$%&

+!"#

!$%&

+!"#

!$%&

=23

nis2

161

nis2

12

nis

3

Page 4: meca2300-lecture4

Reason 1 for using coarse grids: Nested Iteration

This might seem like a limitation, but by using coarse grids we can

use the smoothing property to good advantage

Coarse grids can be used to compute an improved initial guess for the

fine-grid relaxation. This is advantageous because:

• Relaxation on the coarse-grid is much cheaper (1/2 as many points

in 1D, 1/4 in 2D, 1/8 in 3D)

• Relaxation on the coarse grid has a marginally better convergence

rate.

4

Page 5: meca2300-lecture4

Idea !: Nested Iteration

. . .

Relax on A4hu4h = b4h to obtain initial guess v2h

Relax on A2hu2h = b2h to obtain initial guess vh

Relax on Ahuh = bh to obtain ... final solution ?

Question 1: what is A4hu4h = b4h ?

Question 2: what if error has smooth components when on the final

grid ?

5

Page 6: meca2300-lecture4

Reason 2 for using coarse grids: smooth error on a

fine grid is relatively more oscillatory on coarse grid

On the coarse grid, the smooth error appears to be relatively higher

in frequency.

Relaxation will be more effective on this mode if done on the coarser

grid!!

whk,2j = sin(

2jkπ

N

)= sin

(jkπ

N/2

)= w2h

k,j.

For k = 1,2, . . . , N/2, the kth mode is preserved (still alive) on the

coarse grid.

whN/2 = 0.

For k > N/2, whk is invisible on the coarse grid (aliasing). It appears

as the N − kth mode on the coarse grid

whk,2j = sin(

2jπk

N

)= − sin

(2jπ(N − k)

N

)= −w2h

N−k,j.

6

Page 7: meca2300-lecture4

Multigrid Methods

41 of 119

Reason #2 for using a coarsegrid: smooth error is (relatively)

more oscillatory there!

• A smooth function:

• Can be represented by linearinterpolation from a coarser grid:

0 0 . 5 1- 1

- 0 . 5

0

0 . 5

1

0 0 . 5 1- 1

- 0 . 5

0

0 . 5

1

On the coarse grid, the smooth error appears tobe relatively higher in

frequency: in the exampleit is the 4-mode, out ofa possible 16, on the finegrid, 1/4 the way up thespectrum. On the coarse grid, it is the 4-mode outof a possible 8, hence itis 1/2 the way up the

spectrum.

Relaxation will be moreeffective on this mode ifdone on the coarser grid!!

7

Page 8: meca2300-lecture4

Aliasing

43 of 119

For k > N/2, wkh is invisible on

the coarse grid: aliasing!!

• For k > N/2, the kth mode onthe fine grid is aliased andappears as the (N-k)th modeon the coarse grid:

0 2 4 6 8 1 0 1 2

- 1

- 0 . 8

- 0 . 6

- 0 . 4

- 0 . 2

0

0 . 2

0 . 4

0 . 6

0 . 8

1

0 1 2 3 4 5 6

- 1

- 0 . 8

- 0 . 6

- 0 . 4

- 0 . 2

0

0 . 2

0 . 4

0 . 6

0 . 8

1!"#

)!("$%&

!=2

nisN

kNj

!"#

")($%&

=)(N

kjw

j

hk

2

2nis

!"#/

)!("$%&

!=2

nisN

jkN

)(!= w hkN !

2

k=9 mode, N=12 grid

k=3 mode, N=12 grid

8

Page 9: meca2300-lecture4

Multigrid Methods

Smooth errors can be approximated on coarser grids and seen as more

oscillatory. Relaxation schemes are able to get those.

Non smooth errors are not seen on coarser grids and cannot therefore

be killed there.

The residual correction idea: Let v be an approximation to the solution

of Au = b, where the residual r = b − Av. The the error e = u − vsatisfies

Ae = r.

After relaxing on Au = b on the fine grid, the error will be smooth.

On the coarse grid, however, this error appears more oscillatory, and

relaxation will be more effective.

Therefore we go to a coarse grid and relax on the residual equation

Ae = r, with an initial guess of e = 0.

9

Page 10: meca2300-lecture4

Coarse-grid correction

Relax on Ahuh = bh to obtain an approximation vh,

Compute rh = Ahvh − bh

Compute r2h = I2hh r2h

Relax on A2he2h = r2h to obtain an approximation to the error e2h,

Correct the approximation vh = vh + Ih2heh2.

Clearly, we have to define the mappings I2hh and Ih2h.

10

Page 11: meca2300-lecture4

Prolongation

Prolongation operator: the mapping from the coarse grid to the fine

grid Ih2h.

Example: values at points on the coarse grid map unchanged to the

fine grid and values at fine-grid points NOT on the coarse grid are the

averages of their coarse-grid neighbors.

47 of 119

1D Interpolation (Prolongation)

!h

!2h

• Values at points on the coarse grid map unchangedto the fine grid

• Values at fine-grid points NOT on the coarse grid

are the averages of their coarse-grid neighbors

11

Page 12: meca2300-lecture4

Prolongation

Example, linear interpolation, N = 7,

Ih2h =

1/2 0 01 0 0

1/2 1/2 00 1 00 1/2 1/20 0 10 0 1/2

Ih2h has full rank.

12

Page 13: meca2300-lecture4

Restriction

Restriction operator: the mapping from the fine grid to the coarse

grid I2hh .

Example, restriction by injection:

52 of 119

1D Restriction by injection• Mapping from the fine grid to the coarse grid:

• Let , be defined on , . Then

where .

vh v2h !h!

2h

vv hi

hi 22 =

Ihhh

h

22!"!:

vvI hhh

h22

=

13

Page 14: meca2300-lecture4

Restriction, full weighting

53 of 119

1D Restriction by full-weighting

• Let , be defined on , . Then

where

vh v2h !h

!2h

vvvv hi

hi

hi

hi 122122 )++(= 2

4

1

+"

vvI hhh

h22

=

I2hh =

1

4

1 2 1 0 0 0 00 0 1 2 1 0 00 0 0 0 1 2 1

=1

2

(Ih2h

)T.

14

Page 15: meca2300-lecture4

Multigrid Methods

Now, let’s put all these ideas together

- Nested Iteration (effective on smooth error modes)

- Relaxation (effective on oscillatory error modes)

- Residual equation (i.e., residual correction)

- Prolongation and Restriction

15

Page 16: meca2300-lecture4

Multigrid Methods

First, do some smoothing sweeps to anihilate high frequency terms of

the error. Let S be our smoother:

x 7→ Sx.

We aim at solving

Ahuh = bh

the h subscript being related to the grid size. We start with u0h. and

apply ν times the smoothing procedure:

uh = Sνukh

After the application of a few smoothing sweeps, we obtain an ap-

proximation uh whose error eh = uh − uh is smooth. Then eh can be

approximated on a coarser space.

16

Page 17: meca2300-lecture4

The 2-Grid Scheme, start with u(0)h

1. Pre-smoothing steps: u(l)h = Su(l−1)

h , l = 1, . . . , ν1

2. Compute the residual: rh = bh −Ahu(ν1)h

3. Restriction of the residual: rH = IHh rh

4. Solution of the coarse grid problem: eH = (AH)−1rH

5. Coarse grid correction: u(ν1+1)h = u

(ν1)h + IhHeH

6. Post-smoothing steps: u(l)h = Su(l−1)

h , l = ν1 + 2, . . . , ν1 + ν2 + 1.

17

Page 18: meca2300-lecture4

Coarse-grid Correction

60 of 119

Coarse-grid Correction

Relax on fuAhhh

=uAfr hhhh !=Compute

rIr22 hhh

h =

Restrict

Solve reA 222 hhh=

rAe 2122 hhh )(=!

Correct

eIe hhh

h " 22

Interpolate

euu hhh +#

18

Page 19: meca2300-lecture4

The 2-Grid Scheme

Property: The iteration matrix of the 2-grid scheme is

GTG = Sν2h

(Ih − IhH(AH)−1IHh Ah

)Sν1h .

where Ih is the identity matrix and Sh is the smoothing iteration matrix.

This property is straightforward to demonstrate.

For the model problem, it is possible to estimate the spectral radius

of GTG.

Consider the damped Jacobi smoother with ω = 1/2. Assume that

IhH is piecewise linear interpolation, and IHh is restriction by weighting

such that

(rH)i,j =(rh)i−1,j + (rh)i+1,j + (rh)i,j−1 + (rh)i,j+1 + 4(rh)i,j

8,

for i, j = 2,4,6, . . . .

19

Page 20: meca2300-lecture4

The 2-Grid Scheme

In this case the following theorem is proved using discrete Fourier anal-

ysis in W. Hackbusch, Multi-Grid Methods and Applications. Springer-

Verlag, Heidelberg, 1985.

Property: Let the 2-Grid scheme with ν = ν1 + ν2 ≥ 1 The spectral

radius of the iteration matrix GMT is bounded by

ρ(GMT ) ≤ max{ξ(1− ξ)ν + (1− ξ)ξν, 0 ≤ ξ ≤ 1/2}

Obviously, ρ(GMT ) < 1 so that the iteration is globally convergent.

20

Page 21: meca2300-lecture4

The Multi-Grid Scheme

In the 2-Grid scheme, the size of the coarse grid is twice larger than

the fine one.

The coarse problem has the same form as the residual problem on the

fine level.

Therefore one can use the 2-Grid method to determine eH of

AH eH = rH .

So we can introduce a further coarse-grid problem and this process

can be repeated recursively until a coarsest grid is reached where the

corresponding residual equation is inexpensive to solve.

This is, roughly speaking, the qualitative description of the Multi-Grid

method.

21

Page 22: meca2300-lecture4

The Multi-Grid Scheme

62 of 119

How do we “solve” the coarse-grid residual equation? Recursion!

uIe hhh

h! 22

uIe 42

42 hh

hh!

uIe 84

84 hh

hh!

fAGuhhh ),(!

"

fAGu222 hhh ),(!

"

fAGu444 hhh ),(!

"

fAGu888 hhh ),(!

"

uAfIf22 hhhhh

h)#(!

uAfIf 2224

2

4 hhhhh

h)#(!

uAfIf 4448

4

8 hhhhh

h)#(!

euu 888 hhh +!

euu 444 hhh +!

euu 222 hhh +!

euu hhh +!

fAeHHH )(=

#1

22

Page 23: meca2300-lecture4

The Multi-Grid Scheme for solving Akuk = bk1. If k = 1 solve uk = A−1

k bk directly

2. Pre-smoothing steps: u(l)k = Su(l−1)

k , l = 1, . . . , ν1

3. Compute the residual: rk = bk −Aku(ν1)k

4. Restriction of the residual: rk−1 = Ik−1k rk

5. Set uk−1 = 0

6. Call µ times the Multi-Grid scheme to solve Ak−1uk−1 = bk−1

7. Coarse grid correction: u(ν1+1)k = u

(ν1)k + Ikk−1uk−1

8. Post-smoothing steps: u(l)k = Su(l−1)

k , l = ν1 + 2, . . . , ν1 + ν2 + 1.

23

Page 24: meca2300-lecture4

The Multi-Grid Scheme for solving Akuk = bk

The number µ refers to the cycling strategy.

Typical values: µ = 1 (V cycle) and µ = 2 (W cycle).

24