SLIDE 1
Projected Krylov Methods for Unsymmetric Augmented Systems - - PowerPoint PPT Presentation
Projected Krylov Methods for Unsymmetric Augmented Systems - - PowerPoint PPT Presentation
Projected Krylov Methods for Unsymmetric Augmented Systems Dominique Orban dominique.orban@gerad.ca GERAD and Ecole Polytechnique de Montr eal, Canada CERFACS Sparse Days 2008 Outline Problem Statement and Assumptions Direct
SLIDE 2
SLIDE 3
Problem Statement and Context
A BT B u p
- =
b d
- ◮ Optimization and Control, incl. least squares (A symmetric),
◮ Multi immiscible fluid flow with free surface, ◮ Fictitious domains method for flow around obstacle, ◮ Electromagnetism, image restoration, . . .
Denote the augmented matrix K(A).
◮ Do not want to assemble A, ◮ B “flat” and contributes marginally to density of K(A), ◮ Can assemble B, ◮ Can compute Ap but not ATp.
SLIDE 4
Typical Block Structure
Density(K(A)): 0.315%, A accounts for 0.279%, B for 0.036%
SLIDE 5
Assumptions and Basic Results
Do not assume A symmetric or positive (semi-)definite, but:
- 1. B full row rank,
- 2. N(A) ∩ N(B) = {0},
- 3. R(A | N(B)) ∩ R(BT) = {0}.
where R(A | N(B)) = {v = Aw for some w ∈ N(B)}
Theorem
K(A) is nonsingular ⇐ ⇒ assumptions 1–3
Theorem (Preconditioners)
G = G T positive definite over N(B) = ⇒ K(G) nonsingular
SLIDE 6
Direct Application of Iterative Methods
System size: n + m = 7761, itmax = 6(n + m), no preconditioner Solver Iterations Residual Workspace Time (s) BCG 46566 0.1329880e+02 54327 21.95 DBCG 46567 0.4489614e+01 85371 23.02 CGNR 46567 0.1537764e−04 38805 21.25 BCGSTAB 46567 0.3111281e−04 62088 21.95 TFQMR 46567 0.8147863e−04 85371 23.11 GMRES 46566 0.6374488e+97 132108 28.33 FGMRES 46566 0.3499084e+96 248519 28.63 DQGMRES 46566 0.1387398e+95 256177 44.45 F77 implementations from SPARSKIT [Saad]
SLIDE 7
Nullspace Methods
Au + BTp = b, and Bu = d. Let Z = orthonormal basis for N(B). Any solution u∗ has the form u∗ = Zu∗
Z + BTu∗ B.
SLIDE 8
Nullspace Methods
Au + BTp = b, and Bu = d. Let Z = orthonormal basis for N(B). Any solution u∗ has the form u∗ = Zu∗
Z + BTu∗ B.
Then d = Bu∗ = BBTu∗
B
← unique solution,
SLIDE 9
Nullspace Methods
Au + BTp = b, and Bu = d. Let Z = orthonormal basis for N(B). Any solution u∗ has the form u∗ = Zu∗
Z + BTu∗ B.
Then d = Bu∗ = BBTu∗
B
← unique solution, and Z TAZ u∗
Z = Z T(b − ABTu∗ B)
← concentrate on this system.
SLIDE 10
Nullspace Methods
Au + BTp = b, and Bu = d. Let Z = orthonormal basis for N(B). Any solution u∗ has the form u∗ = Zu∗
Z + BTu∗ B.
Then d = Bu∗ = BBTu∗
B
← unique solution, and Z TAZ u∗
Z = Z T(b − ABTu∗ B)
← concentrate on this system. Worry about p∗ later. Problem: Computing Z is too costly. Worry about it in a minute.
SLIDE 11
Krylov Menu
◮ K(A) is always indefinite (unless B vanishes): eliminate CG, ◮ K(A) is not symmetric: eliminate MINRES and SYMMLQ, ◮ Do not want to compute ATp: eliminate Bi-CG and QMR.
Leaves CGNE, CGNR, CGS, TFQMR, Bi-CGSTAB, GMRES(m).
◮ CGNE and CGNR “square the conditioning”, ◮ CGS exhibits erratic convergence, ◮ GMRES is quite memory hungry.
At this point, concentrate efforts on Bi-CGSTAB and TFQMR.
SLIDE 12
Preconditioned Bi-CGSTAB for R−T
1
MR−1
2 x = R−T 1
y
- 1. x0 ∈ Rn, r0 = b − Mx0, ¯
rT
0 r0 = 0, d0 = r0, k = 0.
- 2. Solve C ¯
dk = dk, set αk = ¯ rT
0 rk
¯ rT
0 M¯
dk ,
- 3. sk = rk − αkM¯
dk, solve C¯ sk = sk,
- 4. ωk = (R−T
1
sk)T(R−T
1
M¯ sk) R−T
1
M¯ sk2
2
,
- 5. xk+1 = xk + αk ¯
dk + ωk¯ sk,
- 6. rk+1 = sk − ωkM¯
sk,
- 7. βk = αk
ωk ¯ rT
0 rk+1
¯ rT
0 rk
,
- 8. dk+1 = rk+1 + βk(dk − ωkM¯
dk). C = RT
1 R2 is the preconditioner.
SLIDE 13
Preconditioned Bi-CGSTAB for R−T
1
MR−1
2 x = R−T 1
y
- 1. x0 ∈ Rn, r0 = b − Mx0, ¯
rT
0 r0 = 0, d0 = r0, k = 0.
- 2. Solve C ¯
dk = dk, set αk = ¯ rT
0 rk
¯ rT
0 M¯
dk ,
- 3. sk = rk − αkM¯
dk, solve C¯ sk = sk,
- 4. ωk = (R−T
1
sk)T(R−T
1
M¯ sk) R−T
1
M¯ sk2
2
≈ sT
k M¯
sk M¯ sk2
2
,
- 5. xk+1 = xk + αk ¯
dk + ωk¯ sk,
- 6. rk+1 = sk − ωkM¯
sk,
- 7. βk = αk
ωk ¯ rT
0 rk+1
¯ rT
0 rk
,
- 8. dk+1 = rk+1 + βk(dk − ωkM¯
dk). C = RT
1 R2 is the preconditioner.
SLIDE 14
Apply Bi-CGSTAB to Nullspace System
Z TAZ u = Z T(b − ABTu∗
B)
C = Z TGZ Choose an initial uZ
0.
SLIDE 15
Apply Bi-CGSTAB to Nullspace System
Z TAZ u = Z T(b − ABTu∗
B)
C = Z TGZ Choose an initial uZ
- 0. The initial residual is
r Z = Z T(b − ABTu∗
B) − Z TAZ uZ
= Z T b − A(ZuZ
0 + BTu∗
B)
- =
Z T(b − Au0) = Z Tr0.
SLIDE 16
Apply Bi-CGSTAB to Nullspace System
Z TAZ u = Z T(b − ABTu∗
B)
C = Z TGZ Choose an initial uZ
- 0. The initial residual is
r Z = Z T(b − ABTu∗
B) − Z TAZ uZ
= Z T b − A(ZuZ
0 + BTu∗
B)
- =
Z T(b − Au0) = Z Tr0. Similarly, r Z
k = Z Trk, d Z k = Z Tdk, Z ¯
d Z
k = ¯
dk, so Z TGZ ¯ d Z
k =
d Z
k
SLIDE 17
Apply Bi-CGSTAB to Nullspace System
Z TAZ u = Z T(b − ABTu∗
B)
C = Z TGZ Choose an initial uZ
- 0. The initial residual is
r Z = Z T(b − ABTu∗
B) − Z TAZ uZ
= Z T b − A(ZuZ
0 + BTu∗
B)
- =
Z T(b − Au0) = Z Tr0. Similarly, r Z
k = Z Trk, d Z k = Z Tdk, Z ¯
d Z
k = ¯
dk, so ¯ d Z
k =
(Z TGZ)−1 d Z
k
SLIDE 18
Apply Bi-CGSTAB to Nullspace System
Z TAZ u = Z T(b − ABTu∗
B)
C = Z TGZ Choose an initial uZ
- 0. The initial residual is
r Z = Z T(b − ABTu∗
B) − Z TAZ uZ
= Z T b − A(ZuZ
0 + BTu∗
B)
- =
Z T(b − Au0) = Z Tr0. Similarly, r Z
k = Z Trk, d Z k = Z Tdk, Z ¯
d Z
k = ¯
dk, so ¯ d Z
k =
(Z TGZ)−1Z Tdk
SLIDE 19
Apply Bi-CGSTAB to Nullspace System
Z TAZ u = Z T(b − ABTu∗
B)
C = Z TGZ Choose an initial uZ
- 0. The initial residual is
r Z = Z T(b − ABTu∗
B) − Z TAZ uZ
= Z T b − A(ZuZ
0 + BTu∗
B)
- =
Z T(b − Au0) = Z Tr0. Similarly, r Z
k = Z Trk, d Z k = Z Tdk, Z ¯
d Z
k = ¯
dk, so Z ¯ d Z
k = Z(Z TGZ)−1Z Tdk
SLIDE 20
Apply Bi-CGSTAB to Nullspace System
Z TAZ u = Z T(b − ABTu∗
B)
C = Z TGZ Choose an initial uZ
- 0. The initial residual is
r Z = Z T(b − ABTu∗
B) − Z TAZ uZ
= Z T b − A(ZuZ
0 + BTu∗
B)
- =
Z T(b − Au0) = Z Tr0. Similarly, r Z
k = Z Trk, d Z k = Z Tdk, Z ¯
d Z
k = ¯
dk, so ¯ dk = Z(Z TGZ)−1Z Tdk
SLIDE 21
Apply Bi-CGSTAB to Nullspace System
Z TAZ u = Z T(b − ABTu∗
B)
C = Z TGZ Choose an initial uZ
- 0. The initial residual is
r Z = Z T(b − ABTu∗
B) − Z TAZ uZ
= Z T b − A(ZuZ
0 + BTu∗
B)
- =
Z T(b − Au0) = Z Tr0. Similarly, r Z
k = Z Trk, d Z k = Z Tdk, Z ¯
d Z
k = ¯
dk, so ¯ dk = Z(Z TGZ)−1Z Tdk i.e. ¯ dk = PG(dk)
- blique projection onto N(B)
SLIDE 22
Projected Preconditioned Bi-CGSTAB
- 1. u0 ∈ Rn, r0 = b − Au0, (Z¯
r0)Tr0 = 0, d0 = r0, k = 0.
- 2. Compute ¯
dk = PG(dk), set αk = (Z¯ r0)Trk (Z¯ r0)TA¯ dk ,
- 3. sk = rk − αkA¯
dk, compute ¯ sk = PG(sk),
- 4. ωk = (ZZ Tsk)TA¯
sk Z TA¯ sk2
2
,
- 5. uk+1 = uk + αk ¯
dk + ωk¯ sk,
- 6. rk+1 = sk − ωkA¯
sk,
- 7. βk = αk
ωk (Z¯ r0)Trk+1 (Z¯ r0)Trk ,
- 8. dk+1 = rk+1 + βk(dk − ωkA¯
dk).
SLIDE 23
Projected Preconditioned Bi-CGSTAB
- 1. u0 ∈ Rn, r0 = b − Au0, (Z¯
r0)Tr0 = 0, d0 = r0, k = 0.
- 2. Compute ¯
dk = PG(dk), set αk = (Z¯ r0)Trk (Z¯ r0)TA¯ dk ,
- 3. sk = rk − αkA¯
dk, compute ¯ sk = PG(sk),
- 4. ωk = (ZZ Tsk)TA¯
sk Z TA¯ sk2
2
= PI(sk)TA¯ sk PI(A¯ sk)2
2
,
- 5. uk+1 = uk + αk ¯
dk + ωk¯ sk,
- 6. rk+1 = sk − ωkA¯
sk,
- 7. βk = αk
ωk (Z¯ r0)Trk+1 (Z¯ r0)Trk ,
- 8. dk+1 = rk+1 + βk(dk − ωkA¯
dk).
SLIDE 24
Choice of Fixed Vector
◮ ¯
r0 = Z T˜ r0 for some ˜ r0 ∈ Rn. Then (Z¯ r0)Tv = (ZZ T˜ r0)Tv = PI(˜ r0)Tv.
SLIDE 25
Choice of Fixed Vector
◮ ¯
r0 = Z T˜ r0 for some ˜ r0 ∈ Rn. Then (Z¯ r0)Tv = (ZZ T˜ r0)Tv = PI(˜ r0)Tv.
◮ ¯
r0 = (Z TGZ)−1Z T˜ r0 for some ˜ r0 ∈ Rn. Then (Z¯ r0)Tv = PG(˜ r0)Tv.
SLIDE 26
Choice of Fixed Vector
◮ ¯
r0 = Z T˜ r0 for some ˜ r0 ∈ Rn. Then (Z¯ r0)Tv = (ZZ T˜ r0)Tv = PI(˜ r0)Tv.
◮ ¯
r0 = (Z TGZ)−1Z T˜ r0 for some ˜ r0 ∈ Rn. Then (Z¯ r0)Tv = PG(˜ r0)Tv. Upon picking ˜ r0 = r0, we ask that r0 ⊥ N(B).
SLIDE 27
Computing Projections
¯ v = PI(v) ⇐ ⇒ I BT B ¯ v w
- =
v
- K(I)
¯ v = PG(v) ⇐ ⇒ G BT B ¯ v w
- =
v
- K(G)
Rely on symmetric indefinite factorization of K(I) and/or K(G).
SLIDE 28
Stabilizing the Projected Krylov Method
As in [Gould, Hribar & Nocedal, 2001], note that I BT B ¯ sk hk
- =
sk
- .
and ¯ sk → 0 while sk → 0. Cancellation follows: ¯ sk = sk − BThk and sk ≈ BThk.
SLIDE 29
Stabilizing the Projected Krylov Method
As in [Gould, Hribar & Nocedal, 2001], note that I BT B ¯ sk hk
- =
sk
- .
and ¯ sk → 0 while sk → 0. Cancellation follows: ¯ sk = sk − BThk and sk ≈ BThk. Solution: solve equivalently I BT B ¯ sk ˜ hk
- =
sk − BTλ
- .
with λ chosen such that sk − BTλ ≈ ¯ sk.
SLIDE 30
Stabilizing the Projected Krylov Method
As in [Gould, Hribar & Nocedal, 2001], note that I BT B ¯ sk hk
- =
sk
- .
and ¯ sk → 0 while sk → 0. Cancellation follows: ¯ sk = sk − BThk and sk ≈ BThk. Solution: solve equivalently I BT B ¯ sk ˜ hk
- =
sk − BTλ
- .
with λ chosen such that sk − BTλ ≈ ¯ sk. Ideal value λ = ˜ hk
SLIDE 31
Stabilizing the Projected Krylov Method
As in [Gould, Hribar & Nocedal, 2001], note that I BT B ¯ sk hk
- =
sk
- .
and ¯ sk → 0 while sk → 0. Cancellation follows: ¯ sk = sk − BThk and sk ≈ BThk. Solution: solve equivalently I BT B ¯ sk ˜ hk
- =
sk − BTλ
- .
with λ chosen such that sk − BTλ ≈ ¯ sk. Ideal value λ = ˜ hk ≈ ˜ hk−1.
SLIDE 32
Recovering the Pressure
p solves BTp = b − Au, i.e., BBTp = B(b − Au),
SLIDE 33
Recovering the Pressure
p solves BTp = b − Au, i.e., BBTp = B(b − Au), which are the KKT conditions of p = argmin
λ∈Rm 1 2BTλ + b − Au2 2.
SLIDE 34
Recovering the Pressure
p solves BTp = b − Au, i.e., BBTp = B(b − Au), which are the KKT conditions of p = argmin
λ∈Rm 1 2BTλ + b − Au2 2.
Equivalently, I BT B w p
- =
b − Au
SLIDE 35
Finding an Initial Point
u∗ = Zu∗
Z + BTu∗ B,
with BBTu∗
B = d.
I BT B w −u∗
B
- =
d
- w = BTu∗
B
with Bw = d.
SLIDE 36
Test Problems
Implementation
◮ Flexible Fortran 90/95 modules, ◮ Projections computed with MA57 from HSL, METIS ordering, ◮ Could also use MA27 or MA47 from HSL Archive.
Flow of an incompressible viscous Newtonian fluid in a domain Ω which contains a (potentially moving) subdomain Ω∗: ∂ v ∂t + v · grad v
- + µ∇2
v + grad p = f in Ω, div v = 0 in Ω,
- v =
v∗
- n Γ∗,
SLIDE 37
Numerical Results (G = I)
Problem I: Two immiscible fluids in a cavity nA = 7, 092, mB = 669, LBLT ≈ 0.12s, nnz(L) ≈ 27, 658 Instance nnz(A) nnz(B) Matvecs
- Rel. Res.
Time (s) iter-5 168, 103 40, 198 5, 864 9.7e−09 19.50 iter-7 168, 030 40, 174 5, 282 4.5e−09 17.70 iter-8 168, 054 40, 160 4, 842 3.2e−09 16.22
SLIDE 38
Numerical Results (G = I)
Problem I: Two immiscible fluids in a cavity nA = 7, 092, mB = 669, LBLT ≈ 0.12s, nnz(L) ≈ 27, 658 Instance nnz(A) nnz(B) Matvecs
- Rel. Res.
Time (s) iter-5 168, 103 40, 198 5, 864 9.7e−09 19.50 iter-7 168, 030 40, 174 5, 282 4.5e−09 17.70 iter-8 168, 054 40, 160 4, 842 3.2e−09 16.22 nA = 30, 320, mB = 2, 645, LBLT ≈ 0.64s, nnz(L) ≈ 145, 651 Instance nnz(A) nnz(B) Matvecs
- Rel. Res.
Time (s) iter-2 541, 545 86, 083 2, 696 3.0e−07 37.75 iter-6 795, 404 86, 063 1, 540 9.8e−09 23.61
SLIDE 39
Numerical Results (G = I)
Problem II: Rectangular cavity, fixed circular obstacle (single fluid)
- 1. Mesh around obstacle
nA = 49, 995, mB = 6, 530, LBLT ≈ 1.45s, nnz(L) ≈ 383, 272
- 2. Fictitious domains
nA = 53, 597, mB = 7, 330, LBLT ≈ 1.86s, nnz(L) ≈ 444, 637 Instance nnz(A) nnz(B) Matvecs
- Rel. Res.
Time (s) 1 1, 009, 071 383, 094 366 4.1e−07 9.76 2 1, 139, 724 413, 640 382 3.9e−05 11.40
SLIDE 40
Numerical Results (G = I)
Problem III: Von Karmann “vortices” Rectangular cavity, fixed circular obstacle
- 1. Mesh around obstacle, single fluid
nA = 49, 690, mB = 6, 336, LBLT ≈ 1.46s, nnz(L) ≈ 424, 618
- 2. Mesh around obstacle, two immiscible fluids
nA = 86, 685, mB = 7, 345, LBLT ≈ 2.78s, nnz(L) ≈ 523, 249
- 3. Fictitious domains, two immiscible fluids
nA = 87, 196, mB = 7, 579, LBLT ≈ 3.97s, nnz(L) ≈ 587, 336 Instance nnz(A) nnz(B) Matvecs
- Rel. Res.
Time (s) 1 1, 094, 691 408, 039 416 1.6e−07 11.73 2 2, 069, 305 507, 380 131 1.9e−07 6.28 3 2, 084, 752 512, 015 119 3.8e−08 5.78
SLIDE 41
Typical Evolution of Residual
500 1000 1500 2000 2500
Iterations
10-9 10-8 10-7 10-6 10-5 10-4 10-3 10-2 10-1
Log Residual Residual History, (2523 iterations)
SLIDE 42
Next Steps
◮ Populate Projected Krylov Library, ◮ Evaluate various preconditioners, ◮ When G = I,
ωk = PI(sk)TA¯ sk PI(A¯ sk)2
2
≈ PG(sk)TA¯ sk PG(A¯ sk)2
2
,
◮ Inexact projections (iteratively, inexact / incomplete B).
Thanks to Alain Fidahoussen and Steven Dufour for generating test problems.
SLIDE 43