Transcript Slide 1
Mutigrid Methods for Solving Differential Equations Ferien Akademie ’05 – Veselin Dikov Multigrid Methods Agenda ● Model problem ● Relaxation. Smoothing property ● Elements of Multigrid ● Multigrid schemes Ferien Akademie ’05 Veselin Dikov Multigrid Methods Model Problem ● 1D boundary problem of steady state temperature a long a uniform rod u" ( x) u ( x) f ( x), u (0) u (1) 0 0 x 1, 0 ● Discretization in n points, step h = 1/n v j 1 2v j v j 1 2 h v0 v n 0 v j f j , Ferien Akademie ’05 1 j n 1, Veselin Dikov Multigrid Methods Model Problem T ● Av = f, where v v1 ,...,vn1 and f f1 ,..., fn1 T 2 h 2 1 1 A 2 h ● Stencil notation 1 2 h 2 . 1 . . . . 1 1 2 h 2 1 A 2 (1 2 h 2 1) h ● A is Symmetric positive definite Ferien Akademie ’05 Veselin Dikov Multigrid Methods Agenda ● Model problem ● Relaxation. Smoothing property ● Elements of Multigrid ● Multigrid schemes Ferien Akademie ’05 Veselin Dikov Multigrid Methods Iterative Methods ● Iterative vs Direct methods More about iterative methods ● Jacobi and Gauss-Seidel methods ● Smoothing property Ferien Akademie ’05 Veselin Dikov Multigrid Methods Smoothing Property ● Error along the domain After 35 sweeps with weighted Jacobi Error was smoothed Ferien Akademie ’05 Veselin Dikov Multigrid Methods Smoothing Property ● Smoothing property explained in four steps 1. Fourier modes vk , j jk sin , n 0 j n, 1 k n 1 ● k – wave number Ferien Akademie ’05 Veselin Dikov Smoothing Property Multigrid Methods ● Smoothing property explained in four steps 1. Fourier modes k=1 k=2 k=7 k = 12 Ferien Akademie ’05 Veselin Dikov Multigrid Methods Smoothing Property ● Smoothing property explained in four steps 1. Fourier modes ● smooth modes - n 1 k 2 n k n 1 ● oscillatory modes 2 Ferien Akademie ’05 Veselin Dikov Smoothing Property Multigrid Methods ● Smoothing property explained in four steps 1. Fourier modes 2. Modified model problem ● f = 0, σ = 0 Au = 0 ● exact solution: u = 0 ● error: e = u – v = -v we can trace the error! Ferien Akademie ’05 Veselin Dikov Smoothing Property Multigrid Methods ● Smoothing property explained in four steps 1. Fourier modes 2. Modified model problem 3. Weighted Jacobi relaxation ● wJacobi step v(k 1) R v(k ) c 2 1 1 2 1 R I A I . . . 2 2 . . 1 1 2 ● error e( m) R me(0) Ferien Akademie ’05 Veselin Dikov Smoothing Property Multigrid Methods ● Smoothing property explained in four steps 1. Fourier modes 2. Modified model problem 3. Weighted Jacobi relaxation 4. Three experiments ● we relax with wJacobi with ω = 2/3 on initial guesses respectively: ( 0) ( 0) ( 0) v v , v v and v v6 1 3 e # iterations Ferien Akademie ’05 Veselin Dikov Smoothing Property Multigrid Methods ● Smoothing property explained in four steps 1. Fourier modes 2. Modified model problem 3. Weighted Jacobi relaxation 4. Three experiments ● repeat the experiment with: e ω = 2/3 and initial guess 1 1 (0) v v1 v3 v6 2 2 # iterations Ferien Akademie ’05 Veselin Dikov Multigrid Methods Smoothing Property ● 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ω ? Ferien Akademie ’05 Veselin Dikov Smoothing Property Multigrid Methods ● Smoothing property explained in four steps 1. Fourier modes 2. Modified model problem Eigenvalue 3. Weighted Jacobi relaxation 4. Three experiments ● Explanation wavenumber k Ferien Akademie ’05 Veselin Dikov Multigrid Methods Smoothing Property ● 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? Ferien Akademie ’05 Veselin Dikov Multigrid Methods Agenda ● Model problem ● Relaxation. Smoothing property ● Elements of Multigrid ● Multigrid schemes Ferien Akademie ’05 Veselin Dikov Multigrid Methods Elements of Multigrid ● Element I: A smooth wave looks more oscillatory on a coarser grid ● Aliasing: k looks like (n-k) Ferien Akademie ’05 Veselin Dikov Elements of Multigrid Multigrid Methods ● Element II: Nested Iterations finest grid Relax Relax coarsest grid Relax transfer the coarse grid result to the finer grid for the initial guess ● Problems? Ferien Akademie ’05 Veselin Dikov Multigrid Methods Elements of Multigrid ● Element III: Correction scheme ● Residual equation: Ae = r ● The scheme: » Relax on Au = f on to obtain an h approximation v . » Compute r f Avh . 2h » Relax on Ae = r on to obtain an 2h approximation to the error, e . h h 2h v v e » Correct the approximation . h Ferien Akademie ’05 Veselin Dikov Elements of Multigrid Multigrid Methods ● Element IV: Interpolation and restriction ● Interpolation I 2hh : v2h j v 2j h , 1 2h v v j v 2j h1 , 2 ● Restriction I h2 h : h 2 j 1 n 0 j 1. 2 2h h Injection: v j v2 j . 1 h h h v v 2 v v Full weighting: 2 j 1 2j 2 j 1 , 4 ● Variational property: 2h j I h 2h , c I 2h T h Ferien Akademie ’05 n 1 j 1. 2 cR Veselin Dikov Multigrid Methods Agenda ● Model problem ● Relaxation. Smoothing property ● Elements of Multigrid ● Multigrid schemes Ferien Akademie ’05 Veselin Dikov Multigrid Methods Two-Grid ● Two-Grid = Corr.Scheme+Interpolation+Restriction v h MG v h , f h h » Relax 1 times on Ah u h f h on with initial h guess v » Compute r h f h Ah v h and restrict r 2h I h2h r h. 2h 2h 2h » Solve A e r on 2 h. h h h » Interpolate e h I 2hh e 2h and correct v v e . h » Relax 2 times on Ah u h f h on with initial h v guess Ferien Akademie ’05 Veselin Dikov Multigrid Methods Two-Grid -> V-Cycle ● Two-Grid Scheme ● V-Cycle = Recursive Two-Grid Scheme V-Cycle Ferien Akademie ’05 W-Cycle Veselin Dikov Multigrid Methods Full Multigrid(FMG) ● FMG = V-Cycle + nested iterations FMG Ferien Akademie ’05 Veselin Dikov Multigrid Methods Costs ● V-Cycle costs d 1 1 1 2 n Storage 2n d 1 d 2 d ... L 2 2 1 2d 2 1 1 1 2 Computational cost 2 1 ... WU d 2d L d 2 2 1 2 2 ● FMG computational costs 1 1 2 2 1 1 ... WU 2 d d 2d L 2 2 1 2 d 1 2 2 ● Speedup because working on smaller domains Ferien Akademie ’05 Veselin Dikov