Introduction to Scientific Computing II Multigrid Miriam Mehl Slide 5: Relaxation Methods Properties convergence depends on method clear, see exercises and 3), frequency of the error remember eigenvectors of the Jacobi iteration stepsize h q m,l = sinmπhi) sinlπhj)) i,j=,...,n. that s what we want to change to achieve an optimal method with cost Onumber of unknowns). Local Fourier Analysis for Jacobi and Gauss-Seidel D Poisson, zero right-hand side, 3-point stencil):
Jacobi: e it+ k = e it k+ + e it ) k Gauss-Seidel: e it+ k = e it k+ + e it+ k ) assume e it = e imkπh) k=,...,n and e it+ = λ m e it e it+ = e imπh + e imπh) e it = e imπh + λ m e imπh) e it cosmπh)e it m for m =, λ m 0 for m N, for m = N slow convergence of high and low frequencies fast convergence of middle frequencies λ m = eimπh e imπh 5 4 cosmπh) λ = for m = 3 for m = N slow convergence of low fequencies fast convergence of high frequencies overall convergence faster on coarser grids Slide 6: Jacobi Details Graphical analysis: low bad middle frequencies = good high bad hπ hπ π h π π
3 Slide 7: Gauss-Seidel Details Slide 8: Multigrid Principle idea: use different grid levels for different error frequencies as components of an error consisting of all kins of frequencies / linear combination) fine grid = grid we use to achieve our required accuracy Which frequencies have to be eliminated on the fine grid? The frequencies that cannot be represented on the coarse grid In general: We can represent all frequencies m with m < H on the coarse grid. With N = h, we get H = h = N+. Thus, we can represent all frequencies with m < N +. eliminate high frequencies = iterate until high frequencies have almost) disappeared, fast since reduction factor coarse grids = auxiliary grids used to eliminate smooth error parts eliminate low frequencies faster as bigger h and, thus, better convergence rate.) solve equation for the error since only the error not the solution u itself) is smooth and can be represented on the coarse grid without loosing accuracy error smooth representable Establish an equation for the error e = u u h : Ae = Au u h ) = b Au h. What equation would you solve on the coarse grid? Operator A analogue to the fine grid operator, initial guess for e: zero, res as the right hand side: to be restricted from the fine grid to the coarse grid. Why recursive algorithm? To solve the coarse grid equation for the error, apply the same method, that is use the next coarser grid to compute the smooth part of the error of this equation and so on recursion in the grid level refinement depth). What do you do with the solution of the coarse grid equation?
4 interpolate to the fine grid e f = Ie c. add to the fine grid solution: u new h = u h + e f u h + u u h = u. Slide 9: Multigrid Algorithm Pseudo Code: smoothn,u); res = compute_resn,u); res_c = restrictn,res); e_c = solven,res_c); e = interpolaten,e_c); u = u+e; smoothn,u); Slide 0-30: Multigrid Presmoothing Slide 3: Multigrid Residual res = Au, res := h res = u i+ + u i ) u i. In our example, the residual is almost zero and will be neglected. Slide 3: Multigrid Restriction pick out coarse grid points Slide 33-4: Multigrid Coarse Grid u H i = u H i+ + u H ) i Rres h. We execute Gauss Seidel iterations neglecting the very small) right hand side.
5 3 Slide 4-43: Multigrid Coarsest Grid Gauss Seidel on the coarstest grid, again with neglectable right hand side. 4 Slide 44-45: Multigrid Coarse Grid Gauss Seidel Coarse Grid. Stop after one iteration as almost converged. 5 Slide 46-50: Multigrid Postsmoothing Only one GS iteration as already converged. Slide 5: Multigrid example: two-dimensional Poisson equation u = 0 with homegoneous Dirichlet boundary conditions and initial guess u = exept from the boundaries, where it is zero. discretisation: 5-point-stencil V-cycle smoother: Gauss-Seidel 3 pre- and postsmoothing iterations each) relation fine h coarse H: : restriction: full weighting: 4 interpolation: bilinear See main.m and multigrid.m at the lectures webpage. Show the effects of the steps of the multigrid algorithm
6 Slide 53: Gauss-Seidel Multigrid Compare the error reduction by Gauss-Seidel two iterations) and the multigrid V-cycle nothing said about the dependence of the convergence speed on h! Slide 54: Multigrid Cycles V-cycle W-cycle Algorithms: V-cyle v_cycle...) { if not yet coarsest grid compute_residual...); restrict_residual...); v_cycle...); interpolate_error...); correct_solution...); else solve...);
7 } W-cycle w_cycle...) { if not yet coarsest grid compute_residual...); restrict_residual...); w_cycle...); w_cycle...); interpolate_error...); correct_solution...); else solve...); }