multi grid methodscsip/csip2007-mg.pdf tuesday, june 26, 2007 1

22
Multi-Grid Methods Press et al., Numerical Recipes in C, Section 19.6 http://www.nrbook.com/a/bookcpdf.php A Multigrid Tutorial, http://www.llnl.gov/casc/people/henson/mgtut/welcome.html 1 Tuesday, June 26, 2007

Upload: others

Post on 19-Apr-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Multi-Grid Methods

Press et al., “Numerical Recipes in C”, Section 19.6http://www.nrbook.com/a/bookcpdf.php

A Multigrid Tutorial, http://www.llnl.gov/casc/people/henson/mgtut/welcome.html

1Tuesday, June 26, 2007

Page 2: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Multi-Grid Methods

• Introduced by Achi Brandt, “Multi-Level Adaptive Solutions to Boundary Value Problems”, Math. Comp. 1977

• Solve elliptic PDEs (such as the Poisson equation) on N grid points in O(N)

• General framework, whose components must be adjusted to solve specific problems

2Tuesday, June 26, 2007

Page 3: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Motivation• Large sparse linear systems might converge

slowly using standard iterative relaxation methods (such as Jacobi, Gauss-Seidel).

3Tuesday, June 26, 2007

Page 4: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

ExampleAu = 0, ui−1−2ui +ui+1 = 0

21 of 119

0 0 . 1 0 . 2 0 . 3 0 . 4 0 . 5 0 . 6 0 . 7 0 . 8 0 . 9 1

- 1

- 0 . 8

- 0 . 6

- 0 . 4

- 0 . 2

0

0 . 2

0 . 4

0 . 6

0 . 8

1

Numerical Experiments• Solve ,

• Use Fourier modes as initial iterate, with N =64:

uA = 0 =!+! uuuiii +! 11

02

vk!"#

"$%&

=)(=N

kiv

kinis 1111 !##,!## NkNi

component mode

k = 3

k = 1

k = 6

23 of 119

0 20 40 6 0 8 0 1 00 1 20

0

0 .1

0 .2

0 .3

0 .4

0 .5

0 .6

0 .7

0 .8

0 .9

1

Convergence rates differ fordifferent error components

• Error, ||e||!!!! , in weighted Jacobi on Au = 0 for100 iterations using initial guesses of v1, v3, and v6

k = 1

k = 3

k = 6

4Tuesday, June 26, 2007

Page 5: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Multi-Grid

• Many relaxation schemes have the smoothing property, where oscillatory modes of the error are eliminated effectively, but smooth modes are damped very slowly!

• Idea: use a sequence of progressively coarser grids in order to quickly get rid of smooth (low-frequency) errors!

5Tuesday, June 26, 2007

Page 6: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Two-Grid Case

• Linear elliptic problem:

• Discretized on a uniform grid with spacing h between grid points:

• Let be an approximate solution.

• Error/correction:

• Residual/defect:

L u = f

Lhuh = fh

uh

vh = uh− uh

dh = Lhuh− fh

6Tuesday, June 26, 2007

Page 7: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Use the result to approximate the correction, and correct the fine grid solution!

Two-Grid Case (continued)

Error may be computed by solving: Lhvh =−dh

Idea: use a coarser grid to solve: LHvH =−dH

unewh = uh + vh

dh = Lhuh− fh

= Lh (uh− vh)− fh

= Lhuh−Lhvh− fh =−Lhvh

7Tuesday, June 26, 2007

Page 8: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Two-Grid Case (continued)

How do we switch between coarse and fine grids?

Need to define two linear operators:• Restriction/injection/fine-to-coarse operator R• Prolongation/interpolation/coarse-to-fine

operator PdH = Rdh

vh = PvH

8Tuesday, June 26, 2007

Page 9: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Two-Grid Case (summary)

Iterate until convergence:

• Relaxation/smoothing on the fine grid

• Compute the defect on fine grid

• Restrict defect to coarse grid

• Solve the coarse problem

• Interpolate the correction to fine grid

• Apply correction to get a new approximation

dh = Lhuh− fh

dH = Rdh

vh = PvH

LHvH =−dH

unewh = uh + vh

9Tuesday, June 26, 2007

Page 10: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Relaxation / SmoothingRelaxation (smoothing) operator: typically a few iterations of Gauss-Seidel:

ui =− 1Lii

(

∑j "=i

Lij u j− fi

)i = 1, . . . ,N

10Tuesday, June 26, 2007

Page 11: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Relaxation / Smoothing

11Tuesday, June 26, 2007

Page 12: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Prolongation

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

Prolongation operator in 1D: typically linear interpolation.

Specified by the following stencil (symbol):[1/2 1 1/2

]

12Tuesday, June 26, 2007

Page 13: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

ExampleThe prolongation operator, written in matrix form (in 1D, for interpolating 3 variables into 7):

1/21

1/2 1/21

1/2 1/21

1/2

7×3

vH,1vH,2vH,3

=

vh,1vh,2vh,3vh,4vh,5vh,6vh,7

13Tuesday, June 26, 2007

Page 14: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Prolongation in 2DProlongation operator in 2D: typically bi-linear interpolation.

0.25 0.5 0.250.5 1 0.5

0.25 0.5 0.25

Specified by the following stencil (symbol), on a 2D grid:

14Tuesday, June 26, 2007

Page 15: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Restriction

Simplest operator: straight injection [1]

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

=

15Tuesday, June 26, 2007

Page 16: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Restriction

Another operator: 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

=

[1/4 1/2 1/4]

16Tuesday, June 26, 2007

Page 17: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

ExampleThe restriction operator, written in matrix form (in 1D, for restricting 7 variables into 3):

1/4 1/2 1/4

1/4 1/2 1/41/4 1/2 1/4

3×7

vh,1vh,2vh,3vh,4vh,5vh,6vh,7

=

vH,1vH,2vH,3

17Tuesday, June 26, 2007

Page 18: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Restriction in 2D

Simplest operator: straight injection [1]

Other choices:

Full weighting

Half weighting

1/16 1/8 1/161/8 1/4 1/8

1/16 1/8 1/16

0 1/8 0

1/8 1/2 1/80 1/8 0

18Tuesday, June 26, 2007

Page 19: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Prolongation & Restriction

12

121 1

21 1

21

P cPT

14

1 2 1

1 2 11 2 1

19Tuesday, June 26, 2007

Page 20: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Operator Coarsification

• Discretize the continuous linear operator on progressively coarser grids

• Use the prolongation/restriction operators:LH = RLh P

or

20Tuesday, June 26, 2007

Page 21: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Cycle Strategies: V and W

21Tuesday, June 26, 2007

Page 22: Multi Grid Methodscsip/CSIP2007-MG.pdf Tuesday, June 26, 2007 1

Cycle Strategies: FMG

22Tuesday, June 26, 2007