Docsity

Multi-Grid Method - Advanced Device Simulation - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Multi-Grid Method - Advanced Device Simulation - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Multi-Grid Method

Complexity of linear solvers

2D 3D

Sparse Cholesky: O(n 1.5^ ) O(n^2 )

CG, exact arithmetic:

O(n^2 ) O(n^2 )

CG, no precond: O(n 1.5^ ) O(n 1.33^ )

CG, modified IC: O(n 1.25^ ) O(n 1.17^ )

CG, support trees: O(n 1.20^ ) -> O(n 1+^ ) O(n 1.75^ ) -> O(n 1.31^ )

Multigrid: O(n) O(n)

n 1/2^ n 1/

Time to solve model problem (Poisson’s equation) on regular mesh

Literature

= f(x)

  • Poisson’s equation in 1D: ∂^2 u/∂x - 2 - - -1 2 - - -1 2 - - -1 2 - - -1
    • T = -1^2 -

Multigrid Methods

  • We studied several iterative methods
    • Jacobi, SOR, Guass-Seidel, Red-Black variations, Conjugate Gradients (CG)
    • All use sparse matrix-vector multiply (nearest neighbor communication on grid)
  • Key problem with iterative methods is that:
    • detail (short wavelength) is correct
    • convergence controlled by coarse (long wavelength) structure
  • In simple methods one needs of order N^2 iterations to get good results
    • Ironically, one goes to large N (fine mesh) to get detail
    • If all you wanted was coarse structure, a smaller mesh would be fine
  • Basic idea in multigrid is key in many areas of science
    • Solve a problem at multiple scales
  • We get coarse structure from small N and fine detail from large N
    • Good qualitative idea but how do we implement?

Slide source: Geoffrey Fox and (indirectly) Ulrich Ruede Docsity.com

Multigrid Overview

  • Basic Algorithm:
    • Replace problem on fine grid by an approximation on a coarser grid
    • Solve the coarse grid problem approximately, and use the solution as a starting guess for the fine-grid problem, which is then iteratively updated
    • Solve the coarse grid problem recursively, i.e. by using a still coarser grid approximation, etc.
  • Success depends on coarse grid solution being a good approximation to the fine grid

Multigrid Sketch in 1D

  • Consider a 2m^ +1 grid in 1D for simplicity
  • Let P (i)^ be the problem of solving the discrete Poisson

equation on a 2i+1 grid in 1D

  • Write linear system as T(i) * x(i) = b(i)
  • P (m)^ , P (m-1)^ , … , P(1)^ is sequence of problems from finest

to coarsest

Multigrid Sketch in 2D

  • Consider a 2m^ +1 by 2m^ +1 grid in 2D
  • Let P (i)^ be the problem of solving the discrete Poisson

equation on a 2i+1 by 2i+1 grid in 2D

  • Write linear system as T(i) * x(i) = b(i)
  • P (m)^ , P (m-1)^ , … , P(1)^ is sequence of problems from finest

to coarsest

Basic Multigrid Ideas

  • In picture, relax is application of standard iteration scheme
    • “solve” short wavelength solution at a given level
    • i.e. use Jacobi, Gauss-Seidel, Conjugate Gradient
  • Interpolation is taking a solution at a coarser grid and interpolating to find a solution at half the grid size
  • Restriction is taking solution at given grid and averaging to find solution at coarser grid

k

k+

Interpolate Restrict

Slide source: Geoffrey Fox Docsity.com

Multigrid Operators

  • For problem P(i)^ at varying coarsening levels (i, grid size grows with i):
    • b(i) is the Right Hand Side (RHS) and
    • x(i) is the current estimated solution
  • All the following operators just average values on neighboring grid points (so information moves fast on coarse grids)
  • The restriction operator R(i) maps P(i)^ to P(i-1)
    • Restricts problem on fine grid P(i)^ to coarse grid P(i-1)
    • Uses sampling or averaging
    • b(i-1)= R(i) (b(i))
  • The interpolation operator In(i-1) maps approx. solution x(i-1) to x(i)
    • Interpolates solution on coarse grid P(i-1)^ to fine grid P(i)
    • x(i) = In(i-1)(x(i-1))
  • The solution operator S(i) takes P(i)^ and improves solution x(i)
    • Uses “weighted” Jacobi or SOR on single level of grid
    • x (^) improved (i) = S(i) (b(i), x(i))
  • Overall algorithm, then details of operators

both live on grids of size 2 i-

This is called a V-Cycle

• Just a picture of the call graph

• In time a V-cycle looks like the following

Multigrid Algorithm: procedure MG(level, A, u, f)

  • if level = coarsest then
    • solve coarsest grid equation by another method “exactly”
  • else
    • smooth Alevel^ u = f (m 1 times)
    • Compute residual r = f - Alevel^ u
    • Restrict F = R r ( R is Restriction Operator)
    • Call MG( level + 1, A(level+1)^ , V, F) (m (^) c times)
    • Interpolate v = P V (Interpolate new solution at this level)
    • correct u (^) new = u + v
    • smooth Au (^) new = f (m 2 times) and
    • set u = u (^) new
  • endif
  • endprocedure A^

level (^) uexact = f

uexact = u + v A level^ v = r = f - Alevel^ u

Slide source: Geoffrey Fox Docsity.com

Elements of Multigrid

1 st^ observation towards multigrid

  • Many relaxation schemes have the smoothing property: oscillatory error modes are quickly eliminated, while smooth modes are often very slow to disappear.
  • In multigrid, this adversity is turned around: the idea is to use coarse grids to take advantage of smoothing.

Reason #1 Coarse Grids

Nested Iteration

Coarse grids can be used to compute an improved initial guess for the fine grid relaxation. This is advantageous because:

o Relaxation on the coarse-grid is much cheaper: half as many points in 1D, one-fourth in 2D, one- eight in 3D o Relaxation on the coarse grid is marginally faster