Professional Documents
Culture Documents
CS 294-73 Software Engineering For Scientific Computing Lecture 16: Multigrid (Structured Grids Revisited)
CS 294-73 Software Engineering For Scientific Computing Lecture 16: Multigrid (Structured Grids Revisited)
Poisson’s equation:
Heat equation:
Blue:Ω
Black: ∂Ω
Even though we don’t know the error, we can compute the residual to
provide a measure for the error: e.g. convergence if .
We can also see how the error behaves under point Jacobi
For the error to converge to zero for any Fourier mode, we require that
01+ k <1
⇣N N ⌘
k= , : k = 8/h2 , 1 + k =0
2 2
|k|h << 1 : k = O(1) , 1 + k = 1 + O(h2 )
Generally, high wave numbers in he error are damped efficiently, but not others.
But this is relative to the grid spacing. 10
² ⁴ ²
¹⁄₁₆×
• Adjoint conditions, order conditions (see ¹ ² ¹
Trottenberg).
¼ ½ ¼
½ ₁ ½
And bilinear interpolation.
¼ ½ ¼
Even if the grid is not a power of 2, can apply a
direct solve at the bottom. 3 levels in 3D leads to a
reduction by 512 in the number of unknowns.
10/24/2019 CS294-73 – Lecture 16 14
Results
More generally, any implicit method for the heat equation will involve solving
Weighted sum, positive weights, but sum to less than 1, more so as h gets
larger.
Fourier analysis works the same way as Poisson.
10/24/2019 CS294-73 – Lecture 16
Multigrid Pseudocode
vcycle( , ⇢)
{
:= + (L( ) ⇢) p times
if (level > 0)
{
R = ⇢ L( )
Rc = A(R)
: Bc ! R , = 0
vcycle( , Rc )
:= + I( )
:= + ⇤ (L( ) ⇢) p times
}
else
{
:= + ⇤ (L( ) ⇢) pB times
{
}
At the top level, iterate until residual is reduced by some factor.
10/24/2019 CS294-73 – Lecture 16 23
Implementing Multigrid
The algorithm is naturally recursive – implement as nested set of calls to
vcycle.