method of finite elements i: demo 2: numerical integration · numerical integration the computation...

38
Adrian Egger Method of Finite Elements I: Demo 2: Numerical Integration

Upload: others

Post on 18-Sep-2019

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Adrian Egger

Method of Finite Elements I:

Demo 2: Numerical Integration

Page 2: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Contents

Part 1: Euler Bernoulli Beam Element Galerkin formulation

Example

Part 2: Numerical Integration Gaussian Quadrature

Computer Implementation

Part 3: Basics of Stress Recovery and Error Estimators Inter-element continuity

Back-calculation of stresses and strains

Super-Convergent Patch Recovery

5/6/2015 2Adrian Egger | FEM I | FS 2015

Page 3: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

From strong to weak form

Principle of Virtual Work

Principle of Minimum Potential Energy

Methods of weighted residuals

(Galerkin, Collocation, Least Squares methods, etc)

5/6/2015 3Adrian Egger | FEM I | FS 2015

Page 4: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Beam Theory: Strong form

5/6/2015 4Adrian Egger | FEM I | FS 2015

Boun

dary

conditio

ns

Page 5: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

From Strong to Weak form I

Galerkin approach for equations (1), (4), (5):1. Multiply by weighting function w

2. Integrate over the domain

3. Discretize and sum the contributions of each element in domain

5/6/2015 5Adrian Egger | FEM I | FS 2015

Page 6: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

From Strong to Weak form II

Apply the divergence theorem: Equivalent to integration by parts in 1D

5/6/2015 6Adrian Egger | FEM I | FS 2015

Page 7: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Beam Theory: Weak form

5/6/2015 7Adrian Egger | FEM I | FS 2015

𝑤 = 𝐻𝑖𝑤𝑖

𝑣 = 𝐻𝑖𝑣𝑖

Due to the second order derivatives on the weak form,

Shape functions must be at least twice differentiable.

This mandates Cm-1 = C2-1 = C1-continuity,

i.e. continuity also of the derivatives.

Discretization of weight and trial functions:

Page 8: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Finite Element formulation

5/6/2015 8Adrian Egger | FEM I | FS 2015

Page 9: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Choice of Shape Functions

5/6/2015 9Adrian Egger | FEM I | FS 2015

Page 10: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Jacobian

5/6/2015 10Adrian Egger | FEM I | FS 2015

Page 11: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Curvature-Displacement Matrix B

5/6/2015 11Adrian Egger | FEM I | FS 2015

-2

𝜅 𝑥, 𝑦, 𝑧 = 𝐵 𝑟, 𝑠, 𝑡 ,𝑥𝑥 ∗ 𝑢(𝑥, 𝑦, 𝑧)

This is why the Jacobian is necessary!

Page 12: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Derivation by Computer Algebra System (CAS)

5/6/2015 12Adrian Egger | FEM I | FS 2015

Page 13: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Resulting Matrices

5/6/2015 13Adrian Egger | FEM I | FS 2015

Page 14: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Example: Pre-processing

5/6/2015 14Adrian Egger | FEM I | FS 2015

6

5

4

3

2

1

[N,m]

Definition of:

Nodes, Elements,

Boundary Conditions and

Material properties, etc.

Assign:

DOF identifiers

Analytical model:

Page 15: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Example: Solver Stiffness Matrix

5/6/2015 15Adrian Egger | FEM I | FS 2015

6

5

4

3

2

1

Page 16: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Example: Solver Force vectors of body loads

5/6/2015 16Adrian Egger | FEM I | FS 2015

Distributed load: Point load:

Page 17: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Example: Solver Force vectors of boundary loads

5/6/2015 17Adrian Egger | FEM I | FS 2015

Page 18: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Example: Solver computing displacements

“Inversion” of stiffness matrix usually dominates required

computational time for the finite element solution Direct Methods

Efficiency highly dependent on bandwidth of matrix and symmetry

• Gauss Elimination

• LU-Decomposition

• Cholesky-Decomposition

• Frontal Solvers

• …

Iterative Methods (+Preconditioner)

Efficiency highly dependent on condition number of stiffness matrix

• Conjugate Gradient Method (CG)

• Generalized Minimal Residual Method (GMRES)

• Biconjugate Gradient Method (BiCG)

• …

5/6/2015 18Adrian Egger | FEM I | FS 2015

𝑲𝒅 = 𝒇 → 𝒅 = 𝑲−𝟏𝒇

Page 19: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Example: Post-processing

5/6/2015 19Adrian Egger | FEM I | FS 2015

Will this lead to the exact solution for the internal forces?

• No, it will not!

• The assumptions on which the shape functions are based require no element loading!

• The choice of a cubic polynomial is related to

the homogenous form of the problem EIv’’ = 0

• The exact solution therefore exists only on elements without element loads (i.e. element 2)

Element 1:

Element 2:

Page 20: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Example: Post-processing

5/6/2015 20Adrian Egger | FEM I | FS 2015

Moment

Shear

Observations:

• Notice the decay in accuracy for

displacements < moments < shear

• Since the shape functions used, Hi(x), are

cubic, the moment is linear as a 2nd derivative

and the shear is constant as a 3rd derivative.

Displacements

--- = FEM approximation

--- = Exact solution

Page 21: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Numerical Integration

The computation of the stiffness matrix and load vectors

requires the evaluation of one or more integrals depending

on the dimension of the requested analysis.

Why not analytical evaluation of the integral? Analytical solution not always feasible

Analytical solution takes too much time to compute

No guarantee that numerical issues are removed

Division by zero

Machine precision induced errors

Etc.

Post-processing requires numerical evaluation of quantities

B-matrix 5/6/2015 21Adrian Egger | FEM I | FS 2015

Page 22: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Numerical Integration: Overview

Trapezoidal rule

Simpsons rule

Newton-Cotes quadrature rules Assumes equally spaced evaluation points and optimized weights

Requires n evaluations for exact integration of n -1 degree polynomial

5/6/2015 22Adrian Egger | FEM I | FS 2015

Page 23: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Numerical Integration: Gaussian Quadrature

Especially efficient for the evaluation of polynomials

Position of sampling points and value of weights are both optimized

The sampling points can be obtained by solving:

The weights are computed the same way as with Newton-Cotes:

Yields exact results for polynomials of degree 2n-1 or lower, where n is equal to the amount of weights / sampling points.

5/6/2015 23Adrian Egger | FEM I | FS 2015

Page 24: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Gaussian Quadrature: Example

5/6/2015 24Adrian Egger | FEM I | FS 2015

Page 25: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Gaussian Quadrature: Tables

5/6/2015 25Adrian Egger | FEM I | FS 2015

Depending on the order of the polynomial to be approximated, the corresponding order

(number of point) for the quadrature are selected along with the corresponding weights

from the following table:

Page 26: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Gaussian Quadrature: Example in 1D

5/6/2015 26Adrian Egger | FEM I | FS 2015

2*2_integration_points - 1 ≥ 3

2*3_integration_points - 1 ≥ 4

Page 27: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Gaussian Quadrature: Example in 1D

5/6/2015 27Adrian Egger | FEM I | FS 2015

Page 28: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Gaussian Quadrature: Reduced Integration

Reduced integration entails using fewer integration points

than required by (full) conventional Gaussian quadrature.

This has the effect that only a lower degree of polynomial

effect can be captured in the integration process.

This can be beneficial when encountering shear locking as

in for example the Timoshenko beam Since we assume the same order of polynomial for displacements

and rotations, even though we know they are related by derivative, using reduced integration numerically simulates the use of a lower polynomial. Thus the inherent relations between displacements and rotations can be better accounted for.

5/6/2015 28Adrian Egger | FEM I | FS 2015

Page 29: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Gaussian Quadrature: 2D

5/6/2015 29Adrian Egger | FEM I | FS 2015

Page 30: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Gaussian Quadrature: Computer Implementation

5/6/2015 30Adrian Egger | FEM I | FS 2015

[ samplingPoints , weights ] = integrationParameters1D ( nodesPerElement , quadratureType);

[shapeFunction , shapeFunctionDerivative] = shapeFunction1D (nodesPerElement , samplingPoint);

B = 1/detJ * [y_n , 0 ;...

0 , -x_n;...

-x_n , y_n] * shapeFunction2D;

k_temp = k_temp + transpose(B) * D * B * detJ * weight;

x = shapeFunction * xCoord;

y = shapeFunction * yCoord;

x_n = shapeFunctionDerivative * xCoord;

y_n = shapeFunctionDerivative * yCoord;

detJ = x * y_n - y * x_n;

9

12

13

14

Extremely important remarks:

• All calculations and quantities

obtained only at integrations points!

• Thus, strain-displacement matrix B

evaluated exactly only at

the integration points!

• Thus stresses and strains most

accurate at Gauss integration points!

Page 31: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Inter-element Continuity (at nodal points)

In finite element analysis, we often encounter C0-continuity C0-continuity: continuity of displacements only

C1-continuity: continuity of once derived quantities (stress & strain)

C2-continuity: continuity of twice derived quantities

Which value for the stress due we choose?

5/6/2015 31Adrian Egger | FEM I | FS 2015

Page 32: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Post-processing of Stress and Strain

Given the displacement solution:

𝑲 ∗ 𝒅 = 𝑭 → 𝒅 = 𝑲−𝟏 ∗ 𝑭

Strains: 𝜺 = 𝑩 ∗ 𝒅

Stress: 𝝈 = 𝑪 ∗ 𝑩 ∗ 𝒅

Stress and strain evaluated using B-matrix anywhere on domain

Continuous on each element

Jumps across elements

5/6/2015 32Adrian Egger | FEM I | FS 2015

Have: Want:

How does one remove

these unwanted jumps?

Page 33: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Superconvergent Patch Recovery Theory

Assumption: There exist points within the element, namely the gauss integration

points, at which the stresses are superconvergent.

Aim: Use these stresses at the gauss integration points to recover nodal

stresses that are also superconvergent.

Use least squares fit to find a better solution

New possibilities: Based on the difference between raw (“computed”) stress and

recovered (“averaged”) some options arise:

A posteriori error estimator

Adaptive mesh refinement

C0 continuous stress and strain distribution

5/6/2015 33Adrian Egger | FEM I | FS 2015

Page 34: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Exact Error Estimator

5/6/2015 34Adrian Egger | FEM I | FS 2015

Weighted per cent root-mean-square of the error in the stress field:

Reference: DOI: 10.1002/nme.439

Page 35: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Finite Element Error Estimator

5/6/2015 35Adrian Egger | FEM I | FS 2015

Reference: DOI: 10.1002/nme.439

Page 36: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Raw vs. Recovered Stress Fields:

5/6/2015 36Adrian Egger | FEM I | FS 2015

Reference: DOI: 10.1002/nme.439

Page 37: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Visualization of the Error-Estimator

5/6/2015 37Adrian Egger | FEM I | FS 2015

Why should this result not surprise us?Comparison with exact solution:

Reference: DOI: 10.1002/nme.439

Page 38: Method of Finite Elements I: Demo 2: Numerical Integration · Numerical Integration The computation of the stiffness matrix and load vectors requires the evaluation of one or more

Questions

5/6/2015 38Adrian Egger | FEM I | FS 2015