OnSpatialDistributionoftheDiscretizationand ...OnSpatialDistributionoftheDiscretizationand...

Post on 06-Apr-2020

5 views 0 download

Transcript of OnSpatialDistributionoftheDiscretizationand ...OnSpatialDistributionoftheDiscretizationand...

On Spatial Distribution of the Discretization andAlgebraic Error in Numerical Solution of Partial

Differential Equations

Jan Papež Zdeněk Strakoš

Charles University, Prague, Czech Republic,

and

Academy of Sciences of the Czech Republic, Prague, Czech Republic

SIAM Annual Meeting, July 8, 2013Implicitly Constituted Fluids and Solids: Modelling and Analysis

Outline

1. Introduction

2. Errors in the simplest 1D model problem and their analysis

3. Locality of the errors in 2D examples

4. Conclusions

1. Introduction

Real-world problem

↓ modelling

↓ error of the model

Mathematical model, solution u

↓ discretization

↓ discretization error

Discretized problem, discrete solution uh, uh = Φx, Ax = b

↓ algebraic solution

↓ algebraic error (truncation + roundoff)

Approximation x ≈ x, uh ≈ uh, uh = Φx

1. Introduction

u − uh︸ ︷︷ ︸total error

= u − uh︸ ︷︷ ︸discretization error

+ uh − uh︸ ︷︷ ︸algebraic error

FEM discretizationInfinite dimensional problem in Ω

↓ basis functions with local support

sparse system matrix

↓ algebraic solver

coefficients for the global approximation uh ≈ uh

What is the distribution of the algebraic error in the functionalspace?

1. Introduction

u − uh︸ ︷︷ ︸total error

= u − uh︸ ︷︷ ︸discretization error

+ uh − uh︸ ︷︷ ︸algebraic error

FEM discretizationInfinite dimensional problem in Ω

↓ basis functions with local support

sparse system matrix

↓ algebraic solver

coefficients for the global approximation uh ≈ uh

What is the distribution of the algebraic error in the functionalspace?

1. Introduction

u − uh︸ ︷︷ ︸total error

= u − uh︸ ︷︷ ︸discretization error

+ uh − uh︸ ︷︷ ︸algebraic error

FEM discretizationInfinite dimensional problem in Ω

↓ basis functions with local support

sparse system matrix

↓ algebraic solver

coefficients for the global approximation uh ≈ uh

What is the distribution of the algebraic error in the functionalspace?

2. 1D Poisson problem (on purpose!)

−u′′(x) = f (x) , x ∈ (0, 1)

u(0) = u(1) = 0

with the solution

u(x) = exp(−5(x − 0.5)2)− exp(−5/4) ,

see Eriksson et al. (1995).

Discretized using the piecewise linear basis functions on uniformmesh with 19 inner nodes (i.e. with the mesh size h = 1/20).

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−0.2

0

0.2

0.4

0.6

0.8

1

1.2

2. 1D problem - solution, discretization error

0 0.2 0.4 0.6 0.8 1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0 0.2 0.4 0.6 0.8 1−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

3

3.5x 10

−3

The exact solution u (left) and the discretization error u − uh(right); the right vertical axis is scaled by 10−3.

2. 1D problem - error norms

Simple consequence of the Galerkin orthogonality, u(n)h = Φxn,

‖(u − u(n)h )′‖2 = ‖(u − uh)′‖2 + ‖(uh − u(n)

h )′‖2

= ‖(u − uh)′‖2 + ‖x− xn‖2A .

Discretization error‖(u − uh)′‖2 = 6.8× 10−3

Algebraic error (at the 9th iteration of CG with x0 = 0)‖x− x9‖2A = 1.2× 10−3

Total error‖(u − u(9)

h )′‖2 = 8.0× 10−3

2. 1D problem - algebraic and total error

0 0.2 0.4 0.6 0.8 1−5

−4

−3

−2

−1

0

1

2

3

4

5x 10

−3

The algebraic error uh − u(9)h (dashed-dotted line) is strongly

localized in the middle of the domain and substantially affects theshape of the the total error u − u(9)

h (solid line).

Recall‖x− x9‖A < ‖(u − uh)′‖ !

2. Analysis of the algebraic error

λ1 < . . . < λ19 eigenvalues of Ayi normalized eigenvector of A corresponding to λi

spectral decomposition of error x− xk

x− xk =19∑i=1

(x− xk , yi ) yi

(x− xk , yi ) ith spectral component of the error x− xk

2. Spectral components of the algebraic error

1 3 5 7 9 11 13 15 17 1910

−10

10−8

10−6

10−4

10−2

100

102

init erroriteration #7iteration #8iteration #9

0 10 20 30 40 50 60 70 80

1

2

3

4

5

6

7

8

9

10

itera

tion

num

ber

eigenvaluesRitz values

Development of the squared size of the spectral components of theerror (left), the convergence of Ritz values to the eigenvalues of A(right).

The (irregular) spatial distribution of algebraic error u − u(9)h is

caused by the nonuniform changes in the spectral components.

2. Interpretation of the error

We need fully computable a posteriori error bounds (no hiddenconstants) which are:

I Locally efficient,I and allow to compare the local contribution of the

discretisation error and the algebraic error to the total error.

Interpretation of the error:

I Functional backward error (perturbation of the bilinear form)modifies the problem to be solved.

I Projecting the backward error into the FEM basis makes thebasis functions non-local.

2. Loss of locality

Consider the transformation of the FEM basis functionsΦ = [ϕ1, . . . , ϕn] (in the model problem the continuous piecewiselinear hat functions) to the basis Φ = [ϕ1, . . . , ϕn] represented bya square matrix D ∈ Rn×n , D = [D`j ] ,

ϕj = ϕj +n∑`=1

D`j ϕ` , j = 1, . . . , n .

or, in the compact form

Φ = Φ (I + D) ,

where D accounts for the numerical errors in solving thediscretized finite dimensional algebraic problem.

Gratton, Jiránek, and Vasseur (2012); P, Liesen, Strakoš (2013)

2. Loss of locality - meaning of D

We look for D such that the Galerkin solution

uh = Φx , Ax = b , Aji = a(ϕi , ϕj)

of the discretized formulation

a(uh, ϕi ) = `(ϕi ), i = 1, . . . , n

can be expressed as the Petrov-Galerkin solution

uh = Φx = Φ(I + D)x , Ax = b , Aji = a(ϕi , ϕj)

of the same discretized formulation

a(uh, ϕi ) = `(ϕi ), i = 1, . . . , n .

2. Petrov - Galerkin discretization

In the second case, the variational formulation is discretized via thetransformed basis functions

Φ = Φ(I + D)

and the original test functions ϕi , i = 1, . . . , n, which results inthe matrix of the linear algebraic system

A = A (I + D) .

Here the algebraic vector x which approximates x solves exactlythe algebraic system determined by the Petrov-Galerkindiscretization of the infinite dimensional problem.

2. Determining D in (A + AD) x = b

Using the algebraic backward error we immediately get that thegiven approximate solution x of Ax = b solves exactly theperturbed algebraic system

(A + E) x = b , where E =(b− Ax) xT

‖x‖2.

This finally gives

AD = E i.e. D = A−1E .

Other choices of E are possible, but with no effect to the mainpoint.

2. Transformed FEM basis has global support

05

1015

20 0

5

10

15

20−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

x 10−3

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−1.5

−1

−0.5

0

0.5

1

1.5x 10

−3

MATLAB surf plot of the transformation matrix D (left) and thedifference ϕj − ϕj (right) for x ≡ x8.

3. 2D case, L-shape problem

−∆u = 0 in Ω , u = uD on ∂Ω ,

in L-shaped domain

Ω ≡ (−1, 1)× (−1, 1) \ (0, 1)× (−1, 0)

with the solution (given in polar coordinates)

u(r , θ) = r2/3 sin(23θ

);

see, e.g., Luce and Wohlmuth (2004), Ainsworth (2005).

3. L-shape problem - solution

−1 −0.5 0 0.5 1 −1

0

1

0

0.2

0.4

0.6

0.8

1

1.2

1.4

−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

The solution u of the L-shape problem (left),the adaptively refined mesh with 1738 nodes (right).

3. Problem with inhomogeneous diffusion tensor

−∇ · (S∇u) = 0 in Ω ,

u = uD on ∂Ω .

in domain Ω ≡ (−1, 1)× (−1, 1) divided into four subdomains Ωiwith the solution (given in polar coordinates)

u(r , θ)|Ωi = rα(ai sin(αθ) + bi cos(αθ)) .

see, e.g., Rivière, Wheeler, and Banas (2000),Jiránek, Strakoš, and Vohralík (2010).

3. Problem with inhomogeneous diffusion tensor

The diffusion tensor S|Ωi = si I. The diffusion coefficients arechosen s1 = s3 = 100, s2 = s4 = 1.

−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

s4=1

s2=1

s3=100

s1 = 100

3. Problem with inhomogeneous diffusion tensor - solution

−1 −0.5 0 0.5 1−1

0

1

−1.5

−1

−0.5

0

0.5

1

1.5

−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

The solution u of the problem with inhomogeneous diffusiontensor (left), the adaptively refined mesh with 3589 nodes (right).

3. 2D examples - discretization

We consider a sequence of adaptively refined meshes. On a givenmesh we discretize the problem using the piecewise linear basisfunctions with local support (hat-functions).

Adaptive refinement by Adaptive Finite Element Method

SOLVE - the discretized system is solved using the MATLABbackslash solver (Cholesky decomposition)

ESTIMATE - the local discretization error is estimated using theresidual-based local error estimator

MARK - marking the elements using the greedy-algorithm;see, e.g.,Carstensen, Merdon (2010)

REFINE - refinement by Newest-Vertex-Bisection, seeMorin, Nochetto, and Siebert (2000)

3. 2D examples - discretization

We consider a sequence of adaptively refined meshes. On a givenmesh we discretize the problem using the piecewise linear basisfunctions with local support (hat-functions).

Adaptive refinement by Adaptive Finite Element Method

SOLVE - the discretized system is solved using the MATLABbackslash solver (Cholesky decomposition)

ESTIMATE - the local discretization error is estimated using theresidual-based local error estimator

MARK - marking the elements using the greedy-algorithm;see, e.g.,Carstensen, Merdon (2010)

REFINE - refinement by Newest-Vertex-Bisection, seeMorin, Nochetto, and Siebert (2000)

3. L-shape problem

Final mesh with 1738 nodes.

Discretization error‖∇(u − uh)‖2 = 4.8× 10−4

Algebraic error (at the 73th iteration of CG with x0 = 0)‖∇(uh − u(73)

h )‖2 = 3.6× 10−6

Total error‖∇(u − u(73)

h )‖2 = 4.8× 10−4

For the purpose of the numerical experiments we substitute for the(unknown) algebraic exact solution x the MATLAB backslashsolution.

3. Discretization and algebraic error

−1 −0.5 0 0.5 1 −1

0

1

−6

−4

−2

0

2

4

6

x 10−4

−1 −0.5 0 0.5 1 −1

0

1

−6

−4

−2

0

2

4

6

x 10−4

MATLAB trisurf plot of the discretization error u − uh (left),algebraic error uh − u(73)

h (right).

3. Discretization and total error

−1 −0.5 0 0.5 1 −1

0

1

−6

−4

−2

0

2

4

6

x 10−4

−1 −0.5 0 0.5 1 −1

0

1

−6

−4

−2

0

2

4

6

x 10−4

MATLAB trisurf plot of the discretization error u − uh (left)and of the total error u − u(73)

h (right).

3. Problem with inhomogeneous diffusion tensor

Final mesh with 3589 nodes.

Discretization error‖S1/2∇(u − uh)‖2 = 4.7× 10−1

Algebraic error (at the 217th iteration of CG with x0 = 0)‖S1/2∇(uh − u(217)

h )‖2 = 4.5× 10−3

Total error‖S1/2∇(u − u(217)

h )‖2 = 4.7× 10−1

3. Discretization and algebraic error

−1 −0.5 0 0.5 1−1

0

1

−0.01

−0.005

0

0.005

0.01

−1 −0.5 0 0.5 1−1

0

1

−0.01

−0.005

0

0.005

0.01

MATLAB trisurf plot of the discretization error u − uh (left),algebraic error uh − u(217)

h (right).

3. Discretization and total error

−1 −0.5 0 0.5 1−1

0

1

−0.01

−0.005

0

0.005

0.01

−1 −0.5 0 0.5 1−1

0

1

−0.01

−0.005

0

0.005

0.01

MATLAB trisurf plot of the discretization error u − uh (left)and of the total error u − u(217)

h (right).

Conclusions

Spatial distribution of the algebraic error should be taken intoaccount when solving (large scale) mathematical modellingproblems in general.

In particular, for the FEM discretization:

I distribution of the algebraic error may significantly differ fromthe distribution of the discretization error;

I global values (norms) give no information about the localbehavior of errors;

I stopping criteria for (iterative) algebraic solvers should berelated to the spatial distribution of the total error in thefunctional space.

Acknowledgement and references

Acknowledgementthe work has been supported by the ERC-CZ project LL1202 and bythe GAUK grant 695612.

ReferencesJ. Liesen, Z. Strakoš.Principles and Analysis of Krylov Subspace Methods, Chapter 5.Oxford University Press.

J. Papež, J. Liesen, Z. StrakošDistribution of the discretization and algebraic error in numerical solutionof partial differential equations.Preprint MORE/2012/03, submitted for publication.

References

M. Arioli, J. Liesen, A. Międlar, and Z. Strakoš,Interplay between discretization and algebraic computation in adaptivenumerical solution of elliptic PDE problems.to appear in GAMM Mitteilungen.

R. Becker, C. Johnson, and R. Rannacher,Adaptive error control for multigrid finite element methods.Computing, 55 (1995), no. 4, pp. 271–288.

A. Ern and M. Vohralík,Adaptive inexact Newton methods with a posteriori stopping criteria fornonlinear diffusion PDEs.to appear in SIAM J. Sci. Comput.

P. Jiránek, Z. Strakoš, and M. Vohralík,A posteriori error estimates including algebraic error and stopping criteriafor iterative solvers,SIAM J. Sci. Comput., 32 (2010), pp. 1567–1590.

The end

Thank you for your attention!