Linear solvers for large algebraic systems from structural...

39
October 23, 2008 1 Linear solvers for large algebraic systems from structural mechanics Symposium of Advances in Contact Mechanics: a tribute to Prof J. J. Kalker Delft / EWI prof. dr. ir. C. Vuik Department of Applied Mathematical Analysis

Transcript of Linear solvers for large algebraic systems from structural...

Page 1: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

October 23, 2008

1

Linear solvers for large algebraic systems from structural mechanicsSymposium of Advances in Contact Mechanics: a tribute to Prof J. J. Kalker

Delft / EWI

prof. dr. ir. C. Vuik

• Department of Applied Mathematical Analysis

Page 2: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

September 23, 2008 2

Outline• Structural mechanics

• Computational framework• Finite element discretization

• Numerical linear algebra• Overview numerical methods for linear systems• Parallel direct solver• Combining methods to create new solver

• Test case• Discussion

Page 3: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

• Forces should be in balance,

internal force , external force ,gravitation

• Residual when out of balance,

How to compute deformation?Force balance

3

!

!div(!) + f ! "gd! =0

r = div(!) + f ! "g

!g

f

Page 4: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

• Define virtual work,

• Equilibrium

How to compute deformation?Virtual work

4

Page 5: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

How to compute deformation?Linearized virtual work

• First order Taylor,

• Linearized virtual work

5

Page 6: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

How to compute deformation?Material response

• Three material properties,• (Hyper) elasticity• Plasticity (permanent deformation)• Viscosity (permanent deformation)

6

Page 7: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

How to compute deformation?Non-linear material response

7

Page 8: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Finite element discretizationFE mesh

8

Page 9: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Finite element discretizationTetrahedral elements

9

• Introduce local coordinatesystem,

• Transformation betweenlocal and globalcoordinates,

(x, y, z)! (!, ", #)

d

d!= J

d

dx

Page 10: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Finite element discretizationShape functions

• 1D Example with linear shape functions,

• For 3D case,

• For stability and accuracyhigher order shape functions necessary

10

Page 11: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Finite element discretizationNumerical integration

• Use Gauss point(s) for numerical integration,

11

!

!fd!=̃f (!g, "g, #g) |J |

!

!d!

Page 12: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Finite element discretizationStiffness matrix

• Discretized, linearized virtual work,

12

K!u = fext ! fint

Page 13: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Finite element discretizationStiffness matrix

13

• Properties of ,• Symmetric• Positive definite• Sparse• No specific pattern of non-zero matrix entries• Large differences in entry values due to material

properties• Changes due to non-linear material properties

Page 14: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

How to compute deformation?Balancing of forces algorithm

14

MESH

Material Models

Assemble,

Solve,

Compute internal force (Newton-Raphson)

Apply load

Newton-Raphson

Newmark (dynamic)

Linear solver

Page 15: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Problems with algorithmScale

15

Numberofelements:1.890.057

Numberofnodes:307.735

Numberofnonzeroelementsins:ffnessmatrix:21.296.523

Page 16: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Problems with algorithmAccuracy and approximation

16

Page 17: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Numerical methodsOverview

• (Parallel) Direct solver• Iterative solvers,

• Preconditioning• CG method• Deflation, Domain Decomposition of Multigrid?

17

Page 18: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Parallel direct solverDefinition

18

• Direct solver,

• Matrix cannot be singular or ill conditioned, this leads to inaccurate solutions

• Large (3D) models yield large linear systems, serial direct solvers lack CPU power and memory

x = A!1b

Page 19: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Parallel direct solverMUMPS

19

• Solution? Go parallel! Spread work over computing nodes. Adding more nodes implies more CPU power and memory.

• MUMPS project: public domain package and developed by CERFACS, graal.ens-lyon.fr/MUMPS/

Page 20: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Parallel direct solverMUMPS

20

Page 21: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

• Solve,

• Use sequence of approximations of solution ,

where,

• Choice of defines iterative method

Iterative methodsBasics

21

Ax = bx

x0, x1, x2, ..., xk

xk+1 = xk + M!1 (b!Axk)M

Page 22: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Iterative methodsAvailable methods

22

• Splitting based methods ( ),• Jacobi• Gauss-Seidel • SSOR

• Krylov subspace methods• CG• GMRES

• Multigrid

M = N !A

Page 23: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

• Condition number,

• For (symmetric) SPD matrices,

• Improve condition of matrix,

Iterative methodsPreconditioning

23

M!1Ax = M!1b

!p(A) =|"max||"min|

Page 24: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Iterative methodsPreconditioning

• Preconditioner is approximation of original matrix • Matrix can be any constant linear solver• Many choices,

• Incomplete LU or Cholesky decomposition,• Basic iterative methods (GS, Jacobi)• Multigrid• Domain decomposition• Deflation

24

M

Page 25: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Iterative methodsConjugate gradient (CG)

• Krylov subspace,

• Good performance for well conditioned SPD matrices• Slow converging components corresponds to smallest

eigenvalues of A• Preconditioner necessary for ill conditioned systems

25

x0 + span!

M!1r0, M!1A

"M!1r0

#, ...,

"M!1A

#i!1 "M!1r0

#$

Page 26: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Iterative methodsMultigrid

• Idea: Approximation of (smooth) error of the solution on coarser grids. Back propagate error to fine grid:

• Benefit: Reduction of size the system that has to be solved with direct solver.

26

Ax = b! !x = x" x̃

rh = Ah!xh ! IHh ! rH = AH!xH

x̃k+1h = x̃k

h + IhH!xH

Page 27: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Iterative methodsMultigrid

• How to choose grid operators ?

• How to choose coarse grid cells on unstructured grids?

27

IHh , Ih

H

Page 28: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Iterative solversDomain decomposition

• Divide large problem into subdomains, divide work load and easy parallelizable.

• Rewrite original system,

where correspond to interface nodes28

!i, !i " {1, 2, ..., s}

A

!xy

"=

!fg

"with A =

!B EF C

"

y,g

Page 29: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Iterative solversDomain decomposition

• Schur complement ,

• Solve and obtain from,

29

!C ! FB!1E

"y = g ! FB!1f

Sy = g"

S

y xx = B!1 (f ! Ey)

Page 30: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Iterative solversDomain decomposition

• How to choose subdomains?

• How to solve on subdomains?

30

Page 31: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

• Filter out the eigenvalues that belong to the slow converging components of for e.g. the CG method

• Deflation components,

Iterative solversDeflation

31

Z ! Rn!k, k < n" d, deflation subspace matrixE = ZT AZ ! Rk!k, inversion Galerkin matrix or coarse matrixQ = ZE"1ZT ! Rn!n, correction matrixP = I "AQ ! Rn!n, deflation matrixPAx = Pb

d, number of zero eigenvaluesk, number of deflation vectors

Page 32: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Iterative solversDeflation

• Preferably the deflation vectors are the eigenvectors corresponding to the smallest eigenvalues (think of condition number)

• Computation of deflation vectors is expensive, use approximations,• Physical : interface elements with high

discontinuities• Analytical : use information CG, previous time

steps, FE discretization etc.

32

Page 33: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Hybrid solverCombining numerical methods

33

Page 34: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Test caseCompression

34

Page 35: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Test caseCompression

35

Page 36: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Test caseDeflation + CG + preconditioning

36

Page 37: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Test caseDeflation + CG + preconditioning

37

Page 38: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

Future researchPeople

38

• Civil Engineering (group Scarpas),• A. Scarpas• C. Kasbergen

• Applied Mathematics (group Vuik),• C. Vuik• M.B van Gijzen• T.B Jönsthövel

Page 39: Linear solvers for large algebraic systems from structural ...ta.twi.tudelft.nl/nw/users/vuik/talks/kalker_2008.pdf · Parallel direct solver Definition 18 • Direct solver, •

DiscussionQ+A

39