0% found this document useful (0 votes)
22 views

FEM-notes

Uploaded by

Shubham Rai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

FEM-notes

Uploaded by

Shubham Rai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 160

Lecture Notes: Introduction to the Finite

Element Methods

Juan David Gómez Cataño


[email protected]
Nicolás Guarı́n-Zapata
[email protected]

Grupo de Investigación en Mecánica Aplicada


Civil Engineering Department
School of Engineering
Universidad EAFIT
Medellı́n, Colombia
2020
Contents

Summary 1

1 Introduction 2

2 Interpolation in the Finite Element Method 11

2.1 Statement of the problem . . . . . . . . . . . . . . . . . . . . 12

2.2 One-dimensional scalar functions . . . . . . . . . . . . . . . . 14

2.2.1 Lagrange interpolation theorem . . . . . . . . . . . . . 14

2.2.2 Local interpolation using a piece-wise continuous func-


tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.2.3 Distribution of the sampling (or nodal) points . . . . . 23

2.3 Extension to two-dimensional domains . . . . . . . . . . . . . 26

2.4 Interpolation over distorted domains . . . . . . . . . . . . . . 31

3 Quadratures: numerical integration 36

i
CONTENTS ii

3.1 Statement of the problem . . . . . . . . . . . . . . . . . . . . 38

3.2 Numerical integration using interpolation polynomials . . . . . 40

3.3 Gaussian quadratures . . . . . . . . . . . . . . . . . . . . . . . 50

3.4 Numerical integration in the finite element method . . . . . . 53

3.4.1 One-dimensional domains . . . . . . . . . . . . . . . . 53

3.4.2 Two-dimensional domains . . . . . . . . . . . . . . . . 57

3.4.3 Matrix formulation . . . . . . . . . . . . . . . . . . . . 61

4 The Boundary Value Problem 67

4.1 Brief review of the linearized theory of elasticity model . . . . 68

4.1.1 Stress formulation . . . . . . . . . . . . . . . . . . . . . 68

4.1.2 Displacement formulation . . . . . . . . . . . . . . . . 71

4.2 Strong and weak forms of the BVP . . . . . . . . . . . . . . . 78

4.2.1 Strong form . . . . . . . . . . . . . . . . . . . . . . . . 78

4.2.2 Weak form . . . . . . . . . . . . . . . . . . . . . . . . . 78

4.3 Variational formulation . . . . . . . . . . . . . . . . . . . . . . 81

4.3.1 Principle of minimum potential energy . . . . . . . . . 84

5 FEM formulation of the elasticity BVP 92

5.1 FE algorithm starting from the weak formulation of the BVP . 93


CONTENTS iii

5.2 FE algorithm starting from the principle of virtual work . . . 99

5.3 Global assembly . . . . . . . . . . . . . . . . . . . . . . . . . . 101

5.4 The assembly algorithm . . . . . . . . . . . . . . . . . . . . . 105

5.5 Summary: The finite element algorithm . . . . . . . . . . . . . 110

A Combined index notation for finite element analysis 118

A.1 Combined index notation for finite element analysis . . . . . . 118

A.1.1 Index notation of Cartesian tensor fields . . . . . . . . 119

A.1.2 The summation convention . . . . . . . . . . . . . . . . 120

A.1.3 Indicial notation in interpolation . . . . . . . . . . . . 120

B Generalized boundary value problems 126

B.1 Governing equations . . . . . . . . . . . . . . . . . . . . . . . 126

B.1.1 Strong form . . . . . . . . . . . . . . . . . . . . . . . . 129

B.1.2 Weak form . . . . . . . . . . . . . . . . . . . . . . . . . 130

B.1.3 Equivalence between the strong and weak forms . . . . 130

B.2 Weighted residual methods . . . . . . . . . . . . . . . . . . . . 131

B.2.1 Galerkin method . . . . . . . . . . . . . . . . . . . . . 133

B.2.2 Least squares method . . . . . . . . . . . . . . . . . . . 133

B.2.3 Collocation method . . . . . . . . . . . . . . . . . . . . 134


CONTENTS iv

B.2.4 Subdomain method . . . . . . . . . . . . . . . . . . . . 135

B.2.5 Ritz method . . . . . . . . . . . . . . . . . . . . . . . . 135

C Convergence analysis 141

C.1 ¿What is meant by convergence? . . . . . . . . . . . . . . . . 141

C.2 Conditions on a single element . . . . . . . . . . . . . . . . . . 142

C.3 Analysis of the mesh results . . . . . . . . . . . . . . . . . . . 146

Appendices
Summary
Class Notes for the Course Introduction to the Finite Element Methods

Keywords: Scientific Computing, Computational Mechanics, Finite


Element Methods, Numerical Methods.

1
Chapter 1

Introduction

This set of lecture notes for the course Introduction to the Finite Ele-
ment Method is part of the learning resources used in the flipped class-
room1 version of the subject adopted at Universidad EAFIT. In the flipped
class approach, the students cover most of the theoretical aspects through
independent home study, while the class time is invested in various learning
activities conducted with support from the instructor and strongly based on
peer-to-peer interaction. In this context, by collecting and summarizing fun-
damental numerical, theoretical and computational aspects required in the
formulation of finite element algorithms, the lecture notes are intended to
serve as a self-study guide. The notes are not as rigorous as material exist-
ing in published literature and are certainly not close in quality to excellent
textbooks available in the subject.

This introductory version of the course covers fundamental theoretical


and computational aspects required in the formulation of finite element meth-
ods as a numerical solution technique of boundary value problems. Although
the studied algorithms are general the course evolves around the model of
the linearized theory of elasticity. The fundamental theoretical framework
is mainly covered in the lecture notes and some referenced complementary
material. The various theoretical topics are then associated with in-class
1
“Inverting the classroom means that events that have traditionally taken place inside
the classroom now take place outside the classroom and vice versa.” [? ].

2
CHAPTER 1. INTRODUCTION 3

learning activities involving some degree of computational work. Most of


these activities are given in the form of Jupyter Notebooks.2 In addition to
the lecture notes and notebooks, the authors have also developed SolidsPy3
which is a complete Python-based finite element code to conduct stress anal-
ysis over arbitrary two-dimensional elastic domains. The code, which follows
a modular structure facilitates the realization of learning activities in the
form of (i) full stress analysis simulations (ii) implementation of intermedi-
ate steps aimed at covering the various steps in the FE algorithm and (iii)
extensions to incorporate additional kinematic models. In the rest of this in-
troductory chapter, we present a simple problem of a mechanical spring-mass
system that resembles the final form of a finite element algorithm and which
serves to justify why we cover the material in the specific order proposed
here. Then we describe the topics covered in the notes and in the final part
we indicate how to use the material.

Introductory problem

A simple discrete system

The simple case of a mechanical spring-mass system considered next resem-


bles most of the algorithmic aspects of a finite element code. This system
serves as a nice motivational example since the problem is already discrete
thus avoiding the discussion of mathematical complexities. As will be pre-
sented throughout the course one of the goals of the finite element algorithm,
when applied to a continuous system represented in terms of a boundary
value problem, is to reformulate it as a discrete system fully analogous to the
simple problem.

The system consists of an assemblage of masses joined by different springs


submitted to time varying loads. For later purposes it is convenient to asso-
ciate a spring with the concept of a finite element and a mass with a nodal
2
Jupyter notebooks are open-source web applications used to create and share docu-
ments that contain live code, equations, visualizations, and narrative text.
3
Check the documentation in https://solidspy.readthedocs.io [? ].
CHAPTER 1. INTRODUCTION 4

point in a finite element algorithm.

The system may be like the one shown in fig. 1.1 where the masses are
represented by “cars” connected by springs (or finite elements) of different
stiffness coefficients.

2K P

3K
K

Figure 1.1. Typical assemblage of springs and masses.

Considering a typical spring (or finite element), fig. 1.2

f1 K f2
u1 u2
Figure 1.2. Typical spring element.

one finds that under a relative displacement δu = u1 − u2 the spring


develops a force :

f1 = K(u1 − u2 )

while equilibrium of the spring requires

f1 + f2 = 0.
CHAPTER 1. INTRODUCTION 5

The force-displacement and equilibrium equations can be combined into:

    
f1 1.0 −1.0 u1
=K . (1.1)
f2 −1.0 1.0 u2

Equation (1.1) resembles a first fundamental aspect displacement based fi-


nite element methods which is the fact that the problem is described in terms
of displacements of specific points (or nodes) and where internal element
forces are found from these nodal displacements via a constitutive relation-
ship. In the case of a continuous problem an analogous force-displacement
relationship is established using interpolation theory together with equilib-
rium statements.

On the other hand, the equilibrium equation for a typical mass mj with
displacement uj (see fig. 1.3) and assumed to be attached to springs i and
i + 1 reads
dVj
f2i + f1i+1 + mj = Pj . (1.2)
dt

This equation can be written in terms of displacements after expressing


the involved forces f2i and f1i+1 using terms from equations like 1.1

dVj
(K i + K i+1 )uj − K i uj−1 − K i+1 uj+1 + mj = Pj .
dt

f2i f1i+1

dV
m
dt
Figure 1.3. Free body diagram for a typical mass connected to springs
i and i + 1.
CHAPTER 1. INTRODUCTION 6

Writing the elemental equilibrium equations for the springs in terms of


the corresponding mass displacements uj−1 , uj and uj+1 and generalizing the
coefficients notation we get:

    
f1i i
k11 i
k12 uj−1
=
f2i i
k21 i
k22 uj

and

f1i+1 i+1 i+1


    
k11 k12 uj
=
f2i+1 i+1
k21 i+1
k22 uj+1

which gives for the equilibrium equation of the mj mass:

i i i+1 i+1 dVj


k21 uj−1 + (k22 + k11 )uj + k12 uj+1 + mj = Pj .
dt

If one the other hand we also consider the contributions from the springs
K i and K i+1 to the equilibrium of masses mj−1 and mj+1 respectively we
have the following matrix block:

 
i i
 k11 k12 
i+1  .
 i i i+1

 k21 k22 + k11 k12
i+1 i+1
k21 k22

Consideration of the complete system of masses leads to a system of linear


equations of the general form

Considering now the complete system of masses and springs leads to a


system of linear equations of the form
[KG ] {UG } + [M ] {AG } = {FG } . (1.3)
where each equation represents the equilibrium of a given mass.
CHAPTER 1. INTRODUCTION 7

The process of forming these global coefficient matrices by adding the


contribution from different elements (springs) to the equilibrium equations of
the different masses is known as element assembly and this can be achieved in
a systematic way by establishing the connection between the global and local
degrees of freedom. This can be accomplished through an operator storing
in each row the global degrees of freedom corresponding to each element.
For instance, fig. 1.4 shows elements K i and K i+1 and the global degrees of
freedom corresponding to masses mj−1 , mj and mj+1 . The corresponding
entries of the DM E operator for these elements are given by:

 
 j−1 j 
DM E = 
 j

j+1 

Figure 1.4. Global degrees of freedom connected to the spring elements


K i and K i+1 respectively.

and the assembly process from the contribution of these elements to the
global coefficient matrix for elements i and i + 1 proceeds as:

i
Kj−1,j−1 ← Kj−1,j−1 + k11
i
Kj−1,j ← Kj−1,j + k12
i
Kj,j−1 ← Kj,j−1 + k21
i
Kj,j ← Kj,j + k22

and
CHAPTER 1. INTRODUCTION 8

i+1
Kj,j ← Kj,j + k11
i+1
Kj,j+1 ← Kj,j+1 + k12
i+1
Kj+1,j ← Kj+1,j + k21
i+1
Kj+1,j+1 ← Kj+1,j+1 + k22

The system given by eq. (1.3) and assembled with the aid of the DM E
operator can be solved for the global displacements UG and later use these
displacements to compute the element forces.

This algorithmic strategy of assembling the contribution from all the ele-
ments to formulate the global equilibrium equations of the system is typical
of finite element methods. However in the case of a BVP the continuous
system must be converted first into a discrete system through different nu-
merical and mathematical methods. A broad description of the method is
described in algorithm 1.

Algorithm 1: Springs Algorithm.


Data: Problem parameters; NUMNP, NUMEL, NMATP
Result: Displacements and spring forces
Create DM E operator;
Assemble K G , F G ;
while j ≤ 1, N U M EL do
KG ← KG + Ki
FG ← FG + Fi
end
Solve [K G ]U = F G
Find internal forces

The full implementation of the mass-springs system is given in an accom-


panying notebook in the course REPO.
CHAPTER 1. INTRODUCTION 9

Contents of the course

The course is divided in three parts as follows:

• Part 1 covers classical numerical methods such as interpolation theory


and numerical integration within the context of finite element meth-
ods. These methods are shown to be fundamental in the conversion
of the continuous system into a discrete system analogous to the dis-
cussed mass-springs system. The numerical methods are studied from
its theoretical and computational aspects and the suggested learning
activities are described in notebooks 1 through 6.

• Part 2 presents the boundary value problem corresponding to the model


of the linearized theory of elasticity and in particular its description
through formulations which are suitable for a solution in terms of fi-
nite elements algorithms. The boundary value problem is covered in
notebook 7.

• Part 3 concentrates on the formulation of the elasticity boundary value


problem in a finite element algorithm. The algorithm and several re-
lated aspects are covered in notebooks 8 through 11, while notebook
12 contains a brief reference to the course finite element code SolidsPy.

The main set of accompanying notebooks also includes NB-0 which makes
an introduction to the use of notebooks and a quick reference to data flow
structures in Python. The set of lecture notes also include an appendix
section presenting some more mathematical aspects of the method and ad-
ditional tools that may result useful depending on the student’s abilities.

How to follow the course?4 The course and its different resources have
been created to be used in a flipped class environment or as a self study
4
This set of lecture notes and additional course material has been developed as part
of the sabatical period of the first author and with the collaboration of the second author
Nicolas Guarin-Zapata. The development of the notebooks and design of the learning
activities in these notebooks has been developed thanks to the advisory of Camilo Vieira.
CHAPTER 1. INTRODUCTION 10

material. In the formal course, as thought in the graduate program at Uni-


versidad EAFIT, it is recommended to follow the proposed sequence of ac-
tivities starting with the section covering numerical methods as described
previously.This same sequence is also recommended for independent learners
with no previous knowledge on fundamental numerical methods like inter-
polation theory and numerical integration. More advanced students, with
previous backgrounds on mathematical analysis and numerical methods can
test their actual abilities by developing the activities proposed on NB-4 and
NB-6 and then moving directly into Chapter 4 discussing the boundary value
problem.
Chapter 2

Interpolation in the Finite


Element Method

Preliminary

In a broad sense the finite element method is nothing else than an approx-
imation technique for solutions to boundary and initial value problems. In
this section we will discuss some fundamental and basic aspects related to
the approximation of functions through interpolation. In the finite element
method, such approximation takes place for the geometry of the computa-
tional domain and for the field variable of the problem at hand. As it will
be seen, the concept of finite element it self corresponds to a local domain
or sub-domain in which the solution function is approximated via interpo-
lation techniques. We will cover this subject from a materialistic point of
view, as required on the implementation of a first finite element algorithm,
with mathematical rigor left to the excellent texts on the subject. The set
of notes starts with the problem definition and its solution in terms of the
Lagrange interpolation theorem. From that point the notes discuss practical
applications including its implementation in Python scripts built for finite
element analysis.

11
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD12

At the end of this chapter1 the student should be able to:

• Formulate appropriate interpolation schemes to generate approximate


functions out of sets of discrete values representing the behavior of the
unknown functions over one-dimensional and two-dimensional domains.

• Recognize the differences in terms of advantages and limitations be-


tween global and local interpolation schemes. This includes the patholo-
gies associated with each method.

• Recognize the concept finite element like a family of locally defined


interpolation schemes valid over canonical domains.

• Develop efficient and effective Python implementations of interpola-


tion schemes within the context of the finite element method for one-
dimensional and two-dimensional applications.

2.1 Statement of the problem

Let f (x) be an unknown function, whose values, however, are known at n


discrete points x1 , x2 , ..., xn . We want to know (interpolate) the value of f (x)
at an arbitrary point x ∈ [x1 , xn ] and different to one of the n points.

The problem of interpolation is precisely that of finding the unknown


value of f (x) using the known values {f 1 , f 2 , ..., f n }. As schematically de-
scribed in fig. 2.1 it involves two steps:

i Fitting an approximate function, known as the interpolating polyno-


mial, to the known data points.

ii Evaluating the function at the point of interest where the function is


unknown.
1
This chapter, together with theoretical and computational learning activities is com-
plemented by Jupyter Notebooks 1 through 4 available at the course’s repository.
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD13

We can (i) follow a global approach using all the known n-data points
and fit an (n − 1)-th order polynomial to these data points2 (fig. 2.1) or (ii)
use a local approach where one splits the domain into sub-intervals and fits
lower order polynomials to the data points within each sub-interval(fig. 2.2).

Local interpolation uses a finite number of nearest-neighbors and gener-


ates interpolated versions of f (x) that do not in general have continuous first
or higher derivatives. The advantage of this local approach lies in the fact
that independent of the function or the number of data points, the interpo-
lation operation always uses the same polynomial. For instance in fig. 2.2
only first-order polynomials are being used in each local sub-domain: as a
result a computer implementation of this scheme would only need to store
the local polynomial once. In the jargon of the finite element method the
interpolation functions or its resulting local polynomials are termed a finite
element.

2
3
4
5
6
7
8
9
10
1.0 0.5 0.0 0.5 1.0

Figure 2.1. The black points represent known values of an otherwise


unknown function. The dashed line represents an approximation to the
unknown function in terms of a polyonmial of order n − 1.
2
As this approach is problem-dependent it is also cumbersome and difficult to code and
therefore not amenable to be used in finite elements.
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD14

10
1.0 0.5 0.0 0.5 1.0

Figure 2.2. Interpolation takes place inside each sub-interval producing


a piecewise interpolation approximation to the unknown function

2.2 One-dimensional scalar functions

2.2.1 Lagrange interpolation theorem

Given a set of n-points {(x1 , y 1 ), · · · , (xn , y n )} where y n ≡ f (xn ) then: “there


exists a unique polynomial p(x) of order at most (n − 1) such p(xI ) = f (xI )
for I = 1, 2, · · · , n”. The polynomial is given by;

p(x) = L1 (x)f (x1 ) + L2 (x)f (x2 ) + . . . + Ln (x)f (xn ) (2.1)

and the term LI (x) is computed as;

n
I
Y (x − xJ )
L (x) = . (2.2)
J=1
(xI − xJ )
I6=J
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD15

The approximate function p(x) of order n−1 is termed the interpolating


polynomial such

f (x) ' p(x)

while each one of the terms LI (x), also of order n − 1, are termed the
interpolation functions. In the context of the finite element method these
are also called shape functions.

The use of index notation, and particularly the summation convention,


can be extended to represent the linear superposition of functions given by
eq. (2.1). We use capital super-scripts to denote interpolation in such a way
that a capital superscript denotes a data point in the interpolation scheme.
Accordingly eq. (2.1) can be equivalently written like:

p(xI ) = LI (x)f (xI ) (2.3)

where the fact that I = 1, 2, ..., n is implicit in the notation.

Recall that the interpolating polynomial p(x) is just an approximation


to the actual function f (x). However, the approximation should at least be
such that p(xI ) = f (xI ) at the n nodal points. To satisfy this condition the
interpolation polynomials must be such that:

LI (xJ ) = δ IJ

and where δ IJ is the delta function extended to the interpolation polyno-


mials.

The approximate function p(x) resulting from the interpolation process


is called the interpolating polynomial while the Lagrange polyno-
mials LI (x) are called interpolation functions. In the language of the
finite element methods these are simply called shape functions.
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD16

A note regarding superscripts in indicial notation: In this


Class Notes superscripts associated to symbols like in the expression
x4 are frequently used to describe a variable associated to a nodal
point: for instance, in this context the expression x4 represents the
x-coordinate of nodal point 4. However, in some other cases this same
expression might appear, for example, in the definition of a function
like in f (x) = x4 + 4x3 . In both cases the specific meaning should be
clear by the context in which it appears.
Python function LagrangPoly() in NB-1 generates Lagrange inter-
polation polynomials of different order and over a varying range.

Example: Interpolation of a function using 3 data points Use a


Lagrange interpolation scheme to find an interpolating polynomial that ap-
proximates the function

f (x) = x3 + 4x2 − 10

at the sampling (or also nodal) points x1 = −1.0, x2 = +1.0 and x3 =


0.0 over the interval [−1, 1] together with its first order derivative at x =
0.7. Assume that the values of the first derivative at the nodal points are
unknown.

Table 3.1 contains the exact values for the function

x f (x)
−1.0 −7.000
0.00 −10.00
1.00 −5.000

Table 2.1. Known values of the function f (x) = x3 + 4x2 − 10 over the
interval [−1, 1]

The formulation of the interpolation scheme consists in finding the in-


terpolation polynomials LI (x) and the interpolating function p(x). From
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD17

eq. (2.2) the interpolation functions, shown in fig. 2.3, are:

(x − x2 )(x − x3 ) 1
L1 (x) = 1 2 1 3
≡ − (1 − x)x
(x − x )(x − x ) 2
1 3
(x − x )(x − x ) 1
L2 (x) = 2 1 2 3
≡ + (1 + x)x
(x − x )(x − x ) 2
1 2
(x − x )(x − x )
L3 (x) = 3 ≡ +(1 − x2 ).
(x − x1 )(x3 − x2 )

1.0

0.8

0.6

0.4

0.2

0.0

0.2
1.0 0.5 0.0 0.5 1.0

Figure 2.3. (top) Interpolation polynomials L1 (x), L2 (x) and L3 (x) as


per eq. (2.2) computed for a second order scheme with 3 nodal points.

The interpolating polynomial approximating the function is obtained us-


ing eq. (2.3) which in this case is given by

7 5
p(x) = 10x2 + (1 − x)x − (1 + x)x − 10.
2 2

The approximate and actual function are compared in fig. 2.4. Clearly
p(x), being a second order function differs with f (x), which is a third order
function. However, as stated in the interpolation theorem both functions
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD18

coincide at the nodal points where the known values of the function are
available.

10

11
1.0 0.5 0.0 0.5 1.0

Figure 2.4. Resulting interpolating function p(x) as per eq. (2.3) com-
pared with the exact function f (x) = x3 + 4x2 − 10. The Python code
used for the interpolation is available in NB-1

In finding an approximations to the first derivative recall that at the


nodal points the values of these first derivatives are unknown. Thus the only
available choice is to operate directly on p(x) and use it to approximate also
the first derivative like:

dp(x) dL1 (x) 1 dL2 (x) dL3 (x) 3


= f + (x)f 2 + f (2.4)
dx dx dx dx

It is evident that the approximation takes the form of a lineal superpo-


sition of products between interpolation functions (which in this case are
derivatives of the LI ) and known values of the function. The first derivative
obtained in this form differs from the actual derivative of f (x) since this
I
approach uses the values of f and not those of dfdx
(x)
and dLdx(x) instead of LI
I J
and these functions do not satisfy the condition dL dx(x ) = δ IJ .
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD19

15

10

10
1.0 0.5 0.0 0.5 1.0

Figure 2.5. Comparison between the first order derivative of p(x) with
the closed-form result of dfdx
(x)

Figure 2.6 shows the approximation to f 0 (x) when p(x) is computed using
4th-order polynomials.

12
10
8
6
4
2
0
2
4
6
1.0 0.5 0.0 0.5 1.0

Figure 2.6. Comparison between the first order derivative of p(x) com-
puted using 4th-order polynomials with the closed-form result of dfdx
(x)
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD20

To identify the variation in the solution with different interpolation schemes


fig. 2.7 compares the exact and interpolated solution for polynomials of order
1, 2 and 4 respectively. The left column displays the interpolation polyno-
mials LI (x).

1.0 5

0.8 6

0.6 7

0.4 8

0.2 9

0.0 10
1.0 0.5 0.0 0.5 1.0 1.0 0.5 0.0 0.5 1.0

(a) First order. (b) Actual and interpolated function.


1.0 5

0.8 6

0.6 7

0.4 8

0.2 9

0.0 10

0.2 11
1.0 0.5 0.0 0.5 1.0 1.0 0.5 0.0 0.5 1.0

(c) Second order. (d) Actual and interpolated function.


5
1.0
6

0.5 7

8
0.0
9
0.5
10
1.0 0.5 0.0 0.5 1.0 1.0 0.5 0.0 0.5 1.0

(e) Fourth order. (f ) Actual and interpolated function.

Figure 2.7. Interpolation of the function f (x) = x3 + 4x2 − 10 using


Lagrange polynomials of increasing order.
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD21

2.2.2 Local interpolation using a piece-wise continuous


function

An alternative to the non-uniform nodal distribution approach used in the


previous section to improve the interpolation scheme is based on splitting
the solution interval [x1 , xn ] in smaller sub-domains where the interpolation
is performed locally. For instance table 2.2 shows such a partition for the
interval [−1.0, 1.0] where each sub-domain is conformed by a pair of consec-
utive nodes. The table shows values of the function f (x) = x3 + 4x2 − 10 at
the edges of the sub-domains. In this particular case, considering each sub-
domain to be conformed by a pair of points, the lineal interpolation scheme
reduces to finding the straight line (first order polynomial) that passes along
the pair of nodes. Higher order local schemes are possible if additional points
are added to the sub-domains.

Subdomain Range Values for f (x)


1 [−1.0, −0.5] [−7.000, −9.125]
2 [−0.5, 0.00] [−9.125, −10.00]
3 [+0.0, +0.5] [−10.00, −8.875]
4 [+0.5, +1.0] [−8.875, −5.000]

Table 2.2. Partition of the interval [−1.0, 1.0] into subdomains

Using piecewise interpolation over constant size intervals implies also


the use of constant polynomials. In the finite element method each
sub-domain is mapped into a constant size interval facilitating system-
atization of the interpolation process. Notebook 2 in the REPO shows
the Python implementation of piecewise interpolation.
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD22

1.0

0.8

0.6

0.4

0.2

0.0
1.0 0.5 0.0 0.5 1.0

Figure 2.8. Local interpolating polynomials.

This approach results in an interpolating polynomial as shown in fig. 2.9


and where the approximated function is piece-wise continuous. As a result
the local based technique the first derivative of the function is now discon-
tinuous at the boundaries of the subdomains. However this local schema is
advantageous since the local polynomials are unique and the scheme can be
used for an arbitrary number of nodal points facilitating computer imple-
mentation.

5 12
10
6 8
6
7
4
2
8
0
9 2
4
10 6
1.0 0.5 0.0 0.5 1.0 1.0 0.5 0.0 0.5 1.0

(a) Approximation to the function using (b) Variation of the first order deriva-
first order interpolation polynomials. tive.

Figure 2.9. Locally based interpolation scheme for the function f (x) =
x3 + 4x2 − 10.
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD23

2.2.3 Distribution of the sampling (or nodal) points

The simple problems considered so far have used a small number of sample
points and a constant separation distance. This approach worked nicely
considering the smooth functions involved. However if the function to be
interpolated exhibits strong gradients, as might be the case in problems of
wave propagation, the approximation with a small number of data points
is very likely insufficient. The natural solution seems to be the addition of
data points and thus an increase in the order of the interpolating polynomial.
Unfortunately, as we will show here this approach does not always works in
the desired direction.

Consider the function:

1
f (x) =
1 + 25x2

shown in fig. 2.10.

1.0

0.8

0.6

0.4

0.2

0.0
1.0 0.8 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8 1.0

1
Figure 2.10. Runge function f (x) = 1+25x2
.
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD24

This function shows a strong spatial variation requiring an interpolating


polynomial of larger order and as a result a larger number of nodal points.
The 11 black dots shown in the figure represent nodal points equally spaced
at ∆x = 0.2 and where the function is assumed to be known. We wish to
approximate this function using these 11 points and an order 10 interpolating
Lagrange polynomial.

Figure 2.11 shows the 11 order-10 Lagrange interpolation polynomials for


the equidistant nodal distribution and the resulting interpolating polynomial
p(x). Clearly the approximation is highly inaccurate, specially near the edges
of the interval where it exhibits strong oscillations. This spurious result
along the edges is introduced by the equidistant separation of the sampling
points. The interpolation scheme can be improved using a non-uniform nodal
spacing. The resulting alternative scheme is shown in fig. 2.12 where there
is a large concentration of nodal points along the edges.

2.0

1.5

8
6 1.0

4
2 0.5
0
2
0.0
4
6
0.5
1.0 0.8 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8 1.0
8
1.0 0.8 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8 1.0

(a) (b)

Figure 2.11. (a) Lagrange interpolation polynomials of order 10 associ-


ated to the 11 sampling points for fig. 2.10. (b) Interpolating polynomial
to approximate the Runge function with the order-10 polynomials from
part (a).
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD25

1.0

0.8

1.5
0.6

1.0 0.4

0.5 0.2

0.0
0.0

0.2
1.0 0.8 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8 1.0
0.5
1.0 0.8 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8 1.0

(a) (b)

Figure 2.12. (a) Order 10 Lagrange interpolation polynomials associ-


ated to non-equidistant sampling points. (b) Interpolating polynomial to
approximate a Runge function built with the polynomials derived in part
(a).

To understand this numerical pathology, related with the distribution of


the nodal points, consider the interpolation polynomials corresponding to the
central point and to the edge point of the equidistant distribution (fig. 2.11)
as shown in part(a) of fig. 2.13. The green line corresponds to the polynomial
associated to the central node, while the blue line is that of the edge nodal
point. Clearly, the central-point polynomial introduces a strong variation
along the edges of the sampling interval, while the edge-point polynomial
exhibits a rather smooth variation. Similarly, part(b) in the same figure
shows once again the central-point and the edge-point polynomials associated
to non-uniform nodal distribution. It can be observed how in this last case
both polynomials exhibit a smooth variation over the interval eliminating
the strong oscillation towards the edges.
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD26

8 8
6 6
4 4
2 2
0 0
2 2
4 4
6 6
8 8
1.0 0.8 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.0 0.8 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8 1.0

(a) (b)

Figure 2.13. (a) Equidistant nodal points (b) Non-uniform nodal points.

2.3 Extension to two-dimensional domains

Assume we are now interested in conducting interpolation of a function over


a spatial 2-dimensional domain where every point is specified by a position
vector of the form → −
x = xı̂ + y̂. We want to know, via interpolation, the
value of a function f (→−
x ) at an arbitrary point → −x provided we know the

− 1 1 →
− n n
set of n-pairs of the form {( x , f ), · · · , ( x , f )}. The domain and the
visualization of the function are shown in fig. 2.14.

4 3
A B
3
2
1
x 0
1
2
3
1.0
1 2 1.0 0.0
0.5
0.5
0.0 0.5
0.5
1.0 1.0

(a) Square two-dimensional domain (b) Interpolated function f (x, y).

Figure 2.14. Function f (x, y) over a square two-dimensional domain


with nodal points labeled 1 , 2 , 3 , 4.
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD27

Since now the function f depends on the 2D space coordinates (x, y) it is


natural to expect that interpolation functions depend also on (x, y). Using
this condition on the function approximation we have:

f (x, y) = N 1 (x, y)f 1 + N 2 (x, y)f 2 + N 3 (x, y)f 3 + N 4 (x, y)f 4

where now N Q (x, y) is the 2D interpolation (or shape) function associated


to the sampling point Q. Using indicial summation convention, we can write
the interpolated function as:

f (x, y) = N Q (x, y)f Q

where now Q = 1, ..., N .

The method to find the required 2D shape functions N Q (x, y) consists


in the recursive (or iterated) application of the Lagrange one-dimensional
scheme discussed previously in terms of interpolating polynomials LQ (η) and
where now η is a dummy variable that can assume the role of x or y.

In the domain shown in fig. 2.14 assume that we wish to interpolate the
value of the function along the 1-4 direction. Note that along this line x
is constant and then the function depends only on y. Fixing x = xA it
is possible to conduct 1-dimensional interpolation along the y direction as
shown in fig. 2.15. In this case η assumes the role of y and we have:

f (xA , y) = L1 (y)f 1 + L4 (y)f 4 .

Since the interpolation scheme is taking place along the 1-4 direction in
terms of the 2 nodal values f 1 and f 4 , the functions L1 and L4 in this case
are the first order Lagrange polynomials associated to the points 1 and 4
respectively, and obtained with the already known product formula given in
eq. (2.2).
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD28

Clearly, the above scheme provides the value of the function for an arbi-
trary point A along the 1-4 line. Proceeding similarly along the 2-3 direction,
that is setting x = xB and interpolating once again along the y direction we
have:
f (xB , y) = L2 (y)f 2 + L3 (y)f 3 .

f(y, x=A)

Figure 2.15. Interpolation along the y-direction

So far, we have captured only the dependence on y since x was assumed


constant as indicated by f (xA , y) and f (xB , y). The dependence on x is
now captured proceeding similarly along the arbitrary line A − B using the
functions f (xA , y) and f (xB , y) respectively as follows;

f (x, y) = LA (x)f (xA , y) + LB (x)f (xB , y)

which after substituting with the found expressions for f (xA , y) and f (xB , y)
becomes

f (x, y) = LA (x){L1 (y)f 1 + L4 (y)f 4 } + LB (x){L2 (y)f 2 + L3 (y)f 3 }


f (x, y) = LA (x)L1 (y)f 1 + LA (x)L4 (y)f 4 + LB (x)L2 (y)f 2 + LB (x)L3 (y)f 3 .
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD29

Note that strictly speaking there are only 2 interpolation functions of the
form LQ (η) since one-dimensional interpolation is taking place. Thus the
interpolating polynomials satisfy the following equivalences:

where

LA (x) ≡ L1 (x)
LB (x) ≡ L2 (x)
L1 (y) ≡ L1 (y)
L2 (y) ≡ L1 (y)
L3 (y) ≡ L2 (y)
L4 (y) ≡ L2 (x) .

The resulting two-variable shape functions N Q (x, y) follow from the prod-
uct of one-dimensional interpolation functions like:

N 1 (x, y) = L1 (x)L1 (y)


N 2 (x, y) = L2 (x)L1 (y)
N 3 (x, y) = L2 (x)L2 (y)
N 4 (x, y) = L1 (x)L2 (y) .

In the actual computer implementation of the discussed interpolation


scheme it is desirable to have the actual functions embedded into the code
instead of having the computer finding the corresponding Lagrange poly-
nomials each time the size of the square domain changes. In practice, the
functions N Q (x, y) are coded for a canonic square of general side h. This
resulting canonic domain can be referred as a finite element.

A 2D finite element From the geometric point of view a finite element


is a canonical interpolation domain together with a set of shape functions
and its derivatives. Figure 2.16 shows the shape functions for a so-called
bi-linear element of side h = 1.0. The element is called bi-linear as linear (or
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD30

first order) interpolation is used along the x and y directions. Elements of


higher order result after adding nodal points and the required corrections to
the 2D-shape functions N Q (x, y).

1.0 1.0
0.8 0.8

N 1(x, y)

N 2(x, y)
0.6 0.6
0.4 0.4
0.2 0.2
0.0 0.0
1.0 1.0
0.5 0.5
1.0 0.0 1.0 0.0
0.5
0.5
y 0.5
0.5
y
x0.0 0.5
1.0 1.0
x0.0 0.5
1.0 1.0

(a) Shape function (b) Shape function


N 1 (x, y) = 14 (1 − x)(1 − y). N 2 (x, y) = 41 (1 + x)(1 − y).

1.0 1.0
0.8 0.8
N 3(x, y)

N 4(x, y)
0.6 0.6
0.4 0.4
0.2 0.2
0.0 0.0
1.0 1.0
0.5 0.5
1.0 0.0 1.0 0.0
0.5
0.5
y 0.5
0.5
y
x0.0 0.5
1.0 1.0
x0.0 0.5
1.0 1.0

(c) Shape function (d) Shape function


N 3 (x, y) = 14 (1 + x)(1 + y). N 4 (x, y) = 41 (1 − x)(1 + y).

Figure 2.16. Shape functions for a 4-nodes element.

See Notebooks 3 and 4 for an easy to follow Python implementation


of interpolation resembling the finite element method.
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD31

Finite element mesh Spatial-discretization of the computational


domain is in the core of finite element analysis. This corresponds to
the partition of the whole domain into finite elements. The complete
set of finite elements, and its defining attributes, corresponding to
a particular domain is termed a mesh. If the geometry is irregular
the mesh would contain mostly distorted elements with respect to the
canonical shape. In the finite element method this is nicely solved
using space transformations between the distorted and the canonical
shape.

2.4 Interpolation over distorted domains

So far all the 2D interpolation operations have taken place over perfectly
squared domains of side h where the interpolation functions are known at
least in terms of the side parameter h. In many cases and particularly in
finite element methods it is common to find distorted interpolation domains
(see fig. 2.17) which difficult the interpolation operation as the interpolation
polynomials would be element-dependent and the problem would become
impossible to code in a systematic way.

Figure 2.17. Distorted quadrilateral interpolation domain.

In these cases the solution approach is based upon the continuous map-
ping of the distorted domain and the functions defined in this space into a
constant or canonical element where the interpolation functions are always
the same. Moreover, the mapping between both spaces is conducted also
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD32

using interpolation theory. This idea is explained next with reference to


fig. 2.18.

t=t
t=0 
 V ( x)
V (r )


r

x

Figure 2.18. Schematic representation of the one-to-one mapping be-


tween points in the physical space (left) and the natural or canonical
space (right).

In the figure the space of the distorted domain, and with position vectors

−x , is termed the physical space as this corresponds to the space of interest
in a particular problem. The figure also shows a perfectly squared domain
where we denote space coordinates by a position vector → −r : we refer to this
perfectly squared element as the canonical element and to its mathematical
space as the natural space. For reasons that will be explained later, it is
convenient to have canonical elements of side h = 2.0. Note also that since
the canonical element is a constant square of side h the corresponding La-
grange interpolation functions are always the same. This implies that if the
interpolation process were to be conducted over the natural space it could
be easily coded as it would amount to coding the interpolation functions per
se.

In mathematical language the connection between both spaces is written


in terms of general functional relations as:

xi = xi (→
−r)

− (2.5)
rI = rI ( x ).
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD33

The first of these functional relationships maps every point →



r from the


canonical space into a point x of the physical space. In particular the
relationship 2.5(a) can be written using:

xi = N Q (→

r )xQ . (2.6)

where the physical space has been represented as an interpolated approx-


imation using as the exact functions the coordinates of the nodal points of
the physical space. In particular, the first expression provides the position
vector →
−x in the physical space for a point that in the canonical space occu-
pies the position vector →

r . Similarly, the inverse relation gives the position


vector r in the canonical space for a point that occupies the position vector

−x in the physical space. Note that since in 2.5(a) we have used the inter-
polation functions formulated for the perfectly squared canonical space to
approximate the geometry or actual physical space this same transformation
can be used to transform functions as explained next.

Assume that f = f (→ −x ) is a function that describes the space variation of


a quantity of interest over a given domain. Using the mapping 2.5 it is also
possible to obtain the variation of the quantity in the canonical space after
writing:

f = f (→

x ) ≡ f [xi (→

r )] ≡ F (→

r ).

In the above expression F = F (→ −


r ) represents the same physical variable
but expressed in terms of the position vector in the canonical space. Being
able to represent functions in the physical and the canonical space is an
important result since it is now possible to conduct interpolation of functions
over constant domains as:

F (→

r ) = N Q (→

r )f Q . (2.7)

Note that as a result of the space transformation 2.5, finding the physical
function at a point rI is equivalent to finding the function at an associated
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD34

point xi in the physical domain.

Notebooks 3 and 4 in the REPO make use of Pyhton functions to


perform interpolation over two-dimensional domains. In particular,
NB4 applies interpolation over arbitrary domains to visualize closed-
form solutions.

Proposed problems

1. For the computational domain x ∈ [−1.0 , 1.0] and 3 nodal points


corresponding to x1 = −1.0, x2 = +1.0 and x3 = 0.0 find the Lagrange
polynomials L1 (x), L2 (x) and L3 (x).

2. Verify that the polynomials L1 (x), L2 (x) and L3 (x) satisfy the property
LI (xJ ) = δ IJ .

3. Implement a Python script that uses the vector of known values of a


function [f 1 , f 2 , f 3 ] and the polynomials from problem 1 and compute
the interpolating polynomial p(x).

4. Using p(x) from problem 3 compute and plot the first order derivative
of f (x) in the interval [−1, 1].

5. For the function f (x) = x3 + 4x2 − 10 for x in the range [−1.0, 1.0]
find values at nodal points that result from splitting the complete in-
terval into 4 sub-domains each one with 3 nodal points. Using these
values implement a local interpolation scheme using 2-nd order local
interpolation polynomials. Plot the interpolation polynomial in each
sub-domain and the corresponding interpolating function p(x). In the
same plot compare p(x) and f (x). Additionally, plot the first derivative
of the function obtained from p(x) and f (x).

6. For the Runge function defined by:

1
f (x) =
1 + 25x2
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD35

implement an interpolation scheme using local 1st-order Lagrange poly-


nomials. Use (i) sub-domains of constant size ∆x = 0.2 and (ii) sub-
domains whose size decreases towards the edges of the interval.

7. Using an independent script (or a notebook) implement a local inter-


polation scheme using a canonical element of size 2.0 and use it to
approximate the Runge function.

8. Assume that at the 4 nodal points of a 2D square domain of side 2h


we know the vector field



u = u(x, y)bi + v(x, y)b
j

and where u(x, y) and v(x, y) are the scalar rectangular components
along the x and y direction of a cartesian coordinate system.

• Implement an interpolation scheme to compute the vector field



−u = →−
u (x, y) at an arbitrary point (x, y).
∂u ∂v
• Use the interpolation scheme to compute εxx = ∂x
and εyy = ∂y
• Implement a Python script to visualize the vector field and the
scalars εxx and εyy .

9. Implement a Python script to visualize analytic (or numerical) solutions


available at a set of nodes. Use the following steps;

• Use external software3 to define and mesh and arbitrary solution


domain.
• Evaluate the solution at the nodal points of the mesh and store
the results into arrays.
• Use Python triangularization objects together with matplotlib
routines to visualize the solution.

3
Gmsh is an open source software for pre and post processing of complex 1D, 2D and
3D domains. Meshio is a set of Python scripts to read and write Gmsh readable files using
dictionaries.
Chapter 3

Quadratures: numerical
integration

Preliminary

The formulation of finite element algorithms is strongly based on the weak


formulation of the boundary value problems. In loose terms, in typical finite
element algorithms the boundary value problem originally written as a set of
governing differential equations and properly specified boundary conditions,
is re-formulated in the form of integral representations. For instance, this
is the case in the boundary value problem of linearized theory of elasticity
where the differential equations (corresponding to the equilibrium of a ma-
terial point) and the tractions (and/or displacement) boundary conditions
are shown to be equivalent to the the integral form representation of the
principle of virtual displacements. In this case a finite element algorithm re-
sults from the discretization through interpolation schemes of the integrand
appearing in the principle. However to generate an efficient method, valid
over arbitrary domains it is necessary to implement effective numerical in-
tegration algorithms. To illustrate the need for numerical integration in the
formulation of finite element methods consider a typical term resulting from
the discretization of the internal virtual energy in the principle of virtual

36
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 37

displacements such as the stiffness matrix given by:

Z
K QP
= HijQ Cijkl Hkl
P
d V. (3.1)
V

The accurate computation of these integrals is important to the formula-


tion of the finite element algorithm.

Note that the integration given by (3.1) is conducted over a domain V


which is typically a finite element of arbitrary shape (e.g., a distorted quadri-
lateral element) therefore difficulting the computation of K QP . This chapter
discusses the most relevant details required in the numerical computation
of integrals like the one appearing in (3.1) which are typical in finite ele-
ment algorithms. In the first part of the chapter we define a general formula
for numerical integration. For completeness we derive integration formulas
based on Lagrange interpolation although emphasis will be placed on the
more efficient Gaussian integration formulas.

At the end of this chapter1 the student should be able to:

• Recognize the difference between explicit and numerical computation


of integrals.

• Recognize the advantages and disadvantages of different numerical in-


tegration schemes.

• Propose integration schemes for specific finite elements.

• Implement efficient Python subroutines required in the integration of


functions over specific finite elements.
1
This chapter, together with theoretical and computational learning activ-
ities is complemented by Jupyter Notebooks 5 and 6 available at the course
REPO. Notebook 5 covers numerical integration as used in the finite element
method, while notebook 6 combines interpolation theory with numerical inte-
gration in the calculation of the stiffness matrix for a finite element.
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 38

3.1 Statement of the problem

A note on notation: Recall that in our indicial notation we are


using subscripts to refer to the scalar components of a vector or a
tensor function, while superscripts are reserved to represent elements
of the interpolating polynomial. Thus for scalar components of a vector
we use:
 
Vi ≡ Vx Vy Vz .
For interpolation of a scalar function we use:

p(x) = LQ (x)f Q .
And for interpolation of a vector function we use:

ui (x) = LQ
i (x)u
Q

In the most general case we are interested in numerically computing in-


tegrals of the general form

ZZZ
I = f (x, y, z)dV (3.2)

where the triple integral represents an integration over a given volume.


As in the case of interpolation theory, the problem of integration can also
be solved from the fundamental problem of integrating a one-dimensional
function like

Zb N
X
f (x)dx ≈ wI f (xI ). (3.3)
a I=1

In this fundamental one-dimensional problem the integral of a function


f (x) from x = a to x = b is approximated by a weighted summation of the
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 39

values of the function at a set of N -points. In (3.3) wI represents a weighting


factor associated to the value of the function f (xI ) at the point I.

This numerical approximation of the integral in terms of a weighted sum-


mation is called a quadrature formula and the derivation of a specific quadra-
ture corresponds to prescribing the required number of points N , the corre-
sponding weighting factors and the location of the N sampling or integration
points.

Example Using the following set of quadrature points and weighting fac-
tors

xI wI
−0.86113 0.34785
−0.33998 0.65214
+0.33998 0.65214
+0.86113 0.34785

evaluate the integral

Z+1
I = (x3 + 4x2 − 10)dx. (3.4)
−1

The numerical evaluation of the integral in (3.4) just reduces to the com-
putation of the following weighted summation:

Z+1
(x3 + 4x2 − 10)dx ≈ 0.34785 · f (−0.86113) + 0.65214 · f (−0.33998)
−1

+0.34785 · f (0.86113) + 0.65214 · f (0.33998) = −17.3333


CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 40

3.2 Numerical integration using interpolation


polynomials

A simple quadrature formula can be easily obtained if one represents the


actual function f (x) through a Lagrange based interpolation polynomial p(x):

Zb Zb
f (x)dx ≈ p(x)dx. (3.5)
a a

where

p(x) = LI (x)f (xI ) (3.6)

and LI (x) is the Lagrange interpolation polynomial associated to point


xI .

Substituting eq. (3.6) in eq. (3.5) yields

Zb Zb Zb
I I I
f (x) dx ≈ L (x)f (x )dx ≡ f (x ) LI (x)dx
a a a

which can be written like

Zb N
X
f (x)dx ≈ wI f (xI ) (3.7)
a I=1

after noticing that


CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 41

Zb
wI = LI (x) dx. (3.8)
a

Integration schemes are classified in Newton-Cotes and Gaussian


quadratures methods. In the first case the range of integration is di-
vided into N − 1 subintervals of constant size Nb−a
−1
while in the second
group one searches for the optimum location of the integration points
inside the interval in order to obtain maximum accuracy.

Example: Extended trapezoidal rule Consider the particular case in


which N = 2 (i.e., 1 integration interval). Clearly, in this case the size of the
interval is h = b − a and the interpolating polynomial is given by:

p(x) = L1 (x)f 1 + L2 (x)f 2 ≡ L1 (x)f (a) + L2 (x)f (b)

with interpolation polynomials corresponding to:

(x − x2 ) 1
L1 (x) = 1 2
≡ − (x − b)
(x − x ) h

(x − x1 ) 1
L2 (x) = ≡ (x − a).
(x2 − x1 ) h

Substitution in (3.8) yields:

Zb
1 1 h
w =− (x − b)dx ≡
h 2
a
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 42

Zb
1 h
w2 = + (x − a)dx ≡
h 2
a

giving the final quadrature

h
I = w1 f 1 + w2 f 2 ≡ [f (a) + f (b)]
2

or equivalently:

Zb  
1 1
f (x)dx = h f (a) + f (b) . (3.9)
2 2
a

Example: Computation of a definite integral Use the trapezoidal rule


to compute the integral

Z+1
I = (x3 + 4x2 − 10)dx.
−1

In this case h=2.0, therefore:

I = f (−1) + f (+1) ≡ −7 − 5 = −12

Example: Integration over two-dimensional domains. Figure 3.1


shows an schematic description of a two-dimensional domain (continuous
black line) denoted by R. We wish to compute the integral
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 43

ZZ
I= f (x, y)dA.
R

To proceed with the computation, the domain has been divided in N


rectagular subdomains (black dashed lines) in such a way that a typical
subdomain has dimensions ∆xi × ∆yi as shown in the auxiliary figure.

Δxi
Δyi

x
Figure 3.1. Riemman partition for a two-dimensional domain.

Defining

|p| = max |∆xi | ∨ max |∆yi |

as the norm of the partition, we have, according to the definition of an


integral as a Riemman sum that:

ZZ N
X
I= f (x, y)dA ≡ lim f (xj , yj )∆xj ∆yj .
|p|→0
R j=1
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 44

Taking each one of the limits independently allows to identify 2 integra-


tion process such that the integral over R reduces to the double integral given
by:

Z Z
I= f (x, y)dxdy.

To identify the integration limits consider fig. 3.2 showing a rectangular


integration domain with largest side parallel to the x direction and with mid
height corresponding to a y constant value. The small sides of the rectangle
have abscissas x1 (y) and x2 (y) respectively.

y
y2

y1

x1 (y) x2 (y) x
Figure 3.2. Integration along the x direction.

Considering once again the definition of an integral as the limit of a


Riemman sum we then have that for constant y values the contribution to
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 45

the integral over region R of the rectangle bounded by x1 (y) and x2 (y) is
given by:

xZ2 (y)

f (x, y)dx
x1 (y)

in such a way that the computation of the integral over the full region
R is completed after repeating the process for constant values of y varying
between y1 and y2 giving for the total integral:

 
 xZ2 (y)
Zy2  

I= f (x, y)dx dy (3.10)

 

y1 x1 (y)

To clarify eq. (3.10), note that the internal integral can be written as a
function of y

xZ2 (y)

F (y) = f (x, y)dx


x1 (y)

and the external integral like:

Zy2
I= F (y)dy.
y1

Alternatively (see fig. 3.3) it is possible to define:


CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 46

yZ2 (x)

H(x) = f (x, y)dy


y1 (x)

in such a way that the full integral I is defined by:

Zx2
I= H(x)dx.
x1

y
y2 (x)

y1 (x)

x1 x x2 x
Figure 3.3. Integration along the y direction.

Let us apply the previous ideas to compute the integral

Z Z
I= xy 2 dA
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 47

over the region shown in fig. 3.4.

2.0
y = 2x

x1 (y) x2 (y) = 1.0 x

Figure 3.4. Integration along the x direction over the triangular region
R.

Identifying the lower and upper integration limits along the y direction
as y1 = 0 and y2 = 2 respectively, and the functions x1 (y) and x2 (y) like:

y
x1 (y) =
2
and
x2 (y) = 1
we have that:
Z1.0 Z1.0
2
F (y) = xy dx ≡ xy 2 dx
x1 (y) y/2

then
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 48

1.0
1 2 2 1 1
F (y) = xy ≡ y2 − y4
2 y/2 2 8

using this function to integrate in y one finally gets that:

Z2.0 Z2.0
1 1 8
I = F (y)dy ≡ ( y 2 − y 4 )dy ≡ .
2 8 15
0 0

Proceeding alternatively (see fig. 3.5) it is possible to write:

yZ2 (x)

H(x) = xy 2 dy
y1 (x)

and

Zx2
I= H(x)dx
x1
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 49

y2 (x) = 2.0
y = 2x

y1 (x) = 0
x 1.0 x

Figure 3.5. Integration along the y direction over the triangular region
R.

where:

y1 (x) = 0
y2 (x) = 2x

then

Z2x 2x
1 3 8
H(x) = xy 2 dy ≡ xy ≡ x4
3 0 3
0

so the integral reduces to:

Z1.0
8 4 8
I= x dx ≡ .
3 15
0
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 50

3.3 Gaussian quadratures

In the numerical quadrature corresponding to the extended trapezoidal rule


written in the form

Zb npts
X
f (x)dx ≈ wI f (xI ) (3.11)
a I=1

the integration points are equidistantly spaced. In a Gaussian quadra-


ture in addition to adjusting the N weighting factors wI one also leaves as
adjustable parameters the location of the N integration points. As a result,
there are now 2N parameters to adjust in the derivation of an algorithm to
numerically approximate the integral of f (x) between x = a and x = b with
the maximum accuracy and the minimum number of operations. This class
of quadratures provide better precision than those based on Newton-Cotes
techniques (such as the trapezoidal rule) when the function to integrate can
be appropriately represented by a polynomial.

In general, different Gaussian quadratures are found in the literature


reported in terms of tables providing the locations of integration (or Gauss)
points and the corresponding weighting factors wI . As an example table 3.1
gives abscissas and weighting factors for a 4-point Gaussian quadrature.

xI wI
−0.86113 0.34785
−0.33998 0.65214
+0.33998 0.65214
+0.86113 0.34785
+1
R
Table 3.1. Abscissas and weighting factors to compute f (x)dx
−1

To facilitate coding of these quadratures and allow for approximation of


general integrals, it is common to consider a primitive range of integration
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 51

[−1.0, +1.0] which requires transforming the original integral (including the
function and its integration limits)to this primitive integral as discussed in
section 3.4. Figure 3.6 schematizes the primitive integration range and the
corresponding Gauss points denoted by the black xs. Transformation of a
given integral to the primitive space is discussed at a later section.

r = −1.0 r=0 x N −1 r = +1.0

Figure 3.6. Schematic reperesentation of a Gaussian quadrature in the


primitive range [−1.0, 1.0].

Example:Derivation of a Gaussian quadrature Let n = 2 and the in-


tegration interval [a, b] = [−1, +1]. Find w1 , w2 and x1 , x2 such the quadra-
ture

Z+1
I = f (x)dx ≈ w1 f (x1 ) + w2 f (x2 )
−1

integrated exactly the function f (x) corresponding to a third order poly-


nomial like:

f (x) = a0 + a1 x + a2 x2 + a3 x3 .

Using f (x) in I and stating the integral for each term we have:

Z+1 Z+1 Z+1 Z+1


I = a0 dx + a1 xdx + a2 x2 dx + a3 x3 dx
−1 −1 −1 −1

where:
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 52

Z+1
dx = 2 = w1 · 1 + w2 · 1
−1

Z+1
xdx = 0 = w1 · x1 + w2 · x2
−1

Z+1
2
x2 dx = = w1 · (x1 )2 + w2 · (x2 )2
3
−1

Z+1
x3 dx = 0 = w1 · (x1 )3 + w2 · (x2 )3 .
−1

The resulting system of equations is solved in order to determine the 4


quadrature
√ parameters, namely
√ w1 , w2 and x1 , x2 giving w1 = 1, w2 = 1,
x1 = − 3/3 and x1 = + 3/3 which allows us to write the quadrature in
the general form:

Z+1 √ √
I = f (x)dx ≈ 1.0 · f (− 3/3) + 1.0 · f (+ 3/3)
−1

which is exact for polynomial functions of order at most 3.

The idea behind Gaussian quadratures can be extended to the integra-


tion of higher order polynomials, however its derivation requires an effective
method to determine the weighting factors and the abscissas of the Gauss
points. The next section discusses a method which is applicable to 2n-order
polynomials, in which advantage is taken from the property of orthogonality
existing in certain special polynomials.
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 53

3.4 Numerical integration in the finite ele-


ment method

3.4.1 One-dimensional domains

The systematization and construction of tables with coordinates and weight-


ing factors for different quadratures is useful if these are specified for a fixed
range. For mathematical convenience it is common to use as base interval
[−1, +1]. However considering that we are interested in integrating a func-
tion f (x) in the general range with limits x = a and x = b it is required that
we re-write the integral like:

Zb Z+1
f (x)dx ≡ F (r)dr. (3.12)
a −1

The mapping indicated in eq. (3.12) is described in fig. 3.7, in which


the space represented by the independent variable x and contained between
x = a and x = b is mapped to a fictitious ”natural” space described by a
new independent variable r and enclosed in r = −1 y r = 1.

f (a) f (b) F(−1) F(+1)


r=0

x=a x=b r = −1 r = +1
Figure 3.7. Mapping between the physical space [a, b] and the primitive
or natural space [−1.0, +1.0].

This is exactly the same transformation used when approximating un-


known functions using interpolation theory over arbitrary distorted domains.
Repeating for convenience, the transformation between both spaces can be
written like:
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 54

x = x(r)
r = r(x)

and where x(r) and r(x) represent functional relationships between both
spaces. For instance, in reference to fig. 3.7, it is evident that independent
of the functional relationship this must satisfy the condition x(−1.0) = a
and x(+1) = b. Therefore, a valid relationship can be derived after assuming
that both spaces are related through a Lagrange interpolating polynomials
as follows:

x(r) = L1 (r)x(r1 ) + L2 (r)x(r2 )

and where the interpolation polynomials are given by:

(r − r2 ) 1
L1 (r) = 1 2
≡ (1 − r)
(r − r ) 2

(r − r1 ) 1
L2 (r) = 2 1
≡ (1 + r)
(r − r ) 2

which results in:

1 r
x(r) = (a + b) + (b − a).
2 2

It is also necessary to re-write f (x) using as independent variable r instead


of x using the functional relationship x = x(r) like:

f = f (x) ≡ f [x(r)] = F̂ (r)

where F̂ (r) represents the same function but now written in terms of r.
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 55

Finally, to complete the transformation it is necessary to transform phys-


ical differential space elements, that is dx. Proceeding directly from the
mapping via the Lagrange interpolation polynomials we have:

dx dL1 (r) dL2 (r) 1


= x(r1 ) + x(r2 ) ≡ (b − a)
dr dr dr 2

and therefore

dx 1
= (b − a)
dr 2

which allows us to finally write the integral in the fictitious domain en-
closed in [−1, +1] according to:

Zb Z+1 Z+1
`
f (x)dx ≡ F̂ (r) dr ≡ F (r)dr
2
a −1 −1

and where ` = 21 (b − a).

The module Gaussutil() in the finite element code SolidsPy contains


several one-dimensional and two-dimensional Gauss quadratures.

Example Use a 2 point Gaussian quadrature (see table 3.2) to evaluate


the integral:

Z3
I= (2x − x)dx.
0
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 56

xI wI
−0.577350269189626 1.000000
+0.577350269189626 1.000000
+1
R
Table 3.2. Abscissas and weighting factors to compute f (r)dr
−1

To perform the numerical integration using the 2-point Gaussian quadra-


ture given in table 3.2 it is necessary to transform the integration range and
the integrand of the function to the range corresponding to [−1.0, +1.0]. The
transformation is given by:

3 3
x(r) = + r
2 2

while the differential elements satisfy

3
dx = dr.
2

To transform the function we use:

 
3 3
fˆ(r) = f [x(r)] ≡ f + r
2 2

from which:

Z3 +1.0
Z  
x 3
(1+r) 3 3
I= (2 − x)dx ≡ 2 2 − (1 + r) dr
2 2
0 −1.0

and evaluating:
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 57

2  
X
I 3
(1+rI ) 3 I 3
I= w 2 2 − (1 + r ) = 1.0·(1.37678967978)+1.0·(4.18374583924) ≡ 5.56053551
I=1
2 2

3.4.2 Two-dimensional domains

In the finite element method there is interest in computing integrals like:

Z
I= f (→

x ) d V (→

x) (3.13)
V (−

x)

where V (→
−x ) is the domain of a typical finite element in a reference system
with position vector → −
x . In one-dimensional problems V (→ −
x ) ≡ [xa , xb ]; in


two-dimensional problems V ( x ) is a plane surface; and in three-dimensional
problems V (→−x ) is a volume. Moreover, previously we have defined a finite
element like a local interpolation space where values of a function are known
at specific points (nodes). For instance, in two-dimensional space we had a
quadrilateral bi-lineal element as the one shown in fig. 3.8.

Figure 3.8. Arbitrary bi-lineal element defined in the physical space

As in the one-dimensional case discussed in the previous section, to con-


duct numerical integration in a systematic way, we actually need to transform
generalized finite elements into canonical interpolation spaces (see fig. 3.9).
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 58

Figure 3.9. Transformation from a general distorted element in the


physical space to a perfect square in the natural space

Repeating the transformation for convenience, we have:

xi = xi (→
−r)

− (3.14)
rI = rI ( x )

where →−x and → −r denote position vectors in the physical and canonical
space respectively. Using the above to transform functions we can write:

f = f (→

x ) ≡ f [xi (→

r )] ≡ F (→

r ). (3.15)

Equation (3.15) above indicates that passing f (→ −


x ) from the physical to
the natural space representation corresponds to a change of variables. In
the particular case of classical finite element methods the change of variables
is conducted after approximating the physical geometry using interpolation.
particularly, using the same set of shape functions as in the approximation
of the primary fields we can write:

xi (→

r ) = NiQ (→

r )xQ (3.16)

where xQ denotes the spatial coordinates of nodal point Q and = NiQ (→ −


r)
is the shape function associated to the nodal point Q. According to this
expression in the finite element method the geometry is interpolated in terms
similar to the ones used for the primary field variable.
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 59

To transform the domain of integration we start once again from the


general functional relationship:

xi = xi (→

r)

and use it to stablish the relationship between differential lengths in both


spaces as:

∂xi
dxi = drj . (3.17)
∂rJ

∂xi
The second order tensor ∂r J
appearing in 3.17 is the Jacobian of the
transformation JiJ explicitly defined by;

∂xi
JiJ =
∂rJ

and this tensor contains all the information regarding the geometric changes
between both spaces. In terms of the shape functions it follows that:

∂xi ∂NiQ Q
JiJ = ≡ x . (3.18)
∂rJ ∂rJ

To complete the transformation we make use of Nanson’s formula from


continuum mechanics, from which:

dV (→

x ) = |J| dV (→

r)

where |J| is the determinant of the Jacobian tensor. We can write for I
in both spaces:
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 60

Z Z
I= f (→

x ) d V (→

x)≡ F (→

r ) |J(→

r )| d V (→

r) (3.19)
V (−

x) V (−

r)

Consider now the particular case of a two-dimensional bi-lineal finite el-


ement discussed previously and its transformation into the natural space
shown in fig. 3.10. Notice that this canonical element is a perfect square of
element side 2.0 contained between x ∈ [−1.0 , +1.0] and y ∈ [−1.0 , +1.0]
which is the same range of the fundamental quadrature studied in the one-
dimensional context.

Figure 3.10. Transformation from a general distorted element in the


physical space to a perfect square in the natural space

In the particular case of the transformation described in fig. 3.10 we have


that

dV (→

r ) = drds

therefore

dV (→

x ) = |J| drds

and eq. (3.19) takes the form:


CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 61

Z Z r=+1 Z s=+1
I= f (→

x ) d S(→

x)≡ F (r, s) |J(r, s)| d rds. (3.20)
S(−

x) r=−1 s=−1

To integrate 3.20 using a quadrature of N gpts integration points we use:

Z r=+1 Z s=+1 N gpts N gpts


X X
I= F (r, s) |J(r, s)| d rds ≈ F (ri , sj ) |J(ri , sj )| wi wj
r=−1 s=−1 i=1 j=1
(3.21)

which can be simplified into

Z r=+1 Z s=+1 N gpts∗N gpts


X
I= F (r, s) |J(r, s)| d rds ≈ F (rk , sk ) |J(rk , sk )| αk
r=−1 s=−1 k=1
(3.22)

which the one-dimensional version resulting from the iterated summation.


The points marked with a cross in fig. 3.10 represent integration points.

Notebook 5 in the REPO uses transformation or mapping from the


physical to the canonical space, together with numerical integration,
to compute the area of a distorted quadrilateral finite element.

3.4.3 Matrix formulation

For the computer implementation of the different methods discussed so far


it is practical to use a combined notation in terms of index and matrix rep-
resentation of variables. Consider the interpolated version of a vector field,
for instance the displacement vector in elasticity:
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 62

ui (→

r ) = NiQ (→

r )uQ (3.23)

in which:

• Susbcript i refers to the normal components of vectors in the physical


space

• Superscript Q refers to the contribution from nodal point Q to the


approximated field (in this case ui (→

r ))

• →
−r position vector of a point in the natural space. In index notation we
refer to the scalar components of this vector using capitalized subscripts
as →
−r = rI

• NiQ (→

r ) shape function associated to the nodal point Q evaluated at
the point →
−r.

The contribution to the Q nodal point implicit in eq. (3.23) can be written
in explicit expanded form as:
 . 
 .. 


    
 

Q Q 
u N (r) 0 u

= ··· ··· .
v 0 N Q (→

r)  vQ  
 .. 

 
.

To compute the Jacobian tensor at point →



r assume that the nodal coor-
dinates are stored in a matrix

 .. 
.
coord =  xQ y Q 
 
..
.

then we can further express:


CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 63

 .. 
 ∂x ∂y
 "
∂N Q
# .
∂r ∂r = ··· ∂r · · ·  xQ y Q  (3.24)
 
∂x ∂y ∂N Q
∂s ∂s ∂s ..
.

Having found the Jacobian of the transformation the remaining step con-
sists in transforming the integrand f (→ −x ). This step however is not con-
structed explicitly but it depends on the structure of f (→ −x ). In most finite
element algorithms the problem formulation involves spatial derivatives of
the primary function rather than the primary function itself. To consider
these terms in the transformed version of I, it becomes necessary to relate
spatial differentiation in both spaces. To clarify this aspect of the formulation
assume that I is of the form:

Z
∂f
I= d V (→

x ).
V (−

x) ∂→

x

We already found that

d V (→

x ) = |J| d V (→

r)

and to transform the integrand

∂f
∂→

x

we recall that in the finite element method the interpolation of the pri-
mary variable is conducted directly in the natural space. This means that
we already have F (→
−r ) or more explicitly that:

F (→

r ) = N Q (→

r )F Q .
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 64

However to capture correctly the physics of the problem we are interested


in finding

∂f
.
∂→

x

Using implicit differentiation:

∂f ∂F ∂rJ
=
∂xi ∂rJ ∂xi

and re-arranging for convenience we write

∂f ∂rJ ∂F
= . (3.25)
∂xi ∂xi ∂rJ

Notice that the first factor is the Jacobian inverse given by;

 −1
∂rJ ∂xi
= (JiJ )−1 ≡
∂xi ∂rJ

while the second factor reads:

∂F ∂N Q Q
= F
∂rJ ∂rJ

which allows us to write:

∂N Q Q
Z Z
∂f
I= →
− d V (→

x)≡ −1
JiJ F |J(→

r )| d V (→

r ).
V (−

x) ∂x V (−

r) ∂rJ
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 65

As an in-class activity Notebook 6 in the REPO requires the compu-


tation of the stiffness matrix for a plane strain solid element.

Proposed problems

1. Compute the integral of the function

f (x, y) = 4x2 + 3xy + y 2

over the two-dimensional domains shown in the figure

Figure 3.11. Integration domains for problem 1

2. Compute the jacobian of the transformation of the domains shown in


the figure
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 66

Figure 3.12. Integration domains for problem 1

to a perfectly square canonical element of side 2.0.

3. Compute the integral of the function

f (r, s) = rs

over the triangular domain shown in the figure

Figure 3.13. Integration domains for problem 1


Chapter 4

The Boundary Value Problem

Preliminary

In this section we review, in terms of governing equations and boundary con-


ditions, the boundary value problem corresponding to the model of theory
of elasticity. The first part of the chapter presents the stress and displace-
ments formulation of the problem leading to the strong form. In the second
part the problem is re-written in a weak sense leading to a form suitable
for finite element algorithms. The chapter concludes with a third equivalent
formulation, namely the principle of virtual work, which is obtained after
minimization of the total potential energy functional. In a sense, this last
statement of equilibrium is also a weak formulation useful for finite element
implementation.

At the end of this chapter1 the student should be able to:

• Understand the fundamental hypothesis leading to the model of lin-


earized theory of elasticity.
1
This chapter, together with theoretical and computational learning activ-
ities is complemented by Jupyter Notebook 7.

67
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 68

• Understand the fundamental elements, including those of stress and


strain, conforming the model of linearized theory of elasticity.

• Understand the problem of elasticity as a boundary value problem


which can be equivalently formulated in differential and integral forms.

• Recognize valid solutions of the BVP specified over a particular domain


and set of boundary conditions.

4.1 Brief review of the linearized theory of


elasticity model

4.1.1 Stress formulation

Here we present a brief description of the boundary value problem governing


the mechanical response of an elastic body. For a full discussion of the
model and its mathematical aspects the reader is referred to [? ]. The
equations are defined for a material point defined by its position x inside
a body occupying a volume V and bounded by the surface S as shown in
fig. 4.1. In a mathematical sense V is the problem domain and the surface
S is the boundary where the solution is expected to be given in terms of
prescribed (boundary) conditions (BCs).
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 69

Figure 4.1. Problem domain.

The governing equations (in terms of stresses) stem from application of


the principle of conservation of linear momentum and conservation of mo-
ment of linear momentum to an arbitrary portion of the domain. Conser-
vation of linear momentum leads to a set of 3 partial differential equations
in the components of the stress tensor σij while conservation of moment of
linear momentum leads to the symmetric character of this stress tensor. The
resulting equations are given by:

σij,j + fi = ρüi ∀ x ∈ V, t ∈ R+
(4.1)
σij = σji .

In 4.1 fi is the vector of body forces and ui is the displacements vec-


tor where each dot represents a time differentiation. The set of governing
equations in this stress formulation is complemented by boundary conditions
specified in terms of the tractions vector tn̂i associated with a surface S with
normal direction n̂j . At any given surface this tractions vector is related to
the stress tensor by:

tn̂i = σij n̂j ∀ ∈ x ∈ S.


CHAPTER 4. THE BOUNDARY VALUE PROBLEM 70

It must be noted that eq. (4.1) are a system of 6 equations in 12 un-


knowns (i.e., the 9 components of the stress tensor and the 3 components of
the displacements vector) and therefore it is undetermined. To eliminate such
indetermination we must relate the stresses to the changes in configuration.
In the linearized model of elasticity the local changes in configuration are
described in terms of changes of magnitude and internal distortions among
material fibbers emanating from the material point. This kinematic informa-
tion is described in terms of the strain tensor defined in terms of components
of spatial gradients of the displacement vector as follows:

1
εij = (ui,j + uj,i ). (4.2)
2

Note that the term ij is the symmetric component of the displacements
gradient tensor. The components of the strain tensor describe the distor-
tions and changes in magnitude (volumetric changes) of the material point
in the continuum model. To complete the problem formulation the local
changes in configuration must be related to the stress tensor at the material
point through a constitutive law. The simplest stress-strain (constitutive)
relationship is given by Hooke’s law2 as follows:

σij = 2µεij + λεkk δij . (4.3)

and where µ and λ are material constants.

Note that eq. (4.1) to eq. (4.3) involves now a total of 18 equations in
18 unknowns and mathematically it is now a solvable system. However to
find unique solutions the elastic solid must be subjected to properly specified
boundary conditions.
2
Despite the name of law used, this relation is not always valid, but is a good approx-
imation for small strains.
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 71

4.1.2 Displacement formulation

The equilibrium equations in terms of stresses given by eq. (4.1) can be


simplified after substituting eq. (4.2) in eq. (4.3) and the result in eq. (4.1)
yielding after some manipulation:

(λ + µ)uj,ij + µui,jj + fi = ρüi ∀x ∈ V, t ∈ R+ . (4.4)

Note that now eq. (4.4) simultaneously satisfies equilibrium, kinematic


relations and the constitutive law and they constitute a system of 3 partial
second order differential equations in the 3 components of the displacement
vector. For a unique solution these governing equations must be comple-
mented with prescribed boundary values of the displacement or its first order
derivatives as given by:

tn̂i = σij n̂ij ∀ x ∈ St


(4.5)
ui = ūi ∀x ∈ Su

and where St ∪ Su = S and St ∩ Su = ∅.

Notice that strictly speaking the problem involves time derivatives through
the term ρüi thus requiring also the specification of initial conditions in t = 0
for ui and u̇i . Here we will drop the inertial term and assume a static idealiza-
tion and the problem becomes a boundary value problem (BVP) summarized
next:

(λ + µ) uj,ij + µui,jj + fi = 0 ∀x ∈ V
tn̂i = σij n̂ij ∀ x ∈ St (4.6)
ui = ūi ∀x ∈ Su

In 4.6 the boundary conditions specified by the traction vector tn̂i


CHAPTER 4. THE BOUNDARY VALUE PROBLEM 72

tn̂i = µ(ui,j + uj,i )n̂j + λuk,k δij n̂j ,

correspond to the natural boundary conditions. In fact these actually


involve first order displacements derivative and as such they are Neumann
boundary condition on ui while those specified in terms of the displacements
vector ūi represent the essential boundary conditions.

The classical finite element algorithm to solve problems of elasticity in-


terpolates nodal displacements and then computes derivatives to find
strain and stress distributions as secondary variables, thus it is a dis-
placement based solution analogous to Navier equations.

Example: Two-dimensional idealization: Simple wedge under self-


equilibrated loads The general equations governing the elasticity BVP
can be represented by simplified two-dimensional versions under certain con-
ditions satisfied by the geometry of the problem domain, the distribution
of the external loads or specific values of some field components. In the
most general cases these correspond to plane strain, plane stress and axy-
symmetric problems. In the following example we present the special case of
a two-dimensional idealization in a plane strain problem in which zz = 0.

Consider the double wedge of side ` and internal angle 2φ shown in fig. 4.2.
It is assumed to be contained in the X − Y plane, with loading conditions
satisfying a plane strain idealization. The material is elastic and described
by Lame constants λ and µ. The wedge is loaded by uniform tractions of
intensity S applied over its four faces in such a way that the wedge is self-
equilibrated. We wish to find the elasticity solution for the stress, strain and
displacement fields throughout the problem domain.

Under two-dimensional plane strain conditions the general three-dimensional


CHAPTER 4. THE BOUNDARY VALUE PROBLEM 73

l l
S

S
x

S
S

l l

Figure 4.2. 2D Self-equilibrated wedge.

stress equilibrium equations 4.1 reduce to:


∂σxx ∂τxy
+ =0
∂x ∂y
(4.7)
∂τxy ∂σyy
+ =0
∂x ∂y
while the kinematic relation 4.2 reads
∂u
xx =
∂x
∂v
yy = (4.8)
∂y
∂u ∂v
γxy = +
∂y ∂x
where u and v are respectively the horizontal and vertical components of the
displacement vector.
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 74

Stress field

The stress field can be obtained by simple inspection from the traction bound-
ary conditions prescribed over the inclined surfaces. Expressing the surface
forces in terms of stresses gives:

X
Fx = 0 −→ −`S cos(φ) + σxx ` sin(φ) = 0
X
Fy = 0 −→ −`S sin(φ) − σyy ` cos(φ) = 0

producing the following stress solution:

σxx = S cot(φ)
σyy = −S tan(φ) (4.9)
τxy = 0 .

In eq. (4.9) the condition τxy = 0 has been assumed as suggested by the
symmetries in the problem. Clearly the above stress field satisfies the local
equilibrium equations, however for it to be the actual solution to the BVP it
must also satisfy the boundary conditions.

Traction boundary conditions

Let us verify that the above stress solution satisfies the traction BCs using
the expression:

tn̂i = σij n̂ij .

Denoting the outward normals to the inclined surfaces of the wedge by


CHAPTER 4. THE BOUNDARY VALUE PROBLEM 75

n̂1 , n̂2 , n̂3 , n̂4 these are given by:

n̂1 = − sin(φ)êx + cos(φ)êy


n̂2 = − sin(φ)êx − cos(φ)êy
n̂3 = + sin(φ)êx + cos(φ)êy
n̂4 = + sin(φ)êx − cos(φ)êy ,

where êx and êy are the reference unit vectors. Now, the components of the
traction vector follow directly.

For the face with normal n̂1 we have

tx = −S cos(φ)
ty = −S sin(φ)

similarly, over the face with normal n̂2 the traction reads

tx = −S cos(φ)
ty = +S sin(φ)

over the face with normal n̂3

tx = +S cos(φ)
ty = −S sin(φ)

and finally, over the face with normal n̂4 ;

tx = +S cos(φ)
ty = +S sin(φ) .
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 76

Note that the above set of tractions found from the relation:

tn̂i = σij n̂ij

and after using the assumed stress field satisfies the problem boundary
condition. Thus the stress field given by eq. (4.9) is the unique solution to
the BVP for the self equilibrated wedge.

Strain field

The strain field can be obtained after using the stress solution found in
eq. (4.9) together with the constitutive law given by eq. (4.3) which for a
plane strain idealization takes the form:
1
xx = (σxx − νσyy )
E
1
yy = (σyy − νσxx ) (4.10)
E
τxy
γxy = .
µ

Particularizing we have:

S S
xx = + [cot(φ) + ν tan(φ)] = + K1 (ν, φ)
E E
S S (4.11)
yy = − [tan(φ) + ν cot(φ)] = − K2 (ν, φ)
E E
γxy = 0.
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 77

Displacement field

The displacement field is obtained after direct integration of the strains after
using the fact that
dui = ij dxj + ωij dxj
and the condition ωxy = 0 (as a result of γxy = 0 which gives:

S
u = + K1 (ν, φ)x + A
E
S
v = − K2 (ν, φ)y + B
E

and where A and B are integration constants while K1 (ν, φ) and K2 (ν, φ)
are also constants that depend on Poisson’s ratio and the wedge internal
angle.

From the condition u = 0 at x = ` cos(φ) we have that

S
A = − K1 (ν, φ)` cos(φ)
E
then it follows that
S
u= K1 (ν, φ)(x − ` cos(φ)).
E

Similarly, from the condition v = 0 at y = 0 we have that B = 0 from


which
S
v = − K2 (ν, φ)y
E

Notebook 7 in the REPO summarizes the BVP and uses interpolation


to visualize the elastic field in the wedge solution.
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 78

4.2 Strong and weak forms of the BVP

In this section we will present the elasticity BVP in an equivalent form suit-
able for finite element formulation. For that purpose, and just for complete-
ness, we will repeat the differential formulation recently described and will
immediately re-write it in an equivalent integral representation.

4.2.1 Strong form

The so-called strong form of the boundary value problem corresponds to the
differential formulation just described, involving the governing equations and
boundary conditions for a well posed problem. In the mathematical literature
it is customary to denote the strong form as {S} and express it like:

Given fi , tn̂i and ūi find ui : V → R such:

(λ + µ)uj,ij + µui,jj + fi = 0 ∀x ∈ V
tn̂i = σij n̂ij ∀x ∈ St (4.12)
ui = ūi ∀x ∈ Su

4.2.2 Weak form

A note on solution functions.

• We are interested in developing methods to obtain approximate solu-


tions to {S}.

• The FEM is formulated starting from a statement equivalent to {S}


in which we use trial functions until certain prescribed conditions are
met.
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 79

• We will look for solutions ui subject to the following conditions:


ui = ūi in Su
Z  2
∂ui
dS < ∞
∂xj
S

The first condition corresponds to the satisfaction of the essential bound-


ary condition, while the second corresponds to the functions being square
integrable. The space of functions satisfying the above two conditions is
denoted by ς and formally defined like
ς = {ui |ui ∈ H, ui = ūi ∈ Su } .

On the other hand, in order to validate the introduced trial functions we


also need testing functions wi also called in the FEM literature weighting or
distribution functions. These functions are arbitrary apart from having to
satisfy the following conditions:
wi = 0 in Su
Z  2
∂wi
dS < ∞
∂xj
S

In what follows we formally denote the space of these functions by V and


define it like
V = {wi |wi ∈ H, ui = wi = 0 ∈ Su } .

Here we will show that the equilibrium statement represented in the dif-
ferential formulation can be described in alternative forms. In such descrip-
tion the continuity requirement for the trial functions is weaker than in the
strong form leading to the term ”weak” statement. Here this alternative
representation will be denoted like {W } and it reads;

Given fi , tn̂i and ūi find ui : V → R and ∀wi ∈ V such:


Z Z Z
σij wi,j dV − fi wi dV − tn̂i wi dS = 0
V V St
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 80

Proof 1:

Let ui ∈ ς be a solution to {S} and let wi ∈ V . Forming the inner product of


the equilibrium statement given in eq. (4.1) with wi and forcing the integral
over the domain to be zero we have
Z
(σij,j + fi )wi dV = 0 ,
V

expanding the terms in the integrand and integrating by parts the first term
on the left we have
Z Z
σij,j wi dV + fi wi dV = 0 ,
V V
Z Z Z
− wi,j σij dV + σij n̂j wi dS + wi fi dV = 0 ,
V S V

since wi ∈ V it follows that wi = 0 in Su from which


Z Z Z
σij wi,j dV − fi wi dV − tn̂i wi dS = 0 . (4.13)
V V St

Now, considering that ui is solution of the strong form {S} it must satisfy
ui = ūi ∈ Su and as a result ui ∈ ς. On the other hand, since ui satisfies
eq. (4.13) ∀wi ∈ V we have that ui satisfies the definition of weak solution
specified in {W }.

Proof 2:

Let ui be a solution of {W } and thus ui ∈ ς which means that


ui = ūi ∈ Su
and that it satisfies
Z Z Z
σij wi,j dV − fi wi dV − tni wi dS = 0 ,
V V St
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 81

integrating by parts,
Z Z Z Z
− σij,j wi dV + σij nj wi dS − fi wi dV − tni wi dS = 0
V S V St

Since wi ∈ V we have that wi = 0 in Su and therefore


Z Z
wi (σij,j + fi ) dV + wi (σij nj − tni ) dS = 0
V St

from which

σij,j + fi = 0 x ∈ V
tni = σij nj ∀x ∈ St (4.14)
ui = ūi ∀x ∈ Su

which is once again the strong form of the problem given in eq. (4.1).

4.3 Variational formulation

In this section we formulate the boundary value problem using the approach
of the calculus of variations in which the governing PDEs and boundary con-
ditions are obtained after finding the minimum (or maximum) of a functional
according to a variational principle3 .
3
According to Wikipedia [? ]

A variational principle is a scientific principle used within the calculus


of variations, which develops general methods for finding functions which
minimize or maximize the value of quantities that depend upon those func-
tions. For example, to answer this question: “What is the shape of a chain
suspended at both ends?” we can use the variational principle that the shape
must minimize the gravitational potential energy.
According to Cornelius Lanczos, any physical law which can be expressed
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 82

We will see that the weak form (and therefore also the strong form) can
be obtained alternatively through the process of finding extreme values for
a functional. We will illustrate this idea for the general case of theory of
elasticity and then we will present particular examples.

Some vague definitions in the calculus of variations

In variational calculus a functional can be understood as a “function” hav-


ing as independent variables or arguments a space of vector functions and
producing as a result (or dependent variable) a scalar. For instance, in the
particular case of the theory of elasticity such a “function” corresponds to
the total potential energy functional Π given by;
Z Z Z
1 (n)
Π(ui ) = σij εij dV − fi ui dV − ti ui dS (4.15)
2
V V S

and where the first term in the left hand side corresponds to the internal
strain energy, while the last two terms are the work done by the external
body and traction forces. The above functional has as independent variables
the displacement vector and its spatial derivatives. This is indicated by the
presence of the displacement vector ui in the expression Π(ui ).

In variational calculus we are interested in finding a function ui that


renders the functional Π a maximum or a minimum. In loose terms, the
analogous to the differential operator in calculus of functions is now termed
the variational operator δ (i.e., δ is analogous to ∂x∂ i ). As such δΠ acts over
the function ui and its derivatives as follows
∂ n ui
   
∂Π ∂Π ∂ui ∂Π
δΠ = δui +   δ + ··· +  n δ .
∂ui ∂ ∂x∂ui ∂xj ∂ ∂ ui ∂xj · · · ∂xk
j ∂xj ···∂xk

The following rules apply to the variational operator δ:


as a variational principle describes an expression which is self-adjoint. These
expressions are also called Hermitian. Such an expression describes an in-
variant under a Hermitian transformation.
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 83

• For functionals Π and Φ it follows that


δ(Π + Φ) = δΠ + δΦ

• For functionals Π and Φ it follows that


δ(ΠΦ) = δΠ Φ + Π δΦ

• For a functional Π and an integer n it follows that


δ(Πn ) = n(Πn−1 ) δΠ

• For a functional Π it follows that


Z Z
δ Π dx = δΠ dx

If the variational operator is applied to the functional Π(ui ) it produces


functions or variations in ui which are arbitrary and such δui ∈ V and δui = 0
in Su .

To find an extreme function in the calculus of variations we proceed like


in differential calculus. Here we compute the first variation of the functional
δΠ and solve the variational equation
δΠ = 0 (4.16)
in the unknown function ui .

In the particular case of the total potential energy functional Π this yields
Z Z Z
(n)
σij δεij dV − fi δui dV − ti δui dS = 0 (4.17)
V V St

where we recognize the weak form of the BVP stated previously thus it is
equivalent to the strong form:

σij,j + fi = 0 x ∈ V
tni = σij nj ∀x ∈ St (4.18)
ui = ūi ∀x ∈ Su
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 84

It becomes evident that the functions δui in eq. (4.17) play the role of
the test functions wi introduced in the weak form. On the other hand, since
we have already shown that the weak and strong forms are equivalent we
conclude that having the functional and the essential boundary conditions
is equivalent to having the strong form of the problem. This result can be
formalized in the following principle.

4.3.1 Principle of minimum potential energy

In the theory of elasticity the total potential energy Π is the result of adding
the elastic strain energy which is stored in the body upon deformation and
the potential energy (work) imparted to the body by the applied forces. The
principle of virtual work states that the body is in equilibrium when this
total potential energy reaches a minimum. This is equivalent to stating that
an equilibrium configuration is attained when an infinitesimal variation from
the position of minimum potential energy involves null changes in energy.
This implies the variational condition:

δΠ = 0. (4.19)

The above principle leads to the so-called principle of virtual displace-


ments stated as follows4 :

“The equilibrium of the body requires that for any compatible


small virtual displacements satisfying the condition of being zero
at Su , imposed on the body in its state of equilibrium, the total
internal virtual work is equal to the total external virtual work”
Z Z Z
(n)
σij δεij dV − fi δui dV − ti δui dS = 0
V V St

where δui are the virtual displacements and δεij are the correspond-
ing virtual strains.
4
See Bathe pp 156.
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 85

Comparing the virtual work principle with the weak formulation given in
eq. (4.13) we identify δui with the test functions wi . As such the PVW takes
the form of a powerful tool to test if a body is in equilibrium for a given
solution (represented by the trial functions). In what follows we illustrate
the use of the principle through some examples corresponding to problems
in Bathe’s textbook.

Problem5

Establish the differential equation of equilibrium of the problem shown and


the boundary conditions. Determine whether the differential operator of the
problem is symmetric and positive definite and prove your answer.[? ]

A(x) = A0(2 - x/L)


x
A0

k
R

Figure 4.3. Rod with varying cross-sectional area. The Young’s modulus
is E.

ZL
1 1
Π= σxx εxx A(x) dx + ku20 − RuL
2 2
0
ZL  2
1 du 1
= EA(x) dx + ku20 − RuL .
2 dx 2
0
5
3.15 from Finite Element Procedures
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 86

The first variation for this functional is


ZL
du d δu
δΠ = EA(x) dx + ku0 δu0 − R δuL .
dx dx
0

If we integrate by parts, we obtain

ZL   L
d du du
δΠ = − EA(x) δu dx + EA(x) δu + ku0 δu0 − R δuL
dx dx dx 0
0

from which
 
d du
EA(x) =0
dx dx
du
EA(x) = ku0
dx x=0
du
EA(x) =R
dx x=L

The statements:
Z Z Z
(n)
σij δεij dV − fi δui dV − ti δui dS = 0
V V St

complemented by the condition ui = ui ∀x ∈ Su


and

σij,j + fi = 0 x ∈ V
tni = σij nj ∀x ∈ St
ui = ūi ∀x ∈ Su

are equivalent.
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 87

The Hu-Washizu Variational Principle-Alternative formulation of


the variational statement6 Consider the Hu-Washizu functional:
Z Z

Π = Π − λij (εij − Lijk uk ) dV − λui (uSi u − ūi ) dS
ε
(4.20)
V Su

where

• Π: is the potential energy functional.

• Lijk is a differential operator such εij = Lijk uk .

• Su surface where essential boundary conditions are prescribed.

• λεij and λui are Lagrange multipliers.

Using the condition δΠ∗ = 0 derive for the interior of the body the equi-
librium equations
σij,j + fi = 0
the strain-displacement relationship

εij = Lijk uk

and the constitutive equation

σij = Cijkl εkl

and at the surface of the body the relation between the stress tensor and the
applied tractions vector at St

ti = σij nj

the relation between the stress tensor and the unknown tractions vector (or
reactions) at Su
ti = σ˜ij nj
and the essential boundary condition at Su

ui = ũi
6
4.35 from Finite Element Procedures
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 88

We want to determine the Euler equations resulting from the condition δΠ∗ =
0. Applying the variational operator we have
Z Z
∗ ε
δΠ = δΠ − δλij (εij − Lijk uk ) dV − λεij (δεij − Lijk δuk ) dV
V V
Z Z (4.21)
− δλui (uSi u − ūi ) dS − λui δuSi u dS
V V

and
Z Z Z

δΠ = Cijkl εkl δεij dV − ti δui dS − fi δui dV
V St V
Z Z Z
− λεij δεij dV + λεij Lijk δuk dV − δλεij (εij (4.22)
V V V
Z Z
− Lijk uk ) dV − δλui (uSi u − ūi ) dS − λui δui dS = 0
S Su

using Z Z Z
(λεij δui ),j dV = λεij δui,j dV + λεij,j δui dV
V V V

In the above we can write


Z Z Z
λij Lijk δuk dV = (λij δui ),j dV − λεij,j δui dV
ε ε

V V
Z ZV
= λεij δui n̂j dS − λεij,j δui dV
St V
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 89

therefore
Z Z Z

δΠ = (Cijkl εkl − λεij ) δεij dV − ti δui dS − fi δui dV
V St V
Z Z Z
+ λεij δui n̂j dS − λεij,j δui dV − δλεij (εij
St V V
Z Z
− Lijk uk ) dV − δλui (uSi u − ūi ) dS − λui δui dS = 0
Su Su
Z Z
= (Cijkl εkl − λεij ) δεij dV + (λεij n̂j − ti )δui dS
V St
Z Z
− (λεij,j + fi ) δui dV − (εij − Lijk uk ) δλεij dV
V
Z ZV 
− (uSi u − ūi ) δλui dS − λui δu

Su
i dS = 0

Su S
 u


Now, imposing the conditions δεij 6= 0, δλεij 6= 0, varui 6= 0 in St , δui 6= 0


in V and δλui 6= 0 in Su we have

λεij = Cijkl εkl (4.23)


εij = Lijk uk (4.24)
ti = λεij n̂j (4.25)
λεij,j + fi = 0 (4.26)
uSi u = ūi . (4.27)

Proposed problems

1. For the following displacements field:

u = a(x2 − 5y 2 )î + (2axy)ĵ

(a) Find the strain tensor.


CHAPTER 4. THE BOUNDARY VALUE PROBLEM 90

(b) Find the principal strains.


(c) Find the principal stresses.
2. Figure 4.4 shows a cantilever beam of unitary cross section with a
distributed load applied at the free edge and following a parabolic dis-
tribution given by:

P c2 y2
 
t= 1− 2 ĵ
2I c
.
The stress solution is given by:
P
σxx = − xy ,
I
σyy = 0 ,
P
σxy = − (c2 − y 2 ) .
2I
while the displacement field reads:

ν P y3
 2
x 2 c2 P y
  
1 l
ux = − + − − ,
G E 6I E E G 2I
νP xy 2 P x3 P l2 x P l3
uy = + − + ,
2EI 6EI 2EI 3EI
where G = E/(2 + 2ν) is the shear modulus and I is the moment of
inertia of the cross section.

1 l
c x
c
P

y
Figure 4.4. Cantilever beam with a distributed load at the end.
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 91

(a) Identify the displacement and traction boundary conditions of the


problem.
(b) Verify that the stress and displacement solutions satisfy the proper
boundary conditions.
(c) Find the region of the beam under tension and compression and
thus its neutral axis. Find the equation corresponding to the
displacement of the neutral axis and compare it with beam theory.
Chapter 5

FEM formulation of the


elasticity BVP

Preliminary

The previous chapter covered the boundary value problem for the model
of theory of elasticity. It was shown that the model could equivalently be
written in strong form (i.e., governing equations and boundary conditions)
or in weak form. It was also shown that a particular interpretation of the
weak form was that of the principle of virtual displacements. In this chap-
ter we start from this principle and use interpolation theory to approximate
both physical and virtual functions. As a result, this weak form of the BVP
becomes a system of linear equations in the interpolation parameters that
artificially enforce the principle of virtual displacements. The resulting fi-
nite element equations are shown to be equivalent to those governing the
mechanical equilibrium of a discrete system of particles. To facilitate con-
ceptual understanding we find first the equations for a single element and
then proceed to consider the full mesh after invoking equilibrium and dis-
placement compatibility conditions along element interfaces.

92
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 93

At the end of this chapter1 the student should be able to:

• Use interpolation theory to write the finite element based discrete ver-
sion of the principle of virtual work.

• Recognize the finite element equilibrium equations of the elasticity BVP


as physically analogous to those of a discrete system of particles.

• Understand the computational steps required for the implementation


of the finite element. equilibrium equations in a computer language
like Python.

• Understand the approximate nature of finite element solutions.

5.1 FE algorithm starting from the weak for-


mulation of the BVP

In the previous chapter it was shown that the elasticity BVP could equiv-
alently be formulated in differential and integral form in a so-called weak
formulation. In this section we show that a simple finite element algorithm
can be obtained if one introduces discretization, through the use of interpo-
lation theory, into this weak form. Discretization appears in two forms: first,
when one assumes that a primary variable is known at discrete (nodal) points
and second when the interpolation functions exist over finite sub-domains or
elements. For completeness we start by recalling the weak formulation in-
troduced previously and then use our combined index notation for scalar
components of tensorial functions and for componentes of nodal variables.
The weak form is then given as follows:

Given the body forces fi , the surface tractions tn̂i prescribed over the part
of the boundary St and the surface displacements ūi prescribed over the part
1
This chapter, together with theoretical and computational learning activ-
ities is complemented by Jupyter Notebooks 8 through 12 available at the
course REPO.
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 94

of the boundary Su find the displacement field ui : V → R and such ∀wi ∈ V


it satisfies: Z Z Z
σij wi,j dV − fi wi dV − tn̂i wi dS = 0.
V V St

In the expression above V represents the complete problem domain while


St is that part of the boundary over which tractions are prescribed. Assume
now that the full domain V is divided into N U M EL non-overlapping sub-
domains (or finite elements) as shown schematically in fig. 5.1

Figure 5.1. Meshed blow

and in such a way that mathematically this can be expressed like:

[
V = Ωe

and where Ωe represents the sub-domain occupied by one such an element.


CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 95

In the original strong form of the BVP the partial differential equa-
tions result from equilibrium arguments valid over infinitesimal ma-
terial points occupying the domain V . In the FEM the operation of
dividing the full domain V into NUMEL subdomains is equivalent
to rendering the continuous problem with infinite material points into
a discrete problem with a finite number of elements. In conclusion, a
finite element is the discrete approximation of an infinitesimal material
point.

Note that each element is defined by an ordered set of nodal points estab-
lishing a prescribed interpolation space and used to conduct function approx-
imations. In this element partition adjacent elements are connected through
the nodal points in such a way that interpolation functions exist only within
its element but are continuous through element interfaces. Using this parti-
tion in the weak form of equilibrium and using a summation symbol yields;

XZ XZ XZ
σij wi,j d Ωe − fi wi d Ωe − ti wi d Se = 0
e Ωe e Ωe e Se

which is still the same form of the weak equilibrium expression.

In a second discretization operation we use interpolation methods to ap-


proximate both, the displacement field ui and the weighting function wi over
each element as discussed previously. In particular assume that inside every
element the fields can be approximated like:

ui (→

x ) = NiQ (→
− uQ
x )b
w (→−
x ) = N Q (→
i
− bQ
x )wi

and where uQ represent the scalar components of the displacement vector


at the nodal point Q, NiQ (→−x ) is the shape function for the nodal point Q
evaluated at the field point →

x and ui (→−x ) is the interpolated approximation
to the displacement vector at the field point → −x.
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 96

Recall that in expressions like

ui (→

x ) = NiQ (→
− uQ
x )b
the repeated super-script Q implies summation over Q = 1, .., N nodes
where N nodes is the number of nodes of the element.

Considering the displacement field as the primary variable we can write


in terms of the elastic constitutive tensor:

Q →
σij = Cijkl εkl ≡ Cijkl Bkl (− uQ
x )b

after using

εij (→
−x ) = BijQ (→
− uQ
x )b
w(i,j) (→

x ) = BijQ (→−
x )wbQ

and where

" Q
#
1 ∂NiQ ∂Nj
BijQ (→

x) = + .
2 ∂xj ∂xi

Substitution of the above in the discretized weak form gives us for an


arbitrary e-element of domain Ωe

Z Z Z
P Q (n)
w
b BijP Cijkl Bkl Q
b −w
d Ωe u b P
NiP fi d Ωe − w
b P
NiP ti d se = 0.
Ωe Ωe Se

Note that wi in the above expression is an arbitrary function and it is


convenient to assign values like
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 97

bT = 0 · · · 1 · · · 0
 
w

bP in such a
in turn for every node in order to cancel the common term w
way that we can write for an arbitrary P degree of freedom:

Z Z Z
Q
BijP Cijkl Bkl bQ
dΩe u = NiP fi dΩe + NiP ti dSe .
Ωe Ωe Se

In this expression the dummy superscripts imply a summation over the


number of nodes of the element in such a way that the only free index is
P which in this compact notation implies also that we have a system of
equations corresponding to P = 1, .., N nodes, which is the number of nodes
of the element. Note also that the term KeP Q defined by

Z
Q
KeP Q = BijP Cijkl Bkl d Ωe
Ωe

represents the force along degree of freedom P due to a unit displacement


along degree of freedom Q. In this sense we can define the following set of
nodal forces along the P -th degree of freedom:

fσP = KeP Q u
bQ
Z
P
fB = NiP fi d Ωe
Ωe
Z
P (n)
fc = NiP ti d Se
Se

satisfying

fσP = fBP + fCP (5.1)


CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 98

and where fσP , fBP and fCP are forces due to the internal element stresses,
body forces and surface tractions respectively.

Equation (5.1) which can also be written like:

bQ = fBP + fCP
KeP Q u

is an equation in the nodal displacement uQ . However it must be observed


that this equation has been derived for a single element Ωe and the possible
contribution in terms of forces and stiffness terms from additional elements
is yet to be considered. This final step, leading to the assembly of the global
system of equilibrium equations (to be discussed later) gives:

 G  G
= RHS G

K U (5.2)

and where the term RHS G is a vector of assembled global forces of the
type fBP + fCP storing the contribution from body forces and external surface
tractions.

The details of the Python implementation of the stiffness matrix:


Z
PQ Q
Ke = BijP Cijkl Bkl d Ωe
Ωe

are presented as an in-class activity in Notebook 6. This activity re-


quires prior knowledge of interpolation (see Notebook 3) and numerical
integration.
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 99

5.2 FE algorithm starting from the principle


of virtual work

As shown in the previous chapter a valid solution (ui , σij , ij ) to the well-posed
boundary value problem in theory of elasticity and where ui = ui in Su

satisfies

Z Z Z
(n)
σij δεij dV − fi δui dV − ti δui dS = 0 (5.3)
V V St

for arbitrary functions δui such that δui = 0 in Su and where:

 
1 ∂δui ∂δuj
δεij = + .
2 ∂xj ∂xi

After using the same arguments and interpolation scheme as in the weak
form discretization eq. (5.3) leads to:

Z Z Z
Q
BijP Cijkl Bkl bQ
dΩe u = NiP fi dΩe + NiP ti dSe
Ωe Ωe Se

which is the same equation resulting from the discretization of the weak
form.

Note that the PVW statement is an scalar (energy) equation relating the
strain energy,

Z
δEs = σij δεij d Ωe
Ωe
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 100

accumulated in the elastic solid as a result of the imposed virtual strain


field δεij to the work of the external loads

Z Z
(n)
δW = fi δui d Ωe + ti δui d Se
Ωe Se

due to the imposition of the virtual displacement δui .

Using the same notation as in the previous algorithm the discrete version
can also be written like:

uP fσP − δb
δb uP fBP − δb
uP fcP = 0

and after using the arbitrariness in δui

fσP − fBP − fcP = 0. (5.4)

In a sense the FEM scheme makes use of interpolation theory to convert


the continuous BVP governed by a set of partial differential equations into a
discrete problem governed by a set of algebraic equations. Within this con-
text eq. (5.4) can be interpreted as the force equilibrium equation governing
the response of a particle P subject to the action of:

• External nodal forces fBP consistent with body forces fi .


(n)
• External nodal forces fcP consistent with surface tractions ti

• Internal forces fσP consistent with element stresses and equilibrating


the external forces.

On the other hand, recall that the PVW statement only holds if the set
(ui , σij , ij ) is the actual solution to the BVP. This fact implies that in the FE
formulation where we only have an approximate solution ui (→ −x ) = NiQ (→
− uQ
x )b
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 101

the principle does not hold as this is not the actual solution. However, the
nodal displacements found after solving eq. (5.4) enforces such condition.

Since the finite element equation written in the form the term:

fσP = KeP Q u
bQ
represents nodal forces equivalent to element stresses the coefficients
KeP Q represent the nodal force along degree of freedom P due to a unit
displacement along degree of freedom Q.

5.3 Global assembly

The fundamental equation

KeP Q u
bQ = fBP + fcP (5.5)

resulting from the discretization of the PVW through the introduction of


interpolation functions was derived over a single element of domain ωe . In
order to consider the contribution from all the elements in a finite element
discretized version of a solid we use Newton’s third law of motion (action
and reaction principle). For that purpose recall that the term fCP in eq. (5.5)
corresponds to the contact forces resulting from surface tractions and it is
computed according to:

Z
fcP = NiP tni d S (5.6)
St

where it is evident that they depend on the external outward normal


vector n
b over St . Clearly, the mechanical interaction between two elements in
contact takes place through these contact forces. To explain this interaction
consider the schematic mesh shown in fig. 5.2 below:
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 102

Figure 5.2. 4-elements mesh

Focusing attention in elements 1 and 2 let the interacting surface be


labelled as Sb and extend this notation to the degrees of freedom and forces
in such a way that the degrees of freedom of nodal points along Sb would
be named Ub while those at other parts of the element would be named Uc .
Accordingly the finite element equilibrium equations for each element can be
written like:

   1 1
 
Fa Kaa Kab Ua
= 1 1 (5.7)
Fb (b
n) Kba Kbb Ub

and

   2 2
 
−Fb (b
n∗) Kbb Kbc Ub
= 2 2 (5.8)
FC Kcb Kcc Uc

The dependency of the contact forces along the common interface Sb


upon the normal outward vector n
b has been made explicit in the equations.
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 103

In particular this vector reads n b∗ for element 2 and they


b for element 1 and n
satisfy:

n∗ .
b = −b
n

Using this relation between the normal vectors at the contact interface
we can write for the nodal forces:

Fb (b n∗ ) = 0
n) + Fb (b

or equivalently

n) − Fb (b
Fb (b n) = 0. (5.9)

This condition is shown for completeness in fig. 5.3

Figure 5.3. Equilibrated nodal forces along the contact interface Sb of


elements 1 and 2.

where it is evident that the contact nodal forces along element interfaces
are equal and opposite in accordance with Newton’s third law. On the other
hand, from displacements continuity we have the condition:
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 104

UB = UB1 = UB2 . (5.10)

Using eq. (5.9) and eq. (5.10) in the equilibrium relationships yields the
partial assemblage of the global stiffness matrix resulting after considering
the interaction between elements 1 and 2:

 1 1
   
Kaa Kab 0 Ua  Fa 
1
 Kba 1 2 2
Kbb + Kbb Kbc Ub = 0 . (5.11)
2 2
0 Kcb Kcc Uc Fc
   

Note that in the right hand side vector from the above assembled global
equilibrium equations only contact forces have been included. This process of
adding elemental matrices through contact nodal forces is termed element
assembly and it is symbolically written like:

N^
umel
KG = ki (5.12)
i=1

and where K G is the global VNcoefficient matrix; k i is the local elemental


umel
matrix for the i-th element; i=1 is the assembly operator and i is an
element index ranging between 1 and the total number of elements N umel
that conform the finite element model. Notice that the assembly operator
is analogous to a summation operator commonly used in the representation
of series of finite or infinite number of terms, however in the finite element
algorithm the assembly operator contains information indicating the position
of each single term from the element coefficient matrix within the global
system.

In most finite element codes the assembly operator is an array of integer


values indicating the position (row and column) from each coefficient
of the stiffness matrix of a given element. In SolidsPy this operator
is termed the DME() operator and it is computed in the assembly
module ASSEMUTIL.
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 105

5.4 The assembly algorithm

In this section we will discuss the fundamental algorithmic steps required for
building the system of algebraic equations through the addition or assembly
of elemental coefficient matrices as described by eq. (5.12). This process of
assembly of the elemental coefficient matrices into the global system involves:

• (i) The identification of the active degrees of freedom (or equation


numbers) assigned to each node in the mesh.

• (ii) The identification of the relationship between the elemental degrees


of freedom and the global degrees of freedom.

• (iii) The computation of the coefficient matrix for each element in the
model.

In the finite element jargon the word elemental commonly refers to


variable or computations performed at the element level.

Step (i) is easily accomplished by assigning a boundary condition flag


to the degrees of freedom existing at each node indicating if the degree of
freedom is active, in which case it contributes with an equation, or if it is
prescribed, in which case it contributes with a specified displacement bound-
ary condition. In our notation we use a 0 value to indicate an active degree
of freedom and a −1 value to indicate a prescribed degree of freedom. In
the Python based code SolidsPy this information is stored in a boundary
conditions array termed IBC and with dimensions nn × M DIM , where nn
corresponds to the total number of nodal points and M DIM represents the
problem dimensionality. The IBC array is first given to the program through
an input data file and later translated from 0s and −1s to equation numbers.
Thus during this process the boundary condition flag is read and equations
are counted and numbers assigned according to the result. If the boundary
condition flag is equal to 0 the program assigns an equation number while it
retains a −1 value for a −1 flag. In summary, the IBC array exists in two
instances. In its first instance it just contains integer flags indicating active
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 106

or restrained degrees of freedom at each node while in a second instance it


indicates the actual active equations existing at each node.

In parallel and also with data given through an input file, the nodes con-
forming each element are stored in a connectivity array termed IELCON
and of dimension N umel × M xN N el where N umel is the number of ele-
ments in the model and M xN N el is the maximum number of nodes in a
given element. Thus each row in the IELCON array stores the nodal point
data for the element. Each entry in the IELCON array can now be directly
translated into equation numbers using the processed version of the IBC
array.
VN umelThis process results in the discrete version of the assembly operator
i=1 also called the assembly list or the DM E operator in SolidsPy.

In the final step the mesh is looped one element at a time and each
elemental coefficient matrix is assembled into the global matrix using the
information (equation numbers) stored in the DM E operator. The actual
computation of the elemental matrix is conducted by an element based sub-
routine, called U EL in SolidsPy. These subroutines may be different for
each element in the mesh according to different kinematic o material assump-
tions. The assembly process is further illustrated by the following sample
problem.

Example For the mesh shown in fig. 5.4 where the elements are numbered
from left to right and bottom to top write:

• (i) The boundary conditions array IBC() in its two instances.

• (ii) The connectivities array for the mesh.

• (iii) The assembly DME() operator.

(i) In a first instance the boundary conditions array IBC() is filled with
data assigned by the user in the input file. Since all the nodes in the bot-
tom and top faces of the mesh are restrained in the horizontal and vertical
directions they are assigned the flag −1 in each column. Similarly, node 4 is
restrained only in the horizontal direction so it is assigned a −1 in the first
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 107

7 8 9

2.0
4 5 6
P

2.0
1 2 3

2.0 2.0
Encastre

Roller

Figure 5.4. Mesh of 4 bi-linear finite elements.

position and a 0 in the second position, while nodes 5 and 6 are completely
free along both directions and they are assigned values of 0. The resulting
array is given by:

 
−1 −1
−1 −1
 
−1 −1
 
−1 0
 
0
IBC1 =  0
0 0
 
−1 −1
 
−1 −1
−1 −1

In a second instance the boundary conditions array IBC() is modified


by the program which reads every value retaining those corresponding to −1
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 108

and assigning sequential numbers to those corresponding to 0. Accordingly


the first equation identified as U0 corresponds to the vertical displacement
of nodal point 4 while the remaining 4 equations associated to degrees of
freedom U1 , U2 , U3 , U4 are the horizontal and vertical displacements of nodes
5 and 6. The final form of the array is given like:

 
−1 −1
−1 −1
 
−1 −1
 
−1 0
 
1
IBC2 =  2
3 4
 
−1 −1
 
−1 −1
−1 −1

(ii) The next step corresponds to the creation of the connectivities array
IELCON() storing the nodal points defining each element. In this case each
element is defined by a list of 4 nodal point numbers. Recall that for the
computation of the elemental stiffness matrix each element in the physical
mesh is mapped to the canonical element in the natural space. In the natural
space the shape functions are associated to a fixed node numbering and
element orientation. If one follows a counter-clockwise orientation the node
numbering must follow the same counter-clockwise orientation in the physical
space. However the selection of the first node in the sequence is arbitrary
and the mapping into the natural space will take care of the corresponding
rotation. In this case a valid connectivities array is that given by:

 
0 1 4 3
1 2 5 4
IELCON = 
3

4 7 6
4 5 8 7

(iii) The final ingredient required for the assembly of the global system of
equations is the so-called DME() operator. This is actually the same IEL-
CON() array but translated into equation numbers assigned at each element.
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 109

Computationally this involves a subroutine that runs over the IELCON()


array, reads the value of the nodal identifier and then extracts the assigned
equation numbers from the boundary conditions array IBC(). In this exam-
ple the assembly operator consistent with the definition of the connectivities
array corresponds to:

 
−1 −1 −1 −1 1 2 −1 0
−1 −1 −1 −1 3 4 1 2
DM E = 
−1 0

1 2 −1 −1 −1 −1
1 2 3 4 −1 −1 −1 −1

A note on the assembly operator: The definition of the element con-


nectivities and its subsequent translation into degrees of freedom is carried
out according to the local or canonical element definition in the natural
space(fig. 5.5)

8 6
7 5
Node 4 Node 3

2 4
1 3
Node 1 Node 2

Figure 5.5. Local definition for a 4-noded element.

As a result the (i, j) entry in the DM E array corresponds to the global


equation number associated with the local degree of freedom j of the i el-
ement. For instance the value of 3 stored at position (1, 4) in the current
DME() operator indicates that the global equation 3 corresponds to the
local equation 4 (column index) in element 1 (row index).
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 110

The assembly process is then conducted by identifying the relation be-


tween the entries in each row of the DME() operator and the list of local
degrees of freedom for the reference element shown in fig. 5.5. Accordingly,
for element 1 it follows that the assembly of row 4 of the local stiffness matrix
proceeds as follows:
G G 1
K3,3 ← K3,3 + k4,4
G G 1
K3,4 ← K3,4 + k4,5
G G 1
K3,1 ← K3,1 + k4,6

5.5 Summary: The finite element algorithm

At this point it becomes evident that the algorithm for the displacements
based finite element method reduces to the solution of a linear system of
algebraic equations in the unknown nodal displacements U G resulting af-
ter assembling the contribution to the stiffness matrix K G and loads vector
RHS G from all the elements in the mesh. This process can be summarized
in the 4-steps pseudo-code described in algorithm 2:

Algorithm 2: Global steps involved in the finite element algorithm


Data: Finite element model
Result: Field function
PREPROCESSING (Reads the model and computes IBC(),
IELCON() and DME() arrays);
ASSEMBLY
 G   G (Forms
 the system of equations
K U = RHS G );
SOLUTION (Finds U G );
POSTPROCESSING (Scatter the global solution to the elements
and computes element forces, strains, and stresses);

In the pre-processing stage the code reads the input file and forms the
arrays IBC(), IELCON() and DME() which are required for the assem-
bly process. Once the global system of equations is assembled and solved,
the values of the nodal displacements are distributed to the corresponding
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 111

elements in a process commonly referred to like scattering. This process is


somehow inverse to the assembly operation. With the nodal displacements
for each element at hand it is now possible to compute nodal forces together
with strain and stress distributions inside the element. The assembly and
solution process is given in algorithm 3. In this algorithm it must be noticed
that the local stiffness matrix for each i element is obtained by the call to
the local element subroutine UEL().

Algorithm 3: Details of the assembly and system solution process


Data: Finite element model
Result: Field function
READ IBC() and IELCON() arrays from input files ;
COMPUTE modified IBC() array ;
COMPUTE DME() operator (using IBC() and IELCON()
arrays);
INITIALIZE Global stiffness matrix K G ← 0.0;
(Start assembly)
for i ← 1 to N umel do
Call UEL(element parameters;k i ) ;
K G ← K G +i (Assemble each k i into K G according to the
DME() operator);
RHS G ← RHS G + rhsi (Assemble each rhsi into RHS G );
end
SOLVE K G U G = RHS G ;
Scatter nodal displacements solution to the elements

The details of the elemental subroutine UEL() are given in algorithm 4.


This process basically involves looping through the Gauss points and com-
puting the required terms. The computation of the the strain-displacements
matrix B(rj , sj ) and Jacobian determinant kJj k at each Gauss point is con-
ducted by additional subroutines.
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 112

Algorithm 4: Details of the elemental UEL subroutine


Data: Material parameters, nodal coordinates, applied loads
Result: k l and rhsl
INITIALIZE k l ← 0.0 ;
COMPUTE constitutive tensor Cijkl ;
FORM Gauss quadrature arrays w() and r(), s();
(Start loop through the Gauss points)
for j ← 1 to N gpts do
RETRIEVE rj , sj , wj ;
COMPUTE kJj k, B(rj , sj ) ;
k l ← k l + B T CB kJj k kJj k ;
end

Proposed problems

1. In the bi-linear element shown in fig. 5.6 the nodal displacements re-
sulting from a finite element solution are indicated by the blue arrows.
For the material parameters given in the figure find the nodal forces
consistent with the element stresses. Assume plane strain behaviour.

Figure 5.6. One-element mesh for problem 1.


CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 113

2. For the mesh shown in the figure, with internal surfaces between el-
ements 1-3 and 3-2 labelled Sb and Sc respectively, write the form of
the global stiffness matrix resulting from the physical assembly. Ex-
plicitly formulate the force and displacement compatibility equations
along both boundaries

Figure 5.7. Long mesh for problem 2.

3. For the mesh shown in the figure propose different node numbering
schemes and identify the resulting changes in the size of the half-band
in the stiffness matrix. Assume that each element subroutine is full of
1s.
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 114

Figure 5.8. Long mesh for problem 3.

4. A finite element model is conformed by an assemblage of three elements


of the type shown in fig. 5.9

Figure 5.9. Fundamental element

and with a stiffness matrix (in the global coordinate system) given by:
 
1 1 1 1
1 1 1 1
k=
1

1 1 1
1 1 1 1.

On the other hand, it is known that global stiffness matrix has been
assemble using the following operator
CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 115

 
−1 −1 2 3
DM E = −1 −1 1 −1
1 −1 2 3

in which a value of −1 refers to a restrained degree of freedom and thus


equal to zero. It is required to:

• Draw the complete model including its displacement boundary


conditions.
• Indicate the order of the global stiffness matrix for the complete
structure.
• Find the global stiffness matrix for the structure.

5. Using SolidsPy compute the stress concentration factor defined accord-


ing to:

max σyy
SCF =
promedio σyy

and introduced after drilling a hole in the following plates:

Figure 5.10. Plates with holes.

In both cases the material parameters are defined in table 5.1


CHAPTER 5. FEM FORMULATION OF THE ELASTICITY BVP 116

Parameter Value
Young’s modulus (Pa) E = 200 × 109
Poisson’s ratio ν = 0.285
Load (N/m) S = 108

Table 5.1. Material parameters for the analysis defined in problem 2.

while the geometric parameters are those of table 5.2

a b h w
20 40 50 100

Table 5.2. Geometric parameters for the analysis defined in problem 2.


Appendices

117
Appendix A

Combined index notation for


finite element analysis

A.1 Combined index notation for finite ele-


ment analysis

In the formulation of finite element methods it is customary to start from


expressions written in index notations like:

Z
δW = σij δui,j dV
V

and then proceed to introduce discretization or approximations via in-


terpolation theory. In this case it is useful to combine index notation to
describe the physical tensorial fields and at the same time the superposition
implicit in interpolation schemes. In this appendix we clarify the use of such
combined index notation.

118
APPENDIX A. COMBINED INDEX NOTATION FOR FINITE ELEMENT ANALYSIS119

A.1.1 Index notation of Cartesian tensor fields

In index notation vector and tensor fields are represented by a letter defining
the name of the field and a set of different subscripts (or index). The number
of different indices associated to the letter indicates whether the field is a
vector (1 index), a second order tensor (2 indices), a third order tensor (3
indices) as in:
ui , σij , Cijk

and further clarified next.


*
Consider a vector u represented in a Cartesian reference system in terms
of its scalar components ux , uy , uz . The following representations of the vector
are equivalent:

  *
ui ↔ ux uy uz ↔ u = uxbi + uyb
j + uz b
k.

In the first case, the vector is denoted by the letter u and by


 the subscript

i which represents in condensed form the scalar components ux uy uz of
the vector.
*(2)
Similarly, consider a second order tensor σ represented in a cartesian
reference system in terms of its scalar components σxx , σxy , σxz , σyx , σyy , σyz , σzx , σzy , σzz .
The following representations of the tensor are equivalent:

 
σxx σxx σxx
*(2)
σij ↔ σxx σxx σxx  ↔ σ .
σxx σxx σxx

Note that each free or different subscript associated to a letter is a con-


densed representation of normal scalar components along a basis bi − b j−b k.
Accordingly, in the case of the second order tensor the subscript i represents
variation through x − y − z and subscript j represents variation through
x − y − z.
APPENDIX A. COMBINED INDEX NOTATION FOR FINITE ELEMENT ANALYSIS120

A.1.2 The summation convention

In the context of indicial notation subscripts which appear repeated (forming


pairs) are used to represent summation. The most simple example is the rep-
resentation of the dot product between two vectors which can be represented
in the following alternative forms:

3


u ·→

X
w ↔ ux wx + uy wy + uz wz ↔ ui wi ↔ ui wi .
i=1

Accordingly repeated indices represent summation over the range of vari-


ation of the index.

A.1.3 Indicial notation in interpolation

From interpolation theory we know that a function f (x) can be approxi-
mated in terms of n known values of the solution f 1 f 2 ...f n using a
superposition like

f (x) = L1 (x)f 1 + L2 (x)f 2 + ... + Ln (x)f n

and where the terms Lk s are n interpolation functions of order n−1. This
approximated function can also be represented in terms of indicial notation
where we now use capitalized superscripts to refer to the components of the
interpolation set as follows:

f (x) = LQ (x)f Q .

In the expression above the approximated function represents a scalar


quantity varying over a one-dimensional domain with independent variable
x.. In the case of approximation via interpolation theory of vector or tensor
APPENDIX A. COMBINED INDEX NOTATION FOR FINITE ELEMENT ANALYSIS121

valued functions we will have subscripts indicating the scalar components


of the vector or tensor field and superscripts representing the interpolation
polynomials. Using explicit notation a vector function ui (x, y, z) varying
over a three-dimensional space with independent variables x, y, z would be
represented like:

ux (x, y, z) = N 1 (x, y, z)u1x + N 2 (x, y, z)u2x + ... + N n (x, y, z)unx


uy (x, y, z) = N 1 (x, y, z)u1y + N 2 (x, y, z)u2y + ... + N n (x, y, z)uny
uz (x, y, z) = N 1 (x, y, z)u1z + N 2 (x, y, z)u2z + ... + N n (x, y, z)unz .

In this representation it has been assumed that each component ux , uy


and uz has been approximated using the same interpolation space. In the
generalization of the indicial notation to the interpolation of the vector valued
function we will associate the subscript, representing the scalar components
of the field to the interpolation polynomials. Thus the above expression
would be written like:

ui (x, y, z) = NiQ (x, y, z)uQ

or

ui (→

x ) = NiQ (→

x )uQ

after considering →

x ≡ x, y, z.

The subscript i, representing the physical components of the vector field


ui has been carried out as a subscript to the shape function N Q for the nodal
point Q, while the term uQ refers to the scalar components of the field ui at
the nodal point Q. The main advantage in this notation is the possibility of
conducting further operations, as required in the derivation of very general
finite element algorithms, while combining physical and discrete information.
APPENDIX A. COMBINED INDEX NOTATION FOR FINITE ELEMENT ANALYSIS122

Example In the expression

Z
δW = σij δui,j dV
V

assume that the primary variable is the displacement field ui in such a


way that at the nodal point Q the displacement vector uQ is known. Write
the interpolated version of δW.

First, let us write the interpolated approximation to the displacement


field δui carrying the subscript to the shape functions:

δui (→

x ) = NiQ (→

x )δuQ .

To write the interpolated version of δui,j we note that in the expression


above the spatial variation of the field has been assumed by the shape func-
tion so we just extend the derivative with respect to xj to these functions
to obtain the following interpolated version of the second order tensor field
δui,j :

δui,j (→
− Q →
x ) = Ni,j (−
x )δuQ .

Making

BijQ (→
− Q →
x ) ≡ Ni,j (−
x)

the above can be written like:

δui,j (→

x ) = BijQ (→

x )δuQ . (A.1)
APPENDIX A. COMBINED INDEX NOTATION FOR FINITE ELEMENT ANALYSIS123

In eq. (A.1), the term BijQ (→



x ) is an interpolation function (which is in-
dicated by the superscript Q) associated to a second order tensor (which is
indicated by the subscripts ij). It must be recognized that BijQ (→
−x ) are not
independent shape functions but just derivatives of the primary interpolation
polynomials N Q (x, y).

Consider now the stress-strain relationship in theory of elasticity relating


the stress tensor σij to the strain tensor ij through the elastic constitutive
tensor Cijkl as:

σij = Cijkl kl .

In the above the strain tensor ij is given by a combination of space


derivatives of the displacement field ui like

1
εij = (ui,j + uj,i )
2

which can be written like

1
ij (→

x ) = [BijQ (→
− Q →
x ) + Bji (−
x )]uQ ≡ H(→

x )Q
ij u
Q
2

Using the above set of results in δW gives:

Z
δW = δu Q
HijQ Cijkl Hkl
P
d V uP (A.2)
V

which is the final discrete version of δW .


APPENDIX A. COMBINED INDEX NOTATION FOR FINITE ELEMENT ANALYSIS124

In the indicial representation of a tensor quantity an index which does


not repeat itself in the expression is termed a free index and the
number of non-repeated free indices appearing in the expression gives
the expression order. By contrast, repeated indices appearing in the
expression are termed dummy indices and they imply summation.

Problem: Discretization of the principle of virtual displacements


from theory of Elasticity The principle of virtual displacements in the
linearized theory of elasticity is given by:

Z Z Z
σij δui,j dV − fi δui dV − tni δui dS = 0. (A.3)
V V St

and where ui is the displacement field; ij is the strain field and σij is the
stress field satisfying the following relations

1
εij = (ui,j + uj,i )
2

and

σij = Cijkl kl

where Cijkl is a fourth-order tensor whose terms are material constants.


Also fi and tni are the body forces and the surface traction vectors.

Assuming that in a finite element method the displacement field ui is


approximated via interpolation like:

ui (→

x ) = NiQ (→

x )uQ .
APPENDIX A. COMBINED INDEX NOTATION FOR FINITE ELEMENT ANALYSIS125

• Write the discrete version of eq. (A.3)

• Write the term K QP = V HijQ Cijkl Hkl


R P
d V in matrix form and imple-
ment it in a python script.
Appendix B

Generalized boundary value


problems

In this section we use as problem to be solved via the finite element algorithm
the case of general initial boundary value problem (I-BVP). In the first part
of this appendix we will introduce the differential formulation given in terms
of a set of governing equations and properly specified boundary conditions.
The resulting equations are obtained after using a generalized balance law.
Following this classical and well known approach we formally re-state these
equations in the so-called strong form. Subsequently we re-write and prove
an equivalent form of the balance law in the form of an integral representation
highly friendly for a numerical solution. Since in the integral description of
the problem the order of the derivatives in the field functions decreases by
one, the resulting statement is called a weak formulation.

B.1 Governing equations

Let dS be a differential surface element, dV a differential volume element,


u(x, t) a scalar (or vector) function of space and time. The flux or rate of

126
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 127

flow of the quantity u(x, t) through dS at time t is defined like

p(x)∇u · n̂ dS ,

where p(x) is a positive function, assumed known and time independent.


Similarly, the time rate of change of u(x, t) in an element dV is given by

∂u
ρ(x) dV ,
∂t
where once again ρ(x) is a known, given, time independent positive function.
Additional effects occurring in the element dV at the time t can be expressed
like
H(x, t) dV ≡ −q(x)u(x, t) + F̂ (x, t)
where F̂ (x, t) = ρ(x)F (x, t). In the above the term qu represents internal
effects due to changes proportional to u while F̂ (x, t) are other external
influences in the medium.

Balancing the internal and external changes yields


Z Z Z
∂u
ρ(x) dV = p(x)∇u · n̂ dS + H(x, t) dV ,
∂t
V S V

or equivalently
Z Z Z Z
∂u
ρ(x) dV = p(x)∇u · n̂ dS − q(x)u(x, t) dV + ρ(x)F (x, t) dV .
∂t
V S V V

Using the divergence theorem as


Z Z
p(x)∇u · n̂ dS = ∇·(p∇u) dV
S V

yields after substitution


Z  
∂u
ρ(x) − ∇ · (p(x)∇u) + q(x)u(x, t) − ρ(x)F (x, t) dV = 0
∂t
V
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 128

Assuming a continuous integrand, the arbitrariness of V implies


∂u
ρ(x) − ∇ · (p(x)∇u) + q(x)u(x, t) − ρ(x)F (x, t) = 0
∂t

Letting
L ≡ −∇ · p(x)∇ + q(x)
allows us to write the generalized set of partial differential equations like:

∂u(x, t)
ρ(x) + Lu(x, t) = ρ(x)F (x, t) . (B.1)
∂t

These are categorized as:

• Hyperbolic;
∂ 2 u(x, t)
ρ(x) + Lu(x, t) = 0
∂t2
• Parabolic;
∂u(x, t)
ρ(x) + Lu(x, t) = 0
∂t
• Elliptic
Lu(x, t) = ρ(x)F (x, t) .

It is convenient to show that L satisfies the symmetry condition


Z Z
L(u)v dV = L(v)u dV
V V

and that the operator is positive definite, that is


Z
L(u)u dV > 0, ∀u .
V
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 129

B.1.1 Strong form

The strong form for the generalized boundary value problem formulated
above can now be explicitly written as follows.

Given ρ(x), q(x), p(x), F (x, t) and ū(x, t) find u(x, t) : V → R such:

∂u
ρ(x) − ∇ · [p(x)∇u] + q(x)u(x, t) − ρ(x)F (x, t) = 0 ∀x ∈ V
∂t
and

u = ū ∀x ∈ Su
p(x)u,i n̂i = B(x, t) ∀x ∈ St .

In the FEM we will look for approximate solutions to u subject to the


following conditions:

u = ū ∀x ∈ Su (Essential boundary conditions)

and Z  2
∂u
dS < ∞ ,
∂xj
S

which corresponds to the functions being square integrable. We will denote


this space by H .

The space of functions satisfying the above two conditions will be denoted
by ζ and termed the space of trial functions, formally defined like:

ζ = {u | u ∈ H, u = ū ∀x ∈ Su }

On the other hand, to validate (or test) the correctness of the approx-
imated or proposed trial functions u it is also necessary to introduce test
functions w which are arbitrary except that they satisfy the following condi-
tions:
w = 0 ∀x ∈ Su
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 130

and Z  2
∂w
dS < ∞ ,
∂xj
S

which corresponds to the functions being square integrable. The space of


functions satisfying the above two conditions will be denoted by £ and termed
the space of test functions, formally defined like:

£ = {w | w ∈ H, w = 0 ∀x ∈ Su }

B.1.2 Weak form

Given ρ(x), q(x), p(x), F (x, t) and ū(x, t) find u(x, t) : V → R and ∀w ∈ £
such:
Z Z Z Z
∂u
p(x)u,i w,i dV − B(x, t)w dS + q(x)u(x, t)w dV + ρ(x) w dV
∂t
V St V V
Z
− ρ(x)F (x, t)w dV = 0
V

and
u = ū ∀x ∈ Su .

B.1.3 Equivalence between the strong and weak forms

Z Z Z
− [p(x)u,i ],i w dV + [p(x)u,i ]n̂i w dS − B(x, t)w dS
V St St
Z Z Z
∂u
+ q(x)u(x, t)w dV + ρ(~x) w dV − ρ(x)F (x, t)w dV = 0 (B.2)
∂t
V V V
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 131

Grouping together common terms yields


Z  
∂u
ρ(x) − [p(x)u,i ],i + q(x)u(x, t) − ρ(x)F (x, t) w dV
∂t
V
Z
+ {[p(x)u,i ]n̂i − B(x, t)} w dS = 0
St

from which
∂u
ρ(x) − [p(x)u,i ],i + q(x)u(x, t) − ρ(x)F (x, t) = 0
∂t
and
p(x)u,i n̂i = B(x, t) ∀x ∈ St .

B.2 Weighted residual methods

This section introduces the concept of residual or difference from zero in a


differential equation once its solution is approximated. For that purpose we
will take as prototype equation the one obtained as our general model of
BVP (see eq. (B.1)) and recalled here for completeness
∂u(x, t)
ρ(x) + Lu(x, t) = ρ(x)F (x, t) . (B.3)
∂t

We will assume that the actual solution to the generalized BVP given by
eq. (B.3) is approximated by ũ(x) through a superposition like
ũ(x) = N I (x)uI (B.4)
where N I (x) are interpolating functions and I denotes a superposition index
varying like I = 1, 2, ..., K with K being the number of points where the
solution is known. In what follows we will use u(x) instead of ũ(x) but will
keep in mind that we are actually using the approximation given by eq. (B.4).
Similarly, in order to keep the discussion simple for the time being we will
drop the time effects reducing the generalized PDE to the simple form:
Lu(x) = ρ(x)F (x) . (B.5)
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 132

Now, since we are using the approximation given by eq. (B.4) this equa-
tion is not strictly satisifed but instead we will have the following “unbal-
anced” condition
Lu(x) − ρ(x)F (x) ≡ R 6= 0
where the term R corresponds to a residual error which is to be distributed
throughout the solution domain. The so-called weighted residual methods
differ in the form in which they distribute the residual between the different
K points conforming the computational domain.

Using eq. (B.4) in eq. (B.3) and the linearity in the differential operator
yields
R = L(N P )uP − ρF .

We can see that the residual R is a function defined over the domain of
interest. The residual would be exactly zero for the solution of the differential
equation, but it will not be zero in general. Thus, we want to make the
function R as close to zero as possible. To make R as small as possible we
need a function (a functional) where we can compare different approximation
functions. After getting this functional we can minimize its value. For this
minimization we could use the norm of the function, another option is to
compute a weighted average of the function over the domain. This is what
we call a weighted residual
Z
Π[u, w] = wR(u) dV ,
V

and we want to minimize it by making

δΠ [u, w] = 0 ,

In what follows we will consider different strategies to distribute or weight


the residual R over the computational domain.
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 133

B.2.1 Galerkin method

In the Galerkin scheme the interpolation functions are used also as weighting
functions leading to: Z
N Q R dV = 0
V
or explicitly Z Z
Q P P
N L(N ) dV u = N Q ρF dV . (B.6)
V V

Imposing eq. (B.6) in the K points conforming the computational do-


main or equivalently ranging Q from 1 to K leads to the following system of
algebraic equation
K QP U P = f Q (B.7)

where U P is a vector that stores the point values of the function u along
te K points of the computational domain, while f Q stores the corresponding
point excitations.

B.2.2 Least squares method

In this method the integral of the square of the residual is minimized with
respect to the K point parameters or nodal values of the function. Accord-
ingly,
Z

R2 dV = 0
∂uI
Z V
∂R
R I dV = 0 ,
∂u
V

The least squares method is a special case of the weighted residual method
for the weight functions
∂R
wI = .
∂uI
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 134

Expanding the residual, and considering the operator L as linear, we


obtain
Z

[L(N P uP ) − ρF ]2 dV = 0
∂uI
Z V
[LN P uP − ρF ]L(N I ) dV = 0
V
Z Z
I P P
L(N )L(N ) dV u − ρ L(N I )F dV = 0
V V

which can be written like


K IP U P = f I (B.8)

B.2.3 Collocation method

In the collocation method the coefficients of the approximation are deter-


mined by forcing the residual to be exactly zero at K points over the com-
putational domain, i.e.,
L(N I )uI − ρF = 0 ,
or
L[N I (xJ )]uI − ρF (xJ ) = 0 ,
where J ranges between 1 and K. This equation can be rewritten as a
weighted-residual if we consider the residual to be δ(x − xI ), the Dirac delta
function over the selected points

The resulting system of algebraic equation can be written as

K IP U P = f I . (B.9)
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 135

B.2.4 Subdomain method

The zero value of the residual is imposed upon K subdomains


Z Z
L(N ) dV u − ρ F dV I = 0
P I P
I = 1, · · · , K .
VI VI

For instance, for the N -th element it follows that


Z Z
L(N ) dV u − ρ F dV N = 0
P N P
P = 1, · · · , K .
VN VN

Applying the equation over the K subdomains leads to the discrete sys-
tem;
K IP U P = f I I = 1, · · · , K . (B.10)

B.2.5 Ritz method

It operates directly upon the variational statement of the problem. For a


given functional
Π = Π(N Q uQ )
the variational equation reads
∂Π
δΠ ≡ Q
δuQ = 0
∂u
from which
∂Π
= 0.
∂uQ

Example: The generalized parabolic equation Let us consider the


case of the generalized parabolic equation and its discretization following the
Galerkin method
∂u(x, t)
ρ(x) + Lu(x, t) = 0
∂t
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 136

which can also be written using index notation


 
∂ ∂u ∂u
p(x) + q(x)u + ρ = ρF , .
∂xi ∂xi ∂t

Assuming that p(x) = 1 yields


Z Z Z
Q
− N N,ii dV u + qN N dV u + ρ N P N Q dV v Q
P Q P Q Q

V V V
Z
−ρ N P F dV = 0
V
Z Z Z
N,iP N,iQ Q
dV u − N P
N,iQ n̂i dS u +Q
qN P N Q dV uQ
V S V
Z Z
+ρ N P N Q dV v Q − ρ N P F dV = 0
Z V 
V
Z
Q
P P Q Q
N,i N,i + qN N dV u + ρ N P N Q dV V Q =
V V
Z Z
N P N,iQ n̂i dS uQ + ρ N P F dV
S V

which can be written in discrete form as

K P QU Q + C P QV Q = f p .

Example: The wave equation. In this case the differential equation


reads    
1 ∂ 1 ∂ρ
∇ · ∇p(x) − − q(x) = 0
ρ ∂t λ ∂t
where we recognize that
   
1 ∂ 1 ∂
L≡∇· ∇ − .
ρ ∂t λ ∂t
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 137

Let
p(x) = N K pK
then
1 ∂N K pK
   
~ · 1~ K K ∂
L(p) ≡ ∇ ∇N p −
ρ ∂t λ ∂t
or in index notation
1 ∂N K
   
1 K K ∂
L(p) ≡ N p − pK
ρ ,i ,i ∂t λ ∂t
which is equivalent to
L(p) ≡ L(N K )pK
using the trial functions as weighting function and recalling the definition of
the residual which in this case reads
R = L(N K )pK − q ,
and yields Z
N J RdV = 0 J = 1, 2, ..., K
V

Z Z
J K K
N L(N )dV p − N J qdV = 0
V V

1 ∂N K
Z   Z   Z
J 1 K K ∂ J K
N N dV p − N dV p − N J qdV = 0
ρ ,i ,i ∂t λ ∂t
V V V

Integrating by parts the first term on the right-hand-side gives us


1 ∂N K
Z Z Z   Z
J1 K K J1 K K J ∂
− N,i N,i dV p + N N,i n̂i dSp = N dV p + N J qdV
K
ρ ρ ∂t λ ∂t
V S V V

Z Z Z Z
1 K 1 1
N,iJ N dV pK + N N K dV p̈K =
J
N N,iK n̂i dSpK +
J
N J qdV
ρ ,i λ ρ
V V S V
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 138

K JK P K + M JK P̈ K + f J = 0
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 139

Example: The Navier equations. The stress equilibrium equations when


written in terms of displacements after using the constitutive tensor and the
proper kinematic description take the form:

(λ + µ)uj,ij + µui,jj + fi = 0

which are known as the Navier equations and where the differential op-
erator reads

∂2 ∂2
Lij ≡ (λ + µ) +µ δij .
∂xi ∂xj ∂xk ∂xk

Applying this operator to an interpolated version of the displacement field


ui = NiQ uQ gives:

Lij (uj ) ≡ Ri (uj )

thus

Lij (uj ) ≡ (λ + µ)(NjQ uQ ),ij + µ(NjQ uQ ),kk δij


Q Q Q
Lij (uj ) ≡ (λ + µ)Nj,ij u + µNi,kk uQ
Lij (uj ) ≡ Lij (NjQ )uQ .

In the Galerkin scheme we use the trial function as weighting function.

Ri ≡ Lij (NjQ )uQ + fi

and we state Z
NiP Ri dV = 0 P = 1, 2, · · · N .
V
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 140

Thus
Z Z
Ni Lij (Nj ) dV u + NiP fi dV = 0
P K K

V V
Z Z Z
(λ + µ) NiP Nj,ij
K
dV u + µK
NiP Ni,kk
K
dV u +K
NiP fi dV = 0
V V V

integrating by parts
Z Z Z
P K K P K K P K
−(λ + µ) Ni,j Nj,i dV u + (λ + µ) Ni Nj,i n̂j dS u − µ Ni,k Ni,k dV uK
V S V
Z Z
+µ NiP Ni,k
K
n̂k K
dS u + NiP fi dV = 0
S V

which can be written like


K P QU Q = F P
where Z Z
PQ P Q P Q
K = (λ + µ) Ni,j Nj,i dV + µ Ni,k Ni,k dV
V V

and Z Z
P (n̂)
F = NiP ti dS + NiP fi dV = 0 .
S V
Appendix C

Convergence analysis

In this section we address the problem of convergence of analysis results. We


will approach the problem in a loose way proceeding from an engineering
point of view. For a thorough discussion the reader is referred to textbooks
of numerical analysis, see for instance [? ]. Particularly, we will review the
fundamental aspects that must be satisfied by a finite element solution. In
the first part we address the problem from the element point of view, while
in the final part we study the convergence of particular problem in terms of
several self-contained meshes.

C.1 ¿What is meant by convergence?

Mathematical convergence of order p and rate c for a series of numerically


computed values ~uk and for a problem with exact solution ~u is defined like:

k~uk+1 − ~uk
lim = c.
k→∞ k~uk − ~ukp

A practical definition of convergence in finite element analysis is given as

141
APPENDIX C. CONVERGENCE ANALYSIS 142

follows. Let us denote by Π and ΠF E the potential energy functionals corre-


sponding to the exact mathematical model and to the finite element solution
respectively, where the functional corresponding to a given discretization can
be computed as:

1
ΠF E = − U T KU
2

where K and U are the global stiffness matrix and the global nodal dis-
placements vector. If k represents the number of finite elements in a given
discretization then we define convergency as the condition that:

lim ΠF E → Π (C.1)
k→∞

In order to guarantee that a finite element solution convergences to the


exact (unknown) solution of a problem certain conditions must be met by
both, the single elements and the whole assembled finite element mesh. The
analysis of the element is conducted when the element is formulated for
the first time while the analysis of the mesh is problem dependent. In the
following sections we will address both problems.

C.2 Conditions on a single element

From a physical point of view we may expect the following behaviour from
the individual elements in a given discretization:

• Under a rigid body compatible displacement field the element must


predicts a zero strain field εij = 0. This condition is required in order
to maintain actual regions of the domain which are submitted to rigid
body modes in a stress free condition.
APPENDIX C. CONVERGENCE ANALYSIS 143

• The element must be able to predict constant strain states as its size
decreases. This condition guarantees that as the element size decreases
it also approaches the condition of an actual material point.

• The work from the surface tractions along the element interfaces must
vanish. This is nothing but Newton’s third law in terms of surface
tractions. The fact that the first order derivatives of the shape func-
tions (equivalent to surface tractions) are discontinuous along the el-
ement boundaries results in finite jumps in the boundary tractions.
The element must be such that these jumps vanish as the element size
decreases.

In terms of the shape functions these three conditions are equivalent to:

(i) All the element shape functions must be selected in such a way that
the element predicts εij = 0 under rigid body compatible nodal dis-
placements.

(ii) All the element shape functions must be selected in such a way that
if the nodal displacements are compatible with a constant strain state
that state is actually obtained.

(iii) All the element shape functions must be selected in such a way that
the strains over the element interfaces are finite and the displacements
along these boundaries are continous.

Conditions (i) and (ii) are known as the completeness condition while
condition (iii) is referred to as the compatibility condition.

In order to determine if a specific element is complete we find the eigen-


values of the stiffness matrix and study the resulting eigenvectors which cor-
responde to the deformation modes of the element. The eigenvalue problem
reads:

[K − λI] φ = 0 (C.2)
APPENDIX C. CONVERGENCE ANALYSIS 144

whose solution gives the rigid body modes and straining modes that can
be reproduced by the specific element. In eq. (C.2) λ corresponds to the
eigenvalues and the vector φ stores the corresponding eigenmodes.

As an example of the single element analysis we show the solution for


a single bi-linear perfectly square element of characteristic size 2h = 1.0
and material properties given by E = 1.0 and ν = 0.30 (see [? ]). The
eigenvalue problem is solved with the script modes.py listed in the last
section. Solution of eq. (C.2) predicts the following set of eigenvalues:

λ = [0(3), 0.495(2), 0.769(2), 1.43].

From these the first three zero-valued eigenvalues can be shown to de-
scribe the possible rigid body motions, namely one rotation and two transla-
tions along the horizontal and vertical directions respectively. The next two
eigenvalues corresponding to 0.495 represent flexure modes. Similarly, the
repeated values corresponding to 0.769 are associated to shear modes while
the last eigenvalue corresponds to a uniform extension mode. The number
of different modes satisfy the following condition:

NS = NDOF − NRB

where NS , NDOF and NRB are the number of straining modes, number
of degrees of freedom and number of rigid body modes. The original and
deformed element shapes are shown in fig. C.1 which is obtained after one
combines the eigenvalues properly. The last row of the figure (obtained with
the script strfield.py) shows the zero-valued strain field associated to the
first rigid body mode.
APPENDIX C. CONVERGENCE ANALYSIS 145

2.0 2.0
1.5 1.5
1.0 1.0
0.5 0.5
0.0 0.0
0.5 0.5
1.0 1.0
1.5 1.5
2.0 2.0
2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0 2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0

(a) λ1 = 0. (b) λ2 = 0.
2.0 2.0
1.5 1.5
1.0 1.0
0.5 0.5
0.0 0.0
0.5 0.5
1.0 1.0
1.5 1.5
2.0 2.0
2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0 2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0

(c) λ3 = 0. (d) λ4 = 0.495.


2.0 2.0
1.5 1.5
1.0 1.0
0.5 0.5
0.0 0.0
0.5 0.5
1.0 1.0
1.5 1.5
2.0 2.0
2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0 2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0

(e) λ5 = 0.495. (f ) λ6 = 0.769.


2.0 2.0
1.5 1.5
1.0 1.0
0.5 0.5
0.0 0.0
0.5 0.5
1.0 1.0
1.5 1.5
2.0 2.0
2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0 2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0

(g) λ7 = 0.769. (h) λ8 = 1.43.

Figure C.1. Deformation modes of a bi-linear element.


APPENDIX C. CONVERGENCE ANALYSIS 146

(a) xx . (b) yy .

(c) γxy

Figure C.2. Deformation modes of a bi-linear element.

C.3 Analysis of the mesh results

Consider the square energy norm of the error k~eh k2E . This error satisfies

k~eh k2E > 0

and will be used as an error estimate of the accuraccy of the finite element
solution. Particularly we will use the following relationship (see [? ])
APPENDIX C. CONVERGENCE ANALYSIS 147

k~eh k ≤ αhk (C.3)

from which we can write:

log k~eh k ≈ log α + k log h (C.4)

In eq. (C.4) k is the order of the complete interpolation polynomial present


in the mesh and gives a measure of the order of convergence in the finite
element solution, while the rate of convergency is given by α.

In order to conduct the convergency study we perform a series of finite


element analysis. For each mesh we compute k~u − ~uh k which is equivalent
to ~eh and where ~u is the exact solution. In order to find the exact solution
we assume that the most refined results have functionals corresponding to
Πn−2 , Πn−1 and Πn from which:

Π2n−1 − Πn Πn−2
ΠExa =
(2Πn−1 − Πn − Πn−2 )

The procedure is summarized below:

• Solve a series of meshes with solutions given by ~u1 , ~u2 , ..., ~un . Each
mesh has a characteristic element size h.

• For each mesh find the total potential energy:

1
Πh = − U T KU
2
• Using the most refined meshes compute the potential energy for the
exact solution:

Π2n−1 − Πn n−2
Q
ΠExa =
2Πn−1 − Πn − Πn−2
APPENDIX C. CONVERGENCE ANALYSIS 148

• For each mesh compute:


 1/2
k~uExa − ~uh k ΠExa − Πh
=
k~uExa k ΠExa

and fill out the following table:

Q k~
uExa −~
uF E k
h FE k~uExa − ~uF E k k~
uExa k
1.0
0.5
0.25
0.125
0.0625

Table C.1. Convergence of anlysis results

 
• Plot the values of log k~uk~
Exa −~
uh k
uExa k
vs log h and determine the slope
which upon convergence must be close to the order of the complete
polynomial used in the discretization.

Exampla: bar in compression Figure C.4 shows a tappered bar under


a compressive uniformly distributed load of total magnitude P = 0.5. The
bar is of length l = 10 and its large and short ends given by h1 = 2.0 and
h2 = 0.5 respectively. The material properties correspond to a Poisson’s ratio
and Young modulos ν = 0.30 and E = 1.0. We want to find the converged
solution for the bar after using 3-noded triangular elements.
APPENDIX C. CONVERGENCE ANALYSIS 149

h1 = 2.0 h2 = 0.5

l = 10
Figure C.3. Tappered bar under compressive load at the tip.

Figure C.4 displays 4 consecutive meshes with decreasing element size


namely h = [1.0, 0.5, 0.25, 0.125]. While fig. C.5 displays the shear strain
contour maps for the finite element solutions corresponding to the coarse
and refined meshes. It is clear how these contours become smooth as the
mesh is refined. This approach is sometimes used as an empirical test of
convergence.

To measure the finite element convergence we first compute the total


potential energy in each mesh ccording to:

1
ΠF E = − U T KU.
2

Now assuming we have consecutive meshes each one obtained after halv-
ing the elements in the previous mesh we have the following approximation
for the exact total potential energy of the system, computed the last most
refined meshes:

1.1612 − (−1.160)(−1.155)
ΠExa = = −1.160.
−2(1.161) − (−1.160) − (−1.155)

To compute the energy norm of the error we use:


APPENDIX C. CONVERGENCE ANALYSIS 150

 Q 1/2
k~uExa − ~uF E k ΠExa − F E
= .
k~uExa k ΠExa

The analysis results are reported in table C.2.

Y Y

Z X Z X

(a) h = 1.00. (b) h = 0.50.

Y Y
Z X Z X

(c) h = 0.250. (d) h = 0.125.

Figure C.4. Refined meshes for a tappered bar.


APPENDIX C. CONVERGENCE ANALYSIS 151

Figure C.5. Shear strain distribution for the coarse and fine mesh.

k~
uExa −~
uF E k
h ΠF E k~uExa − ~uF E k k~
uExa k
1.0 −1.151 0.095 0.088
0.5 −1.155 0.071 0.066
0.25 −1.161 0.032 0.030
0.125 −1.160 0.001 0.001

Table C.2. Convergence of anlysis results

To measure convergence we plot:

log (k~uExa − ~uF E k) = log c + k log h

leading to fig. C.6 from which k ≈ 1.14.


APPENDIX C. CONVERGENCE ANALYSIS 152

1.0

log([Uex-Ufe]/[Uex])
1.5

2.0

2.5

3.01.0 0.8 0.6 0.4 0.2 0.0


log(h)
Figure C.6. Energy norm of the error
APPENDIX C. CONVERGENCE ANALYSIS 153

Example: cantilever beam Consider the cantilever beam shown in fig. C.7

P x,u 2c

1.0

y,v

Figure C.7. Cantelever beam.

with analytic solution [? ] given by:


 2
P c2

P 2 νP 3 P 3 Pl
u=− x y− y + y + − y,
2EI 6EI 2IG 2EI 2IG
νP P 3 P l2 P l3
v= xy 2 + x − x+ ,
2EI 6EI 2EI 3EI
∂u P
εxx = ≡ − xy ,
∂x EI
∂v νP
εyy = ≡ xy ,
∂y EI
∂u ∂v P
γxy = + ≡ (y 2 − c2 ) .
∂y ∂x 2IG

The horizontal and vertical displacement field corresponding to the par-


ticular values of E = 1000.0, ν = 0.30 for the material parameters; l = 24
and 2c = 8 for the geometry and P = 50 (upwards) for the load is shown
below:
APPENDIX C. CONVERGENCE ANALYSIS 154

4 Horizontal field
3
2
1
0
1
2
3
40 5 10 15 20

1.2 0.9 0.6 0.3 0.0 0.3 0.6 0.9 1.2

4 Vertical field
3
2
1
0
1
2
3
40 5 10 15 20

5.4 4.8 4.2 3.6 3.0 2.4 1.8 1.2 0.6 0.0

Figure C.8. Displacement field for the cantilever beam.

Perform a finite element simulation using a series of refined meshes with


charateristic element size corresponding to h = [6.0, 3.0, 1.5, 0.75, 0.375] and
show that convergence is achieved. To conduct the finite element analysis fill
out table C.3
APPENDIX C. CONVERGENCE ANALYSIS 155
Q k~
uExa −~
uF E k
h FE k~uExa − ~uF E k k~
uExa k
6.0
3.0
1.5
0.75
0.375

Table C.3. Convergence of anlysis results

You might also like