Академический Документы
Профессиональный Документы
Культура Документы
Nonlinear PDEs
Simula Research Laboratory, and
Dept. of Informatics, Univ. of Oslo
INF5620: Numerical Methods for Partial Differential Equations – p.1/148 Nonlinear PDEs – p.2/148
Some nonlinear model problems to be treated next: Finite differences for −u′′ = f (u):
′′ 1
−u (x) = f (u), u(0) = uL , u(1) = uR ,
− (ui−1 − 2ui + ui+1 ) = f (ui )
−(α(u)u′ )′ = 0, u(0) = uL , u(1) = uR h2
∂u ⇒ nonlinear system of algebraic equations
−∇ · [α(u)∇u] = g(x), with u or − α B.C.
∂n
F (u) = 0, or Au = b(u), u = (u0 , . . . , uN )T
Discretization methods:
standard finite difference methods Finite differences for (α(u)u′ )′ = 0:
standard finite element methods
the group finite element method 1
(α(ui+1/2 )(ui+1 − ui ) − α(ui−1/2 )(ui − ui−1 )) = 0
h2
We get nonlinear algebraic equations
Solution method: iterate over linear equations 1
([α(ui+1 ) + α(ui )](ui+1 − ui ) − [α(ui ) + α(ui−1 )](ui − ui−1 )) = 0
2h2
⇒ nonlinear system of algebraic equations
Finite elements for −u′′ = f (u) with u(0) = u(1) = 0 Note that X
P f( ϕk (x)uk )
Galerkin approach: find u = nk=1 uk ϕk (x) ∈ V such that
k
Z 1 Z 1
is a complicated function of u0 , . . . , uN
u′ v ′ dx = f (u)vdx ∀v ∈ V
0 0 F.ex.: f (u) = u2
Z !2
Left-hand side is easy to assemble: v = ϕi 1 X
ϕk uk ϕi dx
Z 1 X
0 k
1
− (ui−1 − 2ui + ui+1 ) = f( uk ϕk (x))ϕi dx gives rise to a difference representation
h 0 k
P P h
We write u = k uk ϕk instead of u = k ck ϕk since u2 + 2ui (ui−1 + ui+1 ) + 6u2i + u2i+1
12 i−1
ck = u(xk ) = uk and uk is used in the finite difference schemes
(compare with f (ui ) = u2i in FDM!)
R
Must use numerical integration in general to evaluate f (u)ϕi dx
X n
X (α(u)u′ )′ = 0, u(0) = uL , u(1) = uR
f (u) = f ( uj ϕj (x)) ≈ f (uj )ϕj
j j=1 Using a finite element method (fine exercise!) results in an integral
R1 R1P Z
Resulting term: f (u)ϕi dx = j ϕi ϕj f (uj ) gives 1 X
0 0
α( uk ϕk )ϕ′i ϕ′j dx
0
X Z 1 k
ϕk ϕi dx f (uj )
j 0 ⇒ complicated to integrate by hand or symbolically
Linear P1 elements and trapezoidal rule (do it!):
This integral andPformulation also arise from approxmating some
function by u = j uj ϕj 1 1
(α(ui ) + α(ui+1 ))(ui+1 − ui ) − (α(ui−1 ) + α(ui ))(ui − ui−1 ) = 0
2 2
We can write the term as M f (u), where M has rows consisting
of h/6(1, 4, 1), and row i in M f (u) becomes ⇒ same as FDM with arithmetic mean for α(ui+1/2 )
h
(f (ui−1 ) + 4f (ui ) + f (ui+1 ))
6 Nonlinear PDEs – p.7/148 Nonlinear PDEs – p.8/148
Nonlinear algebraic equations Solving nonlinear algebraic eqs.
0 Relaxation:
Must provide (good) guess u
Termination:
Au∗ = b(uq ), uq+1 = ωu∗ + (1 − ω)uq
||uq+1 − uq || ≤ ǫu
or using the residual (expensive, req. new A(uq+1 )!) (may improve convergence, avoids too large steps)
This method is also called Successive substitutions
||b − A(uq+1 )uq+1 || ≤ ǫr
Relative criteria:
||uq+1 − uq || ≤ ǫu ||uq ||
or (more expensive)
||b − A(uq+1 )uq+1 || ≤ ǫr ||b − A(u0 )u0 || Nonlinear PDEs – p.11/148 Nonlinear PDEs – p.12/148
Newton’s method for scalar equations Newton’s method for systems of equations
The Jacobian matrix; FDM (1) The Jacobian matrix; FDM (2)
1 Derivation:
Fi ≡ (ui−1 − 2ui + ui+1 ) + f (ui ) = 0 ∂Fi 1
h2 Ji,i−1 = = 2
∂ui−1 h
Jacobian matrix term (FDM): ∂Fi 1
Ji,i+1 = = 2
∂Fi ∂ui+1 h
Ji,j =
∂uj ∂Fi 2
Ji,i = = − 2 + f ′ (ui )
∂ui h
Fi contains only ui , ui±1
Must form the Jacobian matrix J in each iteration and solve
Only
J δuq+1 = −F (uq )
∂Fi ∂Fi ∂Fi
Ji,i−1 = , Ji,i = , Ji,i+1 = 6= 0
∂ui−1 ∂ui ∂ui+1 and then update
uq+1 = uq + ωδuq+1
⇒ Jacobian is tridiagonal
Nonlinear PDEs – p.15/148 Nonlinear PDEs – p.16/148
The Jacobian matrix; FEM A 2D/3D transient nonlinear PDE (1)
−u′′ = f (u) on Ω = (0, 1) with u(0) = u(1) = 0 and FEM PDE for heat conduction in a solid where the conduction depends
" # on the temperature u:
Z 1 X X
Fi ≡ ϕ′i ϕ′k uk − f ( us ϕs )ϕi dx = 0 ∂u
0 k s
̺C = ∇ · [κ(u)∇u]
∂t
∂Fi
First term of the Jacobian Ji,j = ∂uj :
(f.ex. u = g on the boundary and u = I at t = 0)
A 2D/3D transient nonlinear PDE (2) A 2D/3D transient nonlinear PDE (3)
∂Fi
Ji,j =
∂unj
Z
Ji,j = (ϕi ϕj + ∆t(α′ (un,q )ϕj ∇un,q · ∇ϕi + α(un,q )∇ϕi · ∇ϕj )) dΩ
Ω
Time-dependent problems: first use finite differences in time, then with = 0 < q0 < q1 < q2 < · · · < qm = q
use an iteration method (Picard or Newton) at the time-discrete
PDE level Start guess for ur is ur−1
(the solution of a “simpler” problem)
CFD: The Reynolds number is often the continuation parameter q
Exercise 1 Exercise 2
Derive the nonlinear algebraic equations for the problem For the problem in Exercise 1, use the group finite element
method with P1 elements and the Trapezoidal rule for integrals
d du and show that the resulting equations coincide with those
α(u) = 0 on (0, 1), u(0) = 0, u(1) = 1,
dx dx obtained in Exercise 1.
For the problem in Exercises 1 and 2, identify the F vector in the Explain why discretization of nonlinear differential equations by
system F = 0 of nonlinear equations. Derive the Jacobian J for a finite difference and finite element methods normally leads to a
general α(u). Then write the expressions for the Jacobian when Jacobian with the same sparsity pattern as one would encounter
α(u) = α0 + α1 u + α2 u2 . in an associated linear problem. Hint: Which unknowns will enter
equation number i?
Exercise 5 Exercise 6
Show that if F (u) = 0 is a linear system of equations, The operator ∇ · (α∇u), with α = ||∇u||q , q ∈ IR, and || · || being
F = Au − b, for a constant matrix A and vector b, then Newton’s the Eucledian norm, appears in several physical problems,
method (with ω = 1) finds the correct solution in the first iteration. especially flow of non-Newtonian fluids. The quantity ∂α/∂uj is
central when formulating a Newton method, where uj is the
P
coefficient in the finite element approximation u = j uj ϕj . Show
that
∂
||∇u||q = q||∇u||q−2 ∇u · ∇ϕj .
∂uj
Exercise 7 Exercise 8
Exercise 9 Exercise 10
For the problem in Exercise 8, assume that a nonlinear Newton In Exercise 8, restrict the problem to one space dimension,
cooling law applies at the whole boundary: choose simple boundary conditions like u = 0, use the group finite
element method for all nonlinear coefficients, apply P1 elements,
∂u use the Trapezoidal rule for all integrals, and derive the system of
−α(u) = H(u)(u − uS ),
∂n nonlinear algebraic equations that must be solved at each time
level.
where H(u) is a nonlinear heat transfer coefficient and uS is the
Set up some finite difference method and compare the form of the
temperature of the surroundings (and u is the temperature). Use a
nonlinear algebraic equations.
Backward Euler scheme in time and a Galerkin method in space.
Identify the nonlinear algebraic equations to be solved at each
time level. Derive the corresponding Jacobian.
The PDE problem in this exercise is highly relevant when the
temperature variations are large. Then the density times the heat
capacity (̺), the heat conduction coefficient (α) and the heat
transfer coefficient (H) normally vary with the temperature (u).
70˚
subsea volcano
asteroid Bodø
EN
ED
drilling, may generate tsunamis
SW
65˚
AY
increases near shore
RW
Stockholm
Oslo
NO
Bergen
5˚
10˚
15˚
2004), 65 My ago (extinction of the dinosaurs)
Circules: Major incidents, > 10 killed; Triangles: Selected smaller
incidents; Square: Storegga (5000 B.C.)
η(x,y,t) PDEs:
z
y ∂η ∂ ∂ ∂H
= − (uH) − (vH) −
x ∂t ∂x ∂y ∂t
∂u ∂η
= − , x ∈ Ω, t > 0
H(x,y,t) ∂t ∂x
∂v ∂η
= − , x ∈ Ω, t > 0
∂t ∂y
ℓ ℓ+ 1 ℓ+ 1
ηi+ 1
,j+ 1 , ui,j+2 1 , vi+ 12 ,j+1
2 2 2 2
ℓ+ 1
vi+ 12 ,j+1
2
ℓ+ 1
vi+ 12 ,j
2
Shallow water waves – p.43/148 Shallow water waves – p.44/148
∂η ∂ ∂ ∂u ∂η 1
= − (uH) − (vH) = − at (i, j + , ℓ)
∂t ∂x ∂y ∂t ∂x 2
1 1 1 ℓ
at (i + , j + , ℓ − ) [Dt u = −Dx η]i,j+ 1
2 2 2 2
1 h ℓ+ 12 ℓ− 21
i 1 h ℓ ℓ
i
ℓ− 1 u 1 − u = − ηi+ 1 ,j+ 1 − ηi− 1 1
[Dt η = −Dx (uH) − Dy (vH)]i+ 12 ,j+ 1 ∆t i,j+ 2 i,j+ 12 ∆x 2 2 2 ,j+ 2
2 2
1 h ℓ ℓ−1
i 1 h ℓ− 12 ℓ− 12
i
η 1 1 − ηi+ 1 1 = − (Hu)i+1,j+ 1 − (Hu) i,j+ 12
∆t i+ 2 ,j+ 2 2 ,j+ 2 ∆x 2
1 h ℓ− 1 ℓ− 1
i
− (Hv)i+ 12 ,j+1 − (Hv)i+ 12 ,j
∆y 2 2
∂v ∂η 1
= − at (i + , j, ℓ)
∂t ∂y 2
ℓ
[Dt v = −Dy η]i+ 1
2,j
1 h 1
i 1 h ℓ i
ℓ+ ℓ− 1 ℓ
v 12 − vi+ 12,j = η 1 1 − ηi+ 1 1
∆t i+ 2 ,j 2 ∆y i+ 2 ,j+ 2 2 ,j− 2
Eliminate u and v (easy in the PDEs) and get Centered differences in time and space
2 Truncation error, dispersion analysis: O(∆x2 , ∆y 2 , ∆t2 )
∂ η
= ∇ · [H(x, y)∇η] Stability as for the std. wave equation in 2D:
∂t2
s
Eliminate discrete u and v 1 1
∆t ≤ H − 2 1 1
⇒ Standard 5-point explicit finite difference scheme for discrete η ∆x2 + ∆y 2
(quite some algebra needed, try 1D first)
(CFL condition)
If H const, exact numerical solution is possible for
one-dimensional wave propagation
p
The velocity of a tsunami is gH(x, y, t).
Wave breaking: the top has larger effective depth and moves faster
than the front part (requires a nonlinear PDE)
Convection-dominated flow
Transport of a scalar u (heat, pollution, ...) in fluid flow v: The fluid flow itself is governed by Navier-Stokes equations:
∂u ∂v 1
+ v · ∇u = α∇2 u + f + v · v = − ∇p + ν∇2 v + f
∂t ∂t ̺
u(x)
0.2 0.2
0 0
-0.2 -0.2
-0.4 -0.4
-0.6 -0.6
-0.8 -0.8
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x
u(x)
0.2 0.2
0 0
-0.2 -0.2
-0.4 -0.4
-0.6 -0.6
-0.8 -0.8
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x
The solution is not monotone if h > 2ǫ Can find an analytical solution of the discrete problem (!)
The convergence rate is h2 Method: insert ui ∼ β i and solve for β
(expected since both differences are of 2nd order)
provided h ≤ 2ǫ 1 + h/(2ǫ)
β1 = 1, β2 =
Completely wrong qualitative behavior for h ≫ 2ǫ 1 − h/(2ǫ)
β2i − β2
ui =
β2n − β2
u(x)
0.2 0.2
0 0
-0.2 -0.2
-0.4 -0.4
-0.6 -0.6
-0.8 -0.8
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x
The solution is always monotone, i.e., always qualitatively correct Analytical solution of the discrete equations:
The boundary layer is too thick
ui = β i ⇒ β1 = 1, β2 = 1 + h/ǫ
The convergence rate is h
(in agreement with truncation error analysis)
ui = C1 + C2 β2i
Using boundary conditions:
β2i − β2
ui =
β2n − β2
Finite elements for the model problem Finite elements and upwind differences
Consider the weighting function ⇒ Streamline diffusion can be obtained by perturbing the weighting
function
∗
w = v + τ v · ∇v Common name: SUPG
R (streamline-upwind/Petrov-Galerkin)
for the convective (left-hand side) term: w v · ∇u dΩ
This expands to
Z Z
vv · ∇udΩ + τ ∗ v · ∇u v · ∇vdΩ
The latterP
term can be viewed as the Galerkin formulation of (write
v · ∇u = i ∂u/∂xi etc.)
Xd X d
∂ ∂u
τ ∗ vi vj
i=1 j=1
∂xi ∂xj
Z Z 1 Z 1
L(u)wΩ = 0 (u′ v + (ǫ + τ )u′ v ′ )dx + τ v ′′ u′ dx = 0
Ω 0 0
the exact solution is a solution of the FEM equations (it fulfills Problem: last term contains v ′′
L(u)) Remedy: drop it (!)
This no longer holds if we Justification: v ′′ = 0 on each linear (P1) element
add an artificial diffusion term (∼ h/2)
Drop 2nd-order derivatives of v in 2D/3D too
use different weighting functions on different terms
Consistent SUPG is not so consistent...
Idea: use consistent SUPG
no artificial diffusion term
same (perturbed) weighting function
applies to all terms
Convection-dominated flow – p.85/148 Convection-dominated flow – p.86/148
Two classes: v
τ∗ ∼ h u=1 du/dn=0
θ
τ ∗ ∼ ∆t (time-dep. problems)
Little theory
0.25
u=0
u=0 1 x
Methods:
1. Classical SUPG:
2
Brooks and Hughes: "A streamline upwind/Petrov-Galerkin finite
element formulation for advection domainated flows with particular
emphasis on the incompressible Navier-Stokes equations", Comp.
Methods Appl. Mech. Engrg., 199-259, 1982. 1
v · ∇u
w = v + τ ∗ v · ∇v + τ̂ ∇u 0
||∇u||2
−0.65
was proposed in 0
X
Convection-dominated flow – p.89/148 Convection-dominated flow – p.90/148
Model problem:
∂u
+ v · ∇u = ǫ∇2 u
2
∂t
Can add artificial streamline diffusion term
Can use perturbed weighting function
1
w = v + τ ∗ v · ∇v
0
on all terms
How to choose τ ∗ ?
−0.65
0
1 1
Z 0
X
Convection-dominated flow – p.91/148 Convection-dominated flow – p.92/148
Xd X d
∂2 ∂ ∂
2
= ∇ · (vv · ∇) = vr vs
∂t r=1 s=1
∂xr ∂xs
1
[Dt+ u + v · ∇u = ∆t∇ · (vv · ∇u)]n
2
Convection-dominated flow – p.95/148 Convection-dominated flow – p.96/148
The importance of linear system solvers
Example: Poisson eq. on the unit cube (1) Example: Poisson eq. on the unit cube (2)
FDM: 7 entries pr. row in A are nonzero Work in BGE: O(q 7 ) = O(n2.33 )
FEM: 7 (tetrahedras), 27 (trilinear elms.), or 125 (triquadratic Work in CG: O(q 3 ) = O(n) (multigrid; optimal),
elms.) entries pr. row in A are nonzero for the numbers below we use incomplete factorization
preconditioning: O(n1.17 )
A is sparse (mostly zeroes)
n = 27000:
Fraction of nonzeroes: Rq −3
(R is nonzero entries pr. row) CG 72 times faster than BGE
BGE needs 20 times more memory than CG
Important to work with nonzeroes only!
n = 8 million:
CG 107 times faster than BGE
BGE needs 4871 times more memory than CG
k
Mx = Nx k−1
+ b, k = 1, 2, . . . ||x − xk || ≤ ǫ||x − x0 ||
Split: A = L + D + U M =D
L and U are lower and upper triangular parts, D is A’s diagonal Put everything, except the diagonal, on the rhs
Jacobi iteration: M = D (N = −L − U ) 2D Poisson equation −∇2 u = f :
Gauss-Seidel iteration: M = L + D (N = −U )
ui,j−1 + ui−1,j + ui+1,j + ui,j+1 − 4ui,j = −h2 fi,j
SOR iteration: Gauss-Seidel + relaxation
SSOR: two (forward and backward) SOR steps Solve for diagonal element and use old values on the rhs:
Rate of convergence R∞ (G) for −∇2 u = f in 2D with u = 0 as 1 k−1
BC: uki,j = u + uk−1 k−1 k−1 2
i−1,j + ui+1,j + ui,j+1 + h fi,j
4 i,j−1
Jacobi: πh2 /2
Gauss-Seidel: πh2 for k = 1, 2, . . .
SOR: π2h
SSOR: > πh
SOR/SSOR is superior (h vs. h2 , h → 0 is small)
Idea: Computed new x approximation x∗ from Relaxed Jacobi iteration for −∇2 u = f is equivalent with solving
∗ k−1 ∂u
Dx = (−L − U )x +b
α = ∇2 u + f
∂t
Set
xk = ωx∗ + (1 − ω)xk−1 by an explicit forward scheme until ∂u/∂t ≈ 0, provided
ω = 4∆t/(αh)2
weighted mean of xk−1 and xk if ω ∈ (0, 1)
Stability for forward scheme implies ω ≤ 1
In this example: ω = 1 best (⇔ largest ∆t)
Forward scheme for t → ∞ is a slow scheme, hence Jacobi
iteration is slow
k
X
r k = b − Axk = rk−1 − αj Aq j
j=1
Residual: Residual:
k
X k
X
r k = b − Axk = r k−1 − αj Aq j r k = b − Axk = r k−1 − αj Aq j
j=1 j=1
(r k , q i ) = 0 ∂
(rk , rk ) = 0
∂αi
Galerkin’s method (r ∼ R, q j ∼ Nj , αj ∼ uj ):
Least squares: minimize (r k , rk )
(rk , q i ) = 0, i = 1, . . . , k Result: linear system for αj :
Simplifications Symmetric A
Galerkin: hq i , q j i = 0 for i 6= j gives If A is symmetric (AT = A) and positive definite (positive eigenvalues
⇔ y T Ay > 0 for any y 6= 0), also βi = 0 for i < k
(rk−1 , q k ) ⇒ need to store q k only
αk =
hq k , q k i (q 1 , . . . , q k−1 are not used in iteration k)
xk = xk−1 + αk q k
Generalized Conjugate Residual method Conjugate Gradient-like methods converge slowly (but usually
= least squares + restart faster than SOR/SSOR)
Orthomin method To reduce the initial error by a factor ǫ,
= least squares + truncation
1 2√
Conjugate Gradient method ln κ
= Galerkin + symmetric and positive definite A 2 ǫ
Conjugate Residuals method iterations are needed, where κ is the condition number:
= Least squares + symmetric and positive definite A
largest eigenvalue of A
Many other related methods: BiCGStab, Conjugate Gradients κ=
smalles eigenvalue of A
Squared (CGS), Generalized Minimum Residuals (GMRES),
Minimum Residuals (MinRes), SYMMLQ
κ = O(h−2 ) when solving 2nd-order PDEs
Common name: Conjugate Gradient-like methods (incl. elasticity and Poisson eq.)
All of these are easily called in Diffpack
Idea: Introduce an equivalent system Idea: “solve” M y = z by one iteration with a classical iterative
method (Jacobi, SOR, SSOR)
−1 −1
M Ax = M b Jacobi preconditioning: M = D (diagonal of A)
solve it with a Conjugate Gradient-like method and construct M No extra storage as M is stored in A
such that No extra computations as M is a part of A
1. κ = O(1) ⇒ M ≈ A (i.e. fast convergence) Efficient solution of M y = z
2. M is cheap to compute
But: M is probably not a good approx to A
3. M is sparse (little storage) ⇒ poor quality of this type of preconditioners?
4. systems M y = z (occuring in the algorithm due to
Conjugate Gradient method + SSOR preconditioner is widely
M −1 Av-like products) are efficiently solved (O(n) op.)
used
Contradictory requirements!
The preconditioning business: find a good balance between 1-4
Run through a standard Gaussian elimination, which factors A as Two test cases:
A = LU −∇2 u = f on the unit cube and FDM
Normally, L and U have nonzeroes where A has zeroes −∇2 u = f on the unit cube and FEM
Idea: let L and U be as sparse as A Diffpack makes it easy to run through a series of numerical
Compute only with the nonzeroes of A experiments, using multiple loops, e.g.,
sub LinEqSolver_prm
Such a preconditioner is called Incomplete LU Factorization, ILU set basic method = { ConjGrad & MinRes }
ok
Option: add contributions outside A’s sparsity pattern to the sub Precond_prm
set preconditioning type = PrecRILU
diagonal, multiplied by ω set RILU relaxation parameter = { 0.0 & 0.4 & 0.7 & 1.0 }
ok
Relaxed Incomplete Factorization (RILU): ω > 1
Modified Incomplete Factorization (MILU): ω = 1
See algorithm C.3 in the book
Compare Conjugate Residuals with Conjugate Gradients ILU, Jacobi, SSOR preconditioners (ω = 1.2)
Or: least squares vs. Galerkin MinRes:
Diffpack names: MinRes and ConjGrad Jacobi: not conv., SSOR: 11.4s, ILU: 4s
Test case 2: 3D FEM Poisson eq. Jacobi vs. SOR vs. SSOR
Equation: −∇2 u = A1 π 2 sin πx + 4A2 π 2 sin 2πy + 9A3 π 2 sin 3πz n = 9261 and n = 303 = 29791, trilinear and triquadratic elms.
Boundary condition: u known Jacobi: not converged in 1000 iterations
ElmB8n3D and ElmB27n3D elements SOR(ω = 1.8): 9.1s and 81s, 42s and 338s
Grid size: 21 × 21 × 21 = 9261 nodes and 31 × 31 × 31 = 29791 SSOR(ω = 1.8): 47s and 248s, 138s and 755s
nodes Gauss-Seidel: not converged in 1000 iterations
Source code:
SOR’s sensitivity to relax. parameter ω:
$NOR/doc/Book/src/fem/Poisson2
1.0: not conv., 1.6: 200s, 1.8: 83s, 1.9: 57s
All details in HPL Chapter 3.2 and 3.5 (n = 29791 and trilinear elements)
Input files: SSOR’s sensitivity to relax. parameter ω:
$NOR/doc/Book/src/fem/Poisson2/linsol-experiments 1.0: not conv., 1.6: 212s, 1.7: 207s, 1.8: 245s, 1.9: 435s
Solver’s CPU time available in casename-summary.txt (n = 29791 and trilinear elements)
⇒ relaxation is important,
great sensitivity to ω
Compare Conjugate Residuals with Conjugate Gradients ILU, Jacobi, SSOR preconditioners (ω = 1.2)
Or: least squares vs. Galerkin MinRes:
Diffpack names: MinRes and ConjGrad Jacobi: 68s., SSOR: 57s, ILU: 28s
Convection-diffusion equations: Multigrid methods are the most efficient methods for solving linear
$NOR/doc/Book/src/app/Cd/Verify systems
Files: linsol_a.i etc as for LinSys4 and Poisson2 Multigrid methods have optimal complexity O(n)
Elasticity equations: Multigrid can be used as stand-alone solver or preconditioner
$NOR/doc/Book/src/app/Elasticity1/Verify Multigrid applies a hierarchy of grids
Files: linsol_a.i etc as for the others Multigrid is not as robust as Conjugate Gradient-like methods and
Run experiments and learn! incomplete factorization as preconditioner, but faster when it
works
Multigrid is complicated to implement
Diffpack has a multigrid toolbox that simplifies the use of multigrid
dramatically
Observation: e.g. Gauss-Seidel methods are very efficient during Model problem: −u′′ = f by finite differences:
the first iterations
High-frequency errors are efficiently damped by Gauss-Seidel −uj−1 + 2uj − uj+1 = h2 fj
0.8
X 0.7
k 0.5
0.4
exp (ikh) 1
ξ = exp (−iω̃∆t) = , |ξ| = √
2 − exp (−ikh) 5 − 4 cos kh Small p = kh ∼ h/λ: low frequency (relative to the grid) and small
damping
Interpretation of |ξ|: reduction in the error per iteration Large (→ π) p = kh ∼ h/λ: high frequency (relative to the grid)
and efficient damping
Solving linear systems – p.141/148 Solving linear systems – p.142/148
From the previous analysis: error components with high frequency From fine to coarser: restriction
are quickly damped
Jump to a coarser grid, e.g. h′ = 2h simple restriction
weighted restriction
p is increased by a factor of 2, i.e., not so high-frequency waves
fine grid function
on the h grid is efficiently damped by Gauss-Seidel on the h′ grid
Repeat the procedure
1 2 3 4 5 q-1
On the coarsest grid: solve by Gaussian elimination
1 2 3 4 5 6 7 8 9 q
Interpolate solution to a finer grid, perform Gauss-Seidel
iterations, and repeat until the finest grid is reached From coarse to finer: prolongation
1 2 3 4 5 q−1
1 2 3 4 5 6 7 8 9 q
The Gauss-Seidel method is called a smoother when used to Start with the finest grid
damp high-frequency error components in multigrid Perform smoothing (pre-smoothing)
Other smoothers: Jacobi, SOR, SSOR, incomplete factorization Restrict to coarser grid
No of iterations is called no of smoothing sweeps Repeat the procedure (recursive algorithm!)
Common choice: one sweep On the coarsest grid: solve accurately
Prolongate to finer grid
Perform smoothing (post-smoothing)
One cycle is finished when reaching the finest grid again
Can repeat the cycle
Multigrid solves the system in O(n) operations