mutigrid methods for solving differential equations ferien akademie 05 – veselin dikov
TRANSCRIPT
Mutigrid Methods for Solving Differential Equations
Ferien Akademie ’05 – Veselin Dikov
Multigrid Methods
Ferien Akademie ’05 Veselin Dikov
Agenda
● Model problem
● Relaxation. Smoothing property
● Elements of Multigrid
● Multigrid schemes
Multigrid Methods Model Problem
Ferien Akademie ’05 Veselin Dikov
0)1()0(
0,10),()()("
uu
xxfxuxu
● Discretization in n points, step h = 1/n
● 1D boundary problem of steady state temperature a long a uniform rod
0
,11,2
0
2
11
n
jjjjj
vv
njfvh
vvv
Multigrid Methods Model Problem
Ferien Akademie ’05 Veselin Dikov
● Stencil notation
● Av = f, where
2
2
2
2
21
1..
...
121
12
1
h
h
h
hA
)121(1 2
2 h
hA
Tnvvv 11 ,..., Tnfff 11 ,..., and
● A is Symmetric positive definite
Multigrid Methods
Ferien Akademie ’05 Veselin Dikov
Agenda
● Model problem
● Relaxation. Smoothing property
● Elements of Multigrid
● Multigrid schemes
Multigrid Methods Iterative Methods
Ferien Akademie ’05 Veselin Dikov
● Jacobi and Gauss-Seidel methods
● Iterative vs Direct methods
● Smoothing property
More about iterative methods
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Error along the domain
After 35 sweeps with weighted Jacobi
Error was smoothed
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Smoothing property explained in four steps
1. Fourier modes
11,0,sin,
nknjn
jkv jk
● k – wave number
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Smoothing property explained in four steps
1. Fourier modes
k = 1 k = 2
k = 7 k = 12
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Smoothing property explained in four steps
1. Fourier modes
● smooth modes - 2
1n
k
● oscillatory modes - 12
nkn
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Smoothing property explained in four steps
1. Fourier modes
● f = 0, σ = 0 Au = 0
2. Modified model problem
● exact solution: u = 0
● error: e = u – v = -v
we can trace the error!
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Smoothing property explained in four steps
1. Fourier modes
2. Modified model problem
● wJacobi step
3. Weighted Jacobi relaxation
cvRv kk )()1(
● error )0()( eRe mm
21
1..
...
121
12
22
IAIR
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Smoothing property explained in four steps
1. Fourier modes
2. Modified model problem
● we relax with wJacobi with ω = 2/3 on initial guesses respectively:
3. Weighted Jacobi relaxation
6)0(
3)0(
1)0( , vvandvvvv
4. Three experiments
e
# iterations
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Smoothing property explained in four steps
1. Fourier modes
2. Modified model problem
● repeat the experiment with:
ω = 2/3 and initial guess
3. Weighted Jacobi relaxation
631)0(
2
1
2
1vvvv
4. Three experiments
e
# iterations
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Smoothing property explained in four steps
1. Fourier modes
2. Modified model problem
3. Weighted Jacobi relaxation
4. Three experiments● Explanation
● Rω has the same eigenvectors as A and they are the same as the wave vectors
● Recall that for the error e(m) = Rme(0)
● Eigenvalues of Rω ?
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Smoothing property explained in four steps
1. Fourier modes
2. Modified model problem
3. Weighted Jacobi relaxation
4. Three experiments● Explanation
wavenumber k
Eig
enva
lue
Multigrid Methods Smoothing Property
Ferien Akademie ’05 Veselin Dikov
● Smoothing property explained in four steps
1. Fourier modes
2. Modified model problem
3. Weighted Jacobi relaxation
4. Three experiments● Explanation● Smoothing property
● Fast damping of oscillatory error modes
● Common for all iterative methods
● How to overcome the bad performance effect over smooth error modes?
Multigrid Methods
Ferien Akademie ’05 Veselin Dikov
Agenda
● Model problem
● Relaxation. Smoothing property
● Elements of Multigrid
● Multigrid schemes
Multigrid Methods Elements of Multigrid
Ferien Akademie ’05 Veselin Dikov
● Element I: A smooth wave looks more oscillatory on a coarser grid
● Aliasing: k looks like (n-k)
Multigrid Methods Elements of Multigrid
Ferien Akademie ’05 Veselin Dikov
● Element II: Nested Iterations
coarsest grid
finest grid
Relax
Relax
Relax
transfer the coarse grid result to the finer grid for the initial guess
● Problems?
Multigrid Methods Elements of Multigrid
Ferien Akademie ’05 Veselin Dikov
● Element III: Correction scheme
● Residual equation: Ae = r
● The scheme:
» Relax on Au = f on to obtain an approximation .» Compute .» Relax on Ae = r on to obtain an approximation to the error, .» Correct the approximation .
hhv
hAvfr h2
he2
hhh evv 2
Multigrid Methods Elements of Multigrid
Ferien Akademie ’05 Veselin Dikov
● Element IV: Interpolation and restriction
● Interpolation :
● Restriction :
● Variational property:
hhI 2
.12
0,2
1
,
21
212
22
n
jvvv
vv
hj
hj
hj
hj
hj
hhI2
.22 h
jhj vv Injection:
.12
1,24
112212
2 n
jvvvv hj
hj
hj
hjFull weighting:
RcIcITh
hhh ,2
2
Multigrid Methods
Ferien Akademie ’05 Veselin Dikov
Agenda
● Model problem
● Relaxation. Smoothing property
● Elements of Multigrid
● Multigrid schemes
Multigrid Methods Two-Grid
Ferien Akademie ’05 Veselin Dikov
● Two-Grid = Corr.Scheme+Interpolation+Restriction
» Relax times on on with initial guess
» Compute and restrict .
» Solve on .
» Interpolate and correct .
» Relax times on on with initial guess
hhh fvMGv ,
1 hhh fuA hhv
hhhh vAfr hhh
h rIr 22 hhh reA 222 h2
hhh
h eIe 22 hhh evv
2 hhh fuA hhv
Multigrid Methods Two-Grid -> V-Cycle
Ferien Akademie ’05 Veselin Dikov
● V-Cycle = Recursive Two-Grid Scheme
● Two-Grid Scheme
V-Cycle W-Cycle
Multigrid Methods Full Multigrid(FMG)
Ferien Akademie ’05 Veselin Dikov
● FMG = V-Cycle + nested iterations
FMG
Multigrid Methods Costs
Ferien Akademie ’05 Veselin Dikov
● V-Cycle costs
d
d
Lddd nn
21
2
2
1...
2
1
2
112
2
WUdLdd
21
2
2
1...
2
1
2
112
2Computational cost
Storage
● FMG computational costs
WUdLddd 2221
2
2
1...
2
1
2
11
21
2
● Speedup because working on smaller domains