Algebraic Multigrid andConvection-Diffusion Problems
Jonathan Boyle and David SilvesterSchool of Mathematics
University of Manchester, UK
Boyle & Silvester 2006 – p. 1/29
Outline
• ~u · ∇~u− ν∇2~u+ ∇p = ~0; ∇ · ~u = 0
Boyle & Silvester 2006 – p. 2/29
Outline
• ~u · ∇~u− ν∇2~u+ ∇p = ~0; ∇ · ~u = 0
Black-Box (AMG) components:
~w · ∇u− ν∇2u = f
−∇2p = f
≈ f95-hslxxxx
What would be ideal?
Boyle & Silvester 2006 – p. 2/29
Outline
• ~u · ∇~u− ν∇2~u+ ∇p = ~0; ∇ · ~u = 0
Black-Box (AMG) components:
~w · ∇u− ν∇2u = f
−∇2p = f
≈ f95-hslxxxx
What would be ideal?
• Optimal complexity: only O(n) flops per iteration, wheren is dimension of system.
• Optimal convergence: rate is bounded independently ofdiscrete problem parameters: h and ν
• Simple implementation: no parameters that have to beestimated a priori.
Boyle & Silvester 2006 – p. 2/29
Incompressible Flow Iterative SolutionSoftware (IFISS)
Installation & Software guide
David J. Silvester1 Howard C. Elman2 Alison Ramage3
Version 2.0, released 2 May 2005
1School of Mathematics, University of Manchester, Manchester, UK.
[email protected] of Computer Science, University of Maryland, College Park, USA.
[email protected] of Mathematics, University of Strathclyde, Glasgow, UK.
Boyle & Silvester 2006 – p. 3/29
Convection diffusion equation
−ǫ∇2u+ ~w · ∇u = 0 in Ω ⊂ R2
• ǫ > 0
• ~w - ’wind’
• plus appropriate boundary conditions
Boyle & Silvester 2006 – p. 4/29
• Stability problem with Galerkin discretisation
• Use streamline diffusion (derived from Petrov-Galerkin discretisation)
• Q1 (bilinear) approximation
Stabilized discrete formulation
• find uh ∈ Sh
Esuch that a(uh, vh) = 0 for all vh ∈ Sh
0
a(u, v) = ǫ
∫
Ω
∇u · ∇v +
∫
Ω
(~w · ∇u)v + δ
∫
Ω
(~w · ∇u)(~w · ∇v)
Boyle & Silvester 2006 – p. 5/29
Streamline diffusion
Need δ
• calculate per element δk
• δk =
hk
2|~wk|
(
1 − 1
P k
h
)
if P k
h> 1
0 if P k
h≤ 1
• |~wk| is l2 norm of wind at element centroid
• hk is length of element in wind direction
• P k
h= |~wk|hk/(2ǫ) - element Peclet number
Boyle & Silvester 2006 – p. 6/29
GMRES Solver• right preconditioning — solve [AP−1][Pu] = f
• preconditioner - one AMG V-cycle
AMG method
Classical AMG — as described by Stüben a
• direct interpolation based on negative connections• positive connections added to diagonal
• standard coarsening
• coarsest level has one point if possible• coarsening failure may occur - limits coarsest level
aAlgebraic Multigrid (AMG): An Introduction With Applications
Boyle & Silvester 2006 – p. 7/29
Smoothers
• PDJ - 2× point damped Jacobi sweep, ω = 1/2
• PGS - 2× point Gauss Seidel• pre-sweep: 2 forward sweeps• post-sweep: 2 backward sweeps
• LGS - 2 line Gauss Seidel sweeps• alternate x and y sweeps• use on finest level only (with PDJ or PGS on coarse)
• ILU - 1 incomplete LU sweep
Apply smoother before and after each coarse solve
Direction of smoothing important for ILU, PGS, LGS
Boyle & Silvester 2006 – p. 8/29
Testing environment
MATLAB —Two test problems from the IFISS toolbox
• square domain (−1, 1) × (−1, 1) (L = 2)
• ‖~w‖∞
= O(1)
• Pe ∼ 2/ǫ
• Starting vector - zeros
• Report # iterations required to reduce residual by 10−6
Boyle & Silvester 2006 – p. 9/29
Test problem I — variable vertical wind
• Wind ~w = (0, 1 + (x + 1)2/4)
• Boundary conditions
• Dirichlet inlet u = 1 on bottom wall
• u decreases to zero quadratically on right wall and
cubically on left wall
• zero Neumann on top wall
• Grids stretched in horizontal direction to resolve shear
layers
Boyle & Silvester 2006 – p. 10/29
Sample Solution
16 × 16 grid, ǫ = 1/250
−1 −0.5 0 0.5 1−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
−1−0.5
00.5
1
−1
−0.5
0
0.5
10
0.2
0.4
0.6
0.8
1
1.2
1.4
Boyle & Silvester 2006 – p. 11/29
Iteration counts for test problem I
• Simple point smoothers
smoother grid ǫ = 1 ǫ = 1/250 ǫ = 1/500 ǫ = 1/1000 ǫ = 1/2000
PGS 16 × 16 4 5 5 5 6
32 × 32 5 8 9 9 10
64 × 64 5 11 23 42 >100
128 × 128 5 17 >100 >100 >100
PDJ 16 × 16 6 10 10 11 11
32 × 32 6 14 13 15 16
64 × 64 6 14 17 22 25
128 × 128 7 12 18 36 41
Boyle & Silvester 2006 – p. 12/29
Iteration counts for test problem I
• Other smoothers
smoother grid ǫ = 1 ǫ = 1/250 ǫ = 1/500 ǫ = 1/1000 ǫ = 1/2000
ILU 16 × 16 3 2 2 2 6
32 × 32 4 2 2 2 2
64 × 64 4 2 2 2 2
128 × 128 4 3 2 2 2
LGS+PGS 16 × 16 4 2 2 1 1
32 × 32 4 2 2 2 2
64 × 64 4 2 3 4 5
128 × 128 5 3 5 >100 >100
LGS+PDJ 16 × 16 4 2 2 1 1
32 × 32 5 2 2 2 2
64 × 64 5 2 2 2 2
128 × 128 6 2 2 2 2
Boyle & Silvester 2006 – p. 13/29
Test problem II — recirculating wind
• wind ~w = (2y(1 − x2),−2x(1 − y2))
• Dirichlet boundary conditions• u = 0 on three walls• u = 1 on other
• grids stretched in both directions
Boyle & Silvester 2006 – p. 14/29
Sample Solution
16 × 16 grid, ǫ = 1/250
−1 −0.5 0 0.5 1−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
−1−0.5
00.5
1
−1
−0.5
0
0.5
10
0.2
0.4
0.6
0.8
1
Boyle & Silvester 2006 – p. 15/29
Iteration counts — test problem II
smoother grid ǫ = 1 ǫ = 1/250 ǫ = 1/500 ǫ = 1/1000 ǫ = 1/2000
PGS 16 × 16 4 5 6 7 8
128 × 128 8 7 11 26 50
PDJ 16 × 16 6 7 8 10 11
128 × 128 10 7 6 5 6
ILU 16 × 16 3 4 5 5 5
128 × 128 4 3 4 4 4
LGS+PGS 16 × 16 4 5 5 6 7
128 × 128 4 6 8 15 28
LGS+PDJ 16 × 16 4 5 6 6 7
128 × 128 5 5 5 5 6
Boyle & Silvester 2006 – p. 16/29
Interim Summary
• Point Gauss-Seidel performance inferior to pointdamped Jacobi for small ǫ
• ILU performs well, but forming smoothers is expensive
• Good performance for point damped Jacobi on coarselevels together with line Gauss-Seidel on finest level(especially for mesh aligned flow)
Boyle & Silvester 2006 – p. 17/29
• ~w · ∇u− ν∇2u = 0
• ~u · ∇~u− ν∇2~u+ ∇p = ~0; ∇ · ~u = 0
Boyle & Silvester 2006 – p. 18/29
Steady-state Navier-Stokes equations
~u · ∇~u− ν∇2~u+ ∇p = 0 in Ω
∇ · ~u = 0 in Ω.
Boundary conditions:
~u = ~w on ∂ΩD, ν∂~u
∂n− ~np = ~0 on ∂ΩN .
Picard linearization:Given ~u0, compute ~u1, ~u2, . . ., ~uk via
~uk · ∇~uk+1 − ν∇2~uk+1 + ∇pk+1 = 0,
∇ · ~uk+1 = 0 in Ω
with the same boundary conditions.
Boyle & Silvester 2006 – p. 19/29
Each step of Picard iteration defines an Oseen Problem:Given ~v and ~w: find (~u, p) such that
~v · ∇~u− ν∇2~u+ ∇p = ~0 in Ω,
∇ · ~u = 0 in Ω,
~u = ~w on ∂ΩD, ν∂~u
∂n− ~np = ~0 on ∂ΩN ,
and using a stable mixed approximation gives the matrixsystem ...
Boyle & Silvester 2006 – p. 20/29
(
N + νA BT
B 0
)
P−1 P
(up
)
=
(fg
)
,
in terms of the associated discrete matrices
Nij = (~wh · ∇~φi, ~φj), convection
Aij = (∇~φi,∇~φj), diffusion
Bij = −(∇ · ~φj , ψi), divergence
Boyle & Silvester 2006 – p. 21/29
(
N + νA BT
B 0
)
P−1 P
(up
)
=
(fg
)
,
in terms of the associated discrete matrices
Nij = (~wh · ∇~φi, ~φj), convection
Aij = (∇~φi,∇~φj), diffusion
Bij = −(∇ · ~φj , ψi), divergence
A perfectly preconditioned system is given by(
N + νA BT
B 0
)(
F−1 F−1BTS−1
0 −S−1
)
︸ ︷︷ ︸
P−1
=
(I 0
BF−1 I
)
with F = N + νA and S = BF−1BT .Boyle & Silvester 2006 – p. 21/29
Schur complement approximation – I
Introducing the diagonal of the velocity mass matrix
M∗ ∼Mij = (~φi, ~φj),
gives the “least-squares commutator preconditioner”:
(BF−1BT )−1 ≈ (BM−1∗ BT
︸ ︷︷ ︸
amg
)−1(BM−1∗ FM−1
∗ BT )(BM−1∗ BT
︸ ︷︷ ︸
amg
)−1
Boyle & Silvester 2006 – p. 22/29
Schur complement approximation – II
Introducing associated pressure matrices
Ap ∼ (∇ψi,∇ψj), diffusion
Np ∼ (~wh · ∇ψi, ψj), convection
Fp = νAp +Np, convection-diffusion
gives the “pressure convection-diffusion preconditioner”:
(BF−1BT )−1 ≈ Q−1Fp A−1p
︸︷︷︸
amg
Boyle & Silvester 2006 – p. 23/29
Iterated AMG preconditioningReplace the convection-diffusion matrix operator F−1 byF−1∗ and the pressure-Poisson operator Ap (or BM−1
∗ BT ) inthe Schur complement approximation by A−1
∗ .
Black-box ingredients are ...
Boyle & Silvester 2006 – p. 24/29
Iterated AMG preconditioningReplace the convection-diffusion matrix operator F−1 byF−1∗ and the pressure-Poisson operator Ap (or BM−1
∗ BT ) inthe Schur complement approximation by A−1
∗ .
Black-box ingredients are ...
• F∗ := 1 AMG V-cycle applied to F
• A∗ := 1 AMG V-cycle applied to Ap or BM−1∗ BT
• 2 damped Jacobi smoothing sweeps (ω = 1/2)
Boyle & Silvester 2006 – p. 24/29
Test Problem – I (ν = 1/100)
−2 0 2 4 6 8 10−20
2
−0.1
−0.05
0
0.05
Pressure field [Navier−Stokes]
Streamlines: non−uniform [Navier−Stokes]
Boyle & Silvester 2006 – p. 25/29
GMRES convergence – least squares commutator
0 5 10 15 20 25 30 3510
−11
10−10
10−9
10−8
10−7
10−6
10−5
10−4
iterations
log 10
(res
idua
l)
residual reduction
idealPDJLGS/PDJ
Boyle & Silvester 2006 – p. 26/29
Test Problem – II (ν = 1/100)
−1
0
1
−1
0
115
15.5
16
pressure fieldStreamlines: selected
Boyle & Silvester 2006 – p. 27/29
GMRES convergence – pressure convection diffusion
0 10 20 30 40 50 6010
−11
10−10
10−9
10−8
10−7
10−6
10−5
10−4
10−3
iterations
log 10
(res
idua
l)
residual reduction
Boyle & Silvester 2006 – p. 28/29
Conclusion
• Good performance for point damped Jacobi on coarselevels (together with line Gauss-Seidel on finest levelespecially for mesh aligned flow)
Boyle & Silvester 2006 – p. 29/29