implementation of a geometric multigrid method for … · implementation of a geometric multigrid...

Post on 30-Jul-2018

227 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Implementation of a Geometric Multigrid Methodfor FEniCS and its Application

Felix Ospald

Chemnitz University of Technology, Faculty of MathematicsResearch Group Numerical Mathematics (Partial Differential Equations)

FEniCS‘13Cambridge, UKMarch 18, 2013

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Outline

1 Introduction to Geometric Multigrid (GMG)

2 Implementation

3 Numerical Results

4 Conclusion and Outlook

http://launchpad.net/fmg

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 1 / 31

Introduction to Geometric Multigrid (GMG)

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Overview

Multigrid methods are efficient solvers/preconditioners for linear ornonlinear systems of equations coming from a discretization of a(elliptic) PDE, i.e. find u ∈ U such that

a(u, v) = f (v) ∀v ∈ V ,

or equivalently

Ax = b.

They have a numerical complexity of O(N), if used in the rightway.

(U: trial space, V: test space)

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 2 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Multigrid Idea

Geometric multigrid is based on a fine-to-coarse grid/FE-spacehierarchy of the problem.

U1,V1

matrix: A1, rhs: b

U0 ⊂ U1,V0 ⊂ V1

matrix: A0

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 3 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Multigrid Idea

Let x be some initial guess of the solution x∗ = A−11 b.

1 Reduce the high frequency components of the error e = x∗− xand residual r = b − A1x by smoothing x := Sν1

1 (x , b).

2 Now the error/residual can be well approximated on the coarsegrid as r0 = Rr , by using the restriction operator R : V ′1 7→ V ′0.

3 Solve the residual equation A0e = r0 (on the coarse grid).

4 Interpolate the error e onto the fine grid, by using theprolongation operator P : U0 7→ U1.

5 Improve the current solution x := x + Pe

6 Smooth again x := Sν22 (x , b)

Note: Residual Equation

r = b − A1x = (b − A1x)− (b − A1x∗) = A1(x∗ − x) = A1e.

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 4 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

The Two-Grid Method

This gives the two-grid method:

Algorithm 1: The two-grid method TGM(x , b).

1 x := Sν11 (x , b) // pre-smoothing

2 r0 := R(b − A1x) // residual computation + restriction

3 e := A−10 r0 // solve coarse problem

4 x := x + Pe // prolongation + correction step

5 x := Sν22 (x , b) // post-smoothing

6 return x

Applying the TGM recursively (solving the equation in line 3) givesthe multi-grid method.

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 5 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Smoothing

Reduces the high frequency components of the error/residual.

Basic smoothers are of the form

xk+1 = xk + M−1rk ,

rk+1 = (I − AM−1)rk ,

ek+1 = (I −M−1A)ek ,

where

r0

M = ω−1I , for relaxed Richardson,

M = ω−1D, for relaxed Jacobi,

M = ω−1D + L, for relaxed Gauß-Seidel (SOR).

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 6 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Smoothing

Reduces the high frequency components of the error/residual.

Basic smoothers are of the form

xk+1 = xk + M−1rk ,

rk+1 = (I − AM−1)rk ,

ek+1 = (I −M−1A)ek ,

where

r1

M = ω−1I , for relaxed Richardson,

M = ω−1D, for relaxed Jacobi,

M = ω−1D + L, for relaxed Gauß-Seidel (SOR).

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 6 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Smoothing

Reduces the high frequency components of the error/residual.

Basic smoothers are of the form

xk+1 = xk + M−1rk ,

rk+1 = (I − AM−1)rk ,

ek+1 = (I −M−1A)ek ,

where

r2

M = ω−1I , for relaxed Richardson,

M = ω−1D, for relaxed Jacobi,

M = ω−1D + L, for relaxed Gauß-Seidel (SOR).

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 6 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Smoothing

Reduces the high frequency components of the error/residual.

Basic smoothers are of the form

xk+1 = xk + M−1rk ,

rk+1 = (I − AM−1)rk ,

ek+1 = (I −M−1A)ek ,

where

r3

M = ω−1I , for relaxed Richardson,

M = ω−1D, for relaxed Jacobi,

M = ω−1D + L, for relaxed Gauß-Seidel (SOR).

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 6 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Smoothing

Reduces the high frequency components of the error/residual.

Basic smoothers are of the form

xk+1 = xk + M−1rk ,

rk+1 = (I − AM−1)rk ,

ek+1 = (I −M−1A)ek ,

where

r4

M = ω−1I , for relaxed Richardson,

M = ω−1D, for relaxed Jacobi,

M = ω−1D + L, for relaxed Gauß-Seidel (SOR).

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 6 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Smoothing

Reduces the high frequency components of the error/residual.

Basic smoothers are of the form

xk+1 = xk + M−1rk ,

rk+1 = (I − AM−1)rk ,

ek+1 = (I −M−1A)ek ,

where

r5

M = ω−1I , for relaxed Richardson,

M = ω−1D, for relaxed Jacobi,

M = ω−1D + L, for relaxed Gauß-Seidel (SOR).

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 6 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Smoothing

Reduces the high frequency components of the error/residual.

Basic smoothers are of the form

xk+1 = xk + M−1rk ,

rk+1 = (I − AM−1)rk ,

ek+1 = (I −M−1A)ek ,

where

Rr5

M = ω−1I , for relaxed Richardson,

M = ω−1D, for relaxed Jacobi,

M = ω−1D + L, for relaxed Gauß-Seidel (SOR).

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 6 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Restriction and Prolongation

Transfer functions (solutions) and functionals (right hand sides)between two grids.

V ′1

R

V ′0

U1

P

U0

Prolongation: Interpolate a function from U0 to U1. SinceU0 ⊂ U1 it is obvious to use the injection iU : U0 → U1 for P.

Restriction: Restrict a functional from V ′1 to V ′0. Since V0 ⊂ V1 itseems to be natural to use the restriction iV for R (i.e.Rr = r iV with the injection iV : V0 → V1).

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 7 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Multigrid IdeaSmoothingRestriction and ProlongationMultigrid and FEniCS

Multigrid and FEniCS

FEniCS already comes with some algebraic multigrid (AMG)preconditioners via PETSc (Hypre, Sandia ML).

Difference between AMG and GMG

AMG preconditioners only get the matrix A1 and derive some A0,P, R, etc. from this matrix (black box solver). In contrast toGMG, AMG does not use information about the FE-spaces, whichis actually available in FEniCS.

Since it is very easy to construct problem hierarchies in FEniCS, itis very reasonable to use GMG methods in FEniCS.

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 8 / 31

Implementation

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

OverviewClassesCode Examples (C++)

Features

language: C++

easily useable and extendable

relatively fast

works for all nested FE-families in FEniCS (excludesCrouzeix-Raviart)

can be used as iterative multigrid solver and preconditioner forKrylov-subspace methods (CG, MINRES, ...)

supports uniform and local mesh refinement

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 9 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

OverviewClassesCode Examples (C++)

Classes

MultigridPreconditionedKrylovSolver

MultigridPreconditioner

MultigridSolver

GenericLinearSolver MultigridProblem

MultigridLevel

R P A b x e . . .

PETScUserPreconditioner

PETScKrylovSolver

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 10 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

OverviewClassesCode Examples (C++)

Code Examples (C++)

How to do it with DOLFIN

. . .L i n e a r V a r i a t i o n a l P r o b l e m problem ( a , L , u , bc ) ;L i n e a r V a r i a t i o n a l S o l v e r s o l v e r ( problem ) ;s o l v e r . s o l v e ( ) ;p l o t ( problem . s o l u t i o n ( ) ) ;. . .

Using FMG

#i n c l u d e <fmg . h>. . .L i n e a r V a r i a t i o n a l P r o b l e m problem ( a , L , u , bc ) ;fmg : : M u l t i g r i d P r e c o n d i t i o n e d K r y l o v S o l v e r s o l v e r ( problem , 4 ) ;s o l v e r . s o l v e ( ) ;p l o t ( s o l v e r . s o l u t i o n ( ) ) ;. . .

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 11 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

OverviewClassesCode Examples (C++)

Code Examples (C++)

Advanced Example

. . .L i n e a r V a r i a t i o n a l P r o b l e m problem ( a , L , u , bc ) ;fmg : : M u l t i g r i d P r o b l e m mg problem ( problem ) ;mg problem . adapt ( ) ;mg problem . adapt ( ) ;. . .

fmg : : M u l t i g r i d S o l v e r m g s o l v e r ( mg problem ) ;m g s o l v e r . p a r a m e t e r s [ "pre_smoother" ] = "jacobi" ;m g s o l v e r . p a r a m e t e r s [ "pre_smoother_relax" ] = 0 . 6 ;m g s o l v e r . p a r a m e t e r s [ "post_smoother" ] = "jacobi" ;m g s o l v e r . p a r a m e t e r s [ "post_smoother_relax" ] = 0 . 6 ;m g s o l v e r . p a r a m e t e r s [ "coarse_solver_type" ] = "lu" ;s o l v e r . s o l v e ( ) ;. . .

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 12 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

OverviewClassesCode Examples (C++)

Code Examples (C++)

Performance Testing

. . .L i n e a r V a r i a t i o n a l P r o b l e m problem ( a , L , u , bc ) ;

fmg : : T e s t s t e s t s ( problem ) ;

t e s t s . p a r a m e t e r s [ "test_solver" ] = "cg+fmg ,cg+hypre_amg" ;t e s t s . p a r a m e t e r s [ "test_smoothers" ] = "jacobi@0.6,fsor+bsor" ;t e s t s . p a r a m e t e r s [ "num_refinements" ] = 4 ;t e s t s . p a r a m e t e r s . p a r s e ( argc , a r g v ) ;

t e s t s . run ( ) ;

Command line call:./main --num_refinements 5 --table_format latex

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 13 / 31

Numerical Results

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Numerical Results

Comparison of

FMG GMG,

Hypre AMG (PETSc preconditioner),

ML AMG (PETSc preconditioner),

as a preconditioner for CG/MINRES in terms of

setup time (initialization of the coarse grid problems and gridtransfer operators),

solve time,

number of iterations

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 14 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Numerical Results

1 Poisson problem (2D)

2 linear Elasticity (3D)

3 Stokes problem (2D)

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 15 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Poisson Problem (2D)

Poisson problem with mixed boundary conditions (FEniCS demo):

−∆u = f in Ω,

u = 0 on ΓD ,

∂u

∂n= g on ΓN ,

where

Ω = (0, 1)× (0, 1),

ΓD = (x , y) ∈ ∂Ω : x = 0 ∨ x = 1,ΓN = ∂Ω \ ΓD ,

f (x , y) = 10 exp(−((x − 0.5)2 + (y − 0.5)2)/0.02),

g(x , y) = sin(5x).

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 16 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Poisson Problem (2D)

Test Parameters

discretization: P1, P2, P3 and P4 Lagrange-Elements

coarse grid: 12x12 (P1), 6x6 (P2), 4x4 (P3), 3x3 (P4)UnitSquare

8 refinements

symmetric Gauss-Seidel smoother (SSOR with ω = 1)

V-cycle scheme

termination criteria for PCG: ||C−1r ||/||C−1b|| < 10−6

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 17 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Normalized Setup Time / DOF (P1)

0

0.5

1

1.5

2

100 1000 10000 100000 1e+06 1e+07

Norm

aliz

ed S

etu

p T

ime / D

OF

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 18 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Normalized Setup Time / DOF (P2)

0

0.5

1

1.5

2

100 1000 10000 100000 1e+06 1e+07

Norm

aliz

ed S

etu

p T

ime / D

OF

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 18 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Normalized Setup Time / DOF (P3)

0

0.5

1

1.5

2

100 1000 10000 100000 1e+06 1e+07

Norm

aliz

ed S

etu

p T

ime / D

OF

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 18 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Normalized Setup Time / DOF (P4)

0

0.5

1

1.5

2

100 1000 10000 100000 1e+06 1e+07

Norm

aliz

ed S

etu

p T

ime / D

OF

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 18 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Normalized Solve Time / DOF (P1)

0

2

4

6

8

10

100 1000 10000 100000 1e+06 1e+07

Norm

aliz

ed S

olv

e T

ime / D

OF

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 19 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Normalized Solve Time / DOF (P2)

0

2

4

6

8

10

100 1000 10000 100000 1e+06 1e+07

Norm

aliz

ed S

olv

e T

ime / D

OF

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 19 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Normalized Solve Time / DOF (P3)

0

2

4

6

8

10

100 1000 10000 100000 1e+06 1e+07

Norm

aliz

ed S

olv

e T

ime / D

OF

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 19 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Normalized Solve Time / DOF (P4)

0

2

4

6

8

10

100 1000 10000 100000 1e+06 1e+07

Norm

aliz

ed S

olv

e T

ime / D

OF

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 19 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Number of PCG Iterations (P1)

0

5

10

15

20

25

30

100 1000 10000 100000 1e+06 1e+07

Num

ber

of P

CG

Inte

rations

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 20 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Number of PCG Iterations (P2)

0

5

10

15

20

25

30

100 1000 10000 100000 1e+06 1e+07

Num

ber

of P

CG

Inte

rations

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 20 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Number of PCG Iterations (P3)

0

5

10

15

20

25

30

100 1000 10000 100000 1e+06 1e+07

Num

ber

of P

CG

Inte

rations

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 20 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Number of PCG Iterations (P4)

0

5

10

15

20

25

30

100 1000 10000 100000 1e+06 1e+07

Num

ber

of P

CG

Inte

rations

DOFs

FMG GMGHypre AMG

ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 20 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Linear Elasticity (3D)

div(σ(u)) + f = 0 in Ω,

σ(u) · n = 0 on ΓN ,

u = 0 on ΓD ,

with isotropic material law

σ(u) = 2µ ε(u) + λ tr(ε(u)) I ,

and with the deformation

ε(u) =1

2

(grad(u) + grad(u)T

).

(λ, µ > 0: Lame parameters)

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 21 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Linear Elasticity (3D)

Test Parameters

Ω = a3 \ (a× b2 ∪ b × a× b ∪ b2 × a)

a = (0, 1), b = (1/6, 5/6)

f (x , y , z) = ~ez

−10 exp(2z + y) : x ≥ 5/6

0 : else

ΓD = (x , y , z) ∈ Ω : x = 0

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 22 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Deformation (Refinement 0)

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 23 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Deformation (Refinement 1)

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 23 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Deformation (Refinement 2)

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 23 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Deformation (Refinement 3)

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 23 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Solve Time and Number of PCG Iterations (P2)R

efin

emen

ts

DO

Fs

FM

GG

MG

Iter

ati

on

s

FM

GG

MG

So

lve

Tim

e

Hyp

reA

MG

Iter

ati

on

s

Hyp

reA

MG

So

lve

Tim

e

ML

AM

GIt

era

tio

ns

ML

AM

GS

olv

eT

ime

0 2 268 1 0.0357 64 0.353 94 0.198

1 12 900 7 0.102 113 8.33 193 2.55

2 84 564 7 0.703 218 215. 398 50.5

3 606 900 8 6.11

4 4 586 868 8 48.3

AMG does not work well for this problem!?

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 24 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Stokes Problem (2D)

−µ∆u +∇p = f in Ω,

∇ · u = 0 in Ω,

u = g on ΓD ,

results into the saddle point problem

a(u, v) + b(v , p) = f (v) ∀ v ∈ H10 (Ω)2,

b(u, q) = 0 ∀ q ∈ L2(Ω)/R,

where

a(u, v) = µ

∫Ω∇u : ∇v dx ,

b(v , p) = −∫

Ωp∇ · v dx , f (v) =

∫Ωf v dx .

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 25 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Stokes Problem (2D)

linear system of equations (Taylor-Hood elements):(A BT

B 0

)(up

)=

(b0

)MINRES preconditioning:

C =

(A 00 M

)M: mass matrix for pressure

M-block: LU-decomposition (small matrix)A-block: LU-decomposition, FMG GMG, Hypre AMG, ML AMG

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 26 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Stokes Problem (2D)

u = 0

u = 0

do nothingu = g

Test Parameters

Ω = ((0, 1)× (0.3, 0.7)) \ (T1 ∪ T2),

ΓD = ∂Ω \ (1 × (0.3, 0.7)),

g(x , y) =

(cos2(π(y − 0.5)/0.4), 0)T fur x = 0(0, 0)T sonst.

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 27 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Solution (Velocity)

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 28 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Solution (Pressure)

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 28 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Normalized Solve Time / DOF

0

0.5

1

1.5

2

2.5

3

100 1000 10000 100000 1e+06 1e+07

Norm

aliz

ed S

olv

e T

ime / D

OF

DOFs

FMG GMGHypre AMG

ML AMGLU

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 29 / 31

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Poisson Problem (2D)Linear Elasticity (3D)Stokes Problem (2D)

Number of PCG Iterations

50

60

70

80

90

100

110

120

130

100 1000 10000 100000 1e+06 1e+07

Num

ber

of P

CG

Inte

rations

DOFs

FMG GMGHypre AMG

ML AMGLU

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 30 / 31

Conclusion and Outlook

Introduction to Geometric Multigrid (GMG)Implementation

Numerical ResultsConclusion and Outlook

Conclusion and Outlook

GMG works very well.

Things to do:

reduce the solver setup time,

enable parallel computing (prolongation, restriction),

Python support (SWIG),

customized smoothers,

block preconditioning,

FAS (nonlinear) multigrid,

demos with mesh adaptivity,

...

Felix Ospald (CUT) Implementation of a Geometric Multigrid Method for FEniCS and its Application 3/18/2013 31 / 31

Thank you for your attention!

http://launchpad.net/fmg

top related