FEM-notes
FEM-notes
Element Methods
Summary 1
1 Introduction 2
i
CONTENTS ii
Appendices
Summary
Class Notes for the Course Introduction to the Finite Element 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.
2
CHAPTER 1. INTRODUCTION 3
Introductory problem
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
f1 K f2
u1 u2
Figure 1.2. Typical spring element.
f1 = K(u1 − u2 )
f1 + f2 = 0.
CHAPTER 1. INTRODUCTION 5
f1 1.0 −1.0 u1
=K . (1.1)
f2 −1.0 1.0 u2
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
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
f1i i
k11 i
k12 uj−1
=
f2i i
k21 i
k22 uj
and
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
j−1 j
DM E =
j
j+1
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.
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
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
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).
2
3
4
5
6
7
8
9
10
1.0 0.5 0.0 0.5 1.0
10
1.0 0.5 0.0 0.5 1.0
n
I
Y (x − xJ )
L (x) = . (2.2)
J=1
(xI − xJ )
I6=J
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD15
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.
LI (xJ ) = δ IJ
f (x) = x3 + 4x2 − 10
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]
(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
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
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
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
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
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
1.0
0.8
0.6
0.4
0.2
0.0
1.0 0.5 0.0 0.5 1.0
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
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.
1
f (x) =
1 + 25x2
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
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)
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)
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.
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
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:
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)
which after substituting with the found expressions for f (xA , y) and f (xB , y)
becomes
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:
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
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
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.
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
t=t
t=0
V ( x)
V (r )
r
x
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.
xi = xi (→
−r)
→
− (2.5)
rI = rI ( x ).
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD33
xi = N Q (→
−
r )xQ . (2.6)
f = f (→
−
x ) ≡ f [xi (→
−
r )] ≡ F (→
−
r ).
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
Proposed problems
2. Verify that the polynomials L1 (x), L2 (x) and L3 (x) satisfy the property
LI (xJ ) = δ IJ .
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).
1
f (x) =
1 + 25x2
CHAPTER 2. INTERPOLATION IN THE FINITE ELEMENT METHOD35
→
−
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.
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
36
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 37
Z
K QP
= HijQ Cijkl Hkl
P
d V. (3.1)
V
p(x) = LQ (x)f Q .
And for interpolation of a vector function we use:
ui (x) = LQ
i (x)u
Q
ZZZ
I = f (x, y, z)dV (3.2)
Zb N
X
f (x)dx ≈ wI f (xI ). (3.3)
a I=1
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
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
Zb Zb
f (x)dx ≈ p(x)dx. (3.5)
a a
where
Zb Zb Zb
I I I
f (x) dx ≈ L (x)f (x )dx ≡ f (x ) LI (x)dx
a a a
Zb N
X
f (x)dx ≈ wI f (xI ) (3.7)
a I=1
Zb
wI = LI (x) dx. (3.8)
a
(x − x2 ) 1
L1 (x) = 1 2
≡ − (x − b)
(x − x ) h
(x − x1 ) 1
L2 (x) = ≡ (x − a).
(x2 − x1 ) h
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
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
Z+1
I = (x3 + 4x2 − 10)dx.
−1
ZZ
I= f (x, y)dA.
R
Δxi
Δyi
x
Figure 3.1. Riemman partition for a two-dimensional domain.
Defining
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
Z Z
I= f (x, y)dxdy.
y
y2
y1
x1 (y) x2 (y) x
Figure 3.2. Integration along the x direction.
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)
Zy2
I= F (y)dy.
y1
yZ2 (x)
Zx2
I= H(x)dx.
x1
y
y2 (x)
y1 (x)
x1 x x2 x
Figure 3.3. Integration along the y direction.
Z Z
I= xy 2 dA
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 47
2.0
y = 2x
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
Z2.0 Z2.0
1 1 8
I = F (y)dy ≡ ( y 2 − y 4 )dy ≡ .
2 8 15
0 0
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
Z1.0
8 4 8
I= x dx ≡ .
3 15
0
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 50
Zb npts
X
f (x)dx ≈ wI f (xI ) (3.11)
a I=1
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
[−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.
Z+1
I = f (x)dx ≈ w1 f (x1 ) + w2 f (x2 )
−1
f (x) = a0 + a1 x + a2 x2 + a3 x3 .
Using f (x) in I and stating the integral for each term we have:
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
Z+1 √ √
I = f (x)dx ≈ 1.0 · f (− 3/3) + 1.0 · f (+ 3/3)
−1
Zb Z+1
f (x)dx ≡ F (r)dr. (3.12)
a −1
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].
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:
(r − r2 ) 1
L1 (r) = 1 2
≡ (1 − r)
(r − r ) 2
(r − r1 ) 1
L2 (r) = 2 1
≡ (1 + r)
(r − r ) 2
1 r
x(r) = (a + b) + (b − a).
2 2
where F̂ (r) represents the same function but now written in terms of r.
CHAPTER 3. QUADRATURES: NUMERICAL INTEGRATION 55
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
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
3 3
x(r) = + r
2 2
3
dx = dr.
2
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
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.
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)
xi (→
−
r ) = NiQ (→
−
r )xQ (3.16)
xi = xi (→
−
r)
∂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
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)
dV (→
−
r ) = drds
therefore
dV (→
−
x ) = |J| drds
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
ui (→
−
r ) = NiQ (→
−
r )uQ (3.23)
in which:
• →
−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
..
.
..
.
coord = xQ y Q
..
.
..
∂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
d V (→
−
x ) = |J| d V (→
−
r)
∂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
∂f
.
∂→
−
x
∂f ∂F ∂rJ
=
∂xi ∂rJ ∂xi
∂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
∂F ∂N Q Q
= F
∂rJ ∂rJ
∂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
Proposed problems
f (r, s) = rs
Preliminary
67
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 68
σij,j + fi = ρüi ∀ x ∈ V, t ∈ R+
(4.1)
σij = σji .
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:
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
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
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.
l l
S
S
x
S
S
l l
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
σ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.
Let us verify that the above stress solution satisfies the traction BCs using
the expression:
where êx and êy are the reference unit vectors. Now, the components of the
traction vector follow directly.
tx = −S cos(φ)
ty = −S sin(φ)
similarly, over the face with normal n̂2 the traction reads
tx = −S cos(φ)
ty = +S sin(φ)
tx = +S cos(φ)
ty = −S sin(φ)
tx = +S cos(φ)
ty = +S sin(φ) .
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 76
Note that the above set of tractions found from the relation:
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.
S
A = − K1 (ν, φ)` cos(φ)
E
then it follows that
S
u= K1 (ν, φ)(x − ` cos(φ)).
E
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.
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:
(λ + µ)uj,ij + µui,jj + fi = 0 ∀x ∈ V
tn̂i = σij n̂ij ∀x ∈ St (4.12)
ui = ūi ∀x ∈ 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;
Proof 1:
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
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:
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
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).
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 [? ]
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.
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 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.
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)
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
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
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
σij,j + fi = 0 x ∈ V
tni = σij nj ∀x ∈ St
ui = ūi ∀x ∈ Su
are equivalent.
CHAPTER 4. THE BOUNDARY VALUE PROBLEM 87
where
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 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
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
Proposed problems
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
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
• Use interpolation theory to write the finite element based discrete ver-
sion of the principle of virtual work.
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
[
V = Ωe
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
ui (→
−
x ) = NiQ (→
− uQ
x )b
w (→−
x ) = N Q (→
i
− bQ
x )wi
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.
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
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
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
Z
Q
KeP Q = BijP Cijkl Bkl d Ωe
Ωe
fσP = KeP Q u
bQ
Z
P
fB = NiP fi d Ωe
Ωe
Z
P (n)
fc = NiP ti d Se
Se
satisfying
and where fσP , fBP and fCP are forces due to the internal element stresses,
body forces and surface tractions respectively.
bQ = fBP + fCP
KeP Q u
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.
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
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
Z Z
(n)
δW = fi δui d Ωe + ti δui d Se
Ωe Se
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
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.
KeP Q u
bQ = fBP + fcP (5.5)
Z
fcP = NiP tni d S (5.6)
St
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
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)
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
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
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:
• (iii) The computation of the coefficient matrix for each element in the
model.
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) 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
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
−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
−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
8 6
7 5
Node 4 Node 3
2 4
1 3
Node 1 Node 2
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:
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
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.
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
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
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
max σyy
SCF =
promedio σyy
Parameter Value
Young’s modulus (Pa) E = 200 × 109
Poisson’s ratio ν = 0.285
Load (N/m) S = 108
a b h w
20 40 50 100
117
Appendix A
Z
δW = σij δui,j dV
V
118
APPENDIX A. COMBINED INDEX NOTATION FOR FINITE ELEMENT ANALYSIS119
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
*
ui ↔ ux uy uz ↔ u = uxbi + uyb
j + uz b
k.
σxx σxx σxx
*(2)
σij ↔ σxx σxx σxx ↔ σ .
σxx σxx σxx
3
→
−
u ·→
−
X
w ↔ ux wx + uy wy + uz wz ↔ ui wi ↔ ui wi .
i=1
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
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 .
or
ui (→
−
x ) = NiQ (→
−
x )uQ
after considering →
−
x ≡ x, y, z.
Z
δW = σij δui,j dV
V
δui (→
−
x ) = NiQ (→
−
x )δuQ .
δui,j (→
− Q →
x ) = Ni,j (−
x )δuQ .
Making
BijQ (→
− Q →
x ) ≡ Ni,j (−
x)
δui,j (→
−
x ) = BijQ (→
−
x )δuQ . (A.1)
APPENDIX A. COMBINED INDEX NOTATION FOR FINITE ELEMENT ANALYSIS123
1
εij = (ui,j + uj,i )
2
1
ij (→
−
x ) = [BijQ (→
− Q →
x ) + Bji (−
x )]uQ ≡ H(→
−
x )Q
ij u
Q
2
Z
δW = δu Q
HijQ Cijkl Hkl
P
d V uP (A.2)
V
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
ui (→
−
x ) = NiQ (→
−
x )uQ .
APPENDIX A. COMBINED INDEX NOTATION FOR FINITE ELEMENT ANALYSIS125
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.
126
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 127
p(x)∇u · n̂ dS ,
∂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.
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
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
• 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) .
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 .
and Z 2
∂u
dS < ∞ ,
∂xj
S
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
£ = {w | w ∈ H, w = 0 ∀x ∈ Su }
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 .
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
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 .
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
δΠ [u, w] = 0 ,
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
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.
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
K IP U P = f I . (B.9)
APPENDIX B. GENERALIZED BOUNDARY VALUE PROBLEMS 135
Applying the equation over the K subdomains leads to the discrete sys-
tem;
K IP U P = f I I = 1, · · · , K . (B.10)
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
K P QU Q + C P QV Q = f p .
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
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
(λ + µ)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
thus
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
and Z Z
P (n̂)
F = NiP ti dS + NiP fi dV = 0 .
S V
Appendix C
Convergence analysis
k~uk+1 − ~uk
lim = c.
k→∞ k~uk − ~ukp
141
APPENDIX C. CONVERGENCE ANALYSIS 142
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→∞
From a physical point of view we may expect the following behaviour from
the individual elements in a given discretization:
• 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.
[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.
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) γxy
Consider the square energy norm of the error k~eh k2E . This error satisfies
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
Π2n−1 − Πn Πn−2
ΠExa =
(2Πn−1 − Πn − Πn−2 )
• Solve a series of meshes with solutions given by ~u1 , ~u2 , ..., ~un . Each
mesh has a characteristic element size h.
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
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
• 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.
h1 = 2.0 h2 = 0.5
l = 10
Figure C.3. Tappered bar under compressive load at the tip.
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)
Q 1/2
k~uExa − ~uF E k ΠExa − F E
= .
k~uExa k ΠExa
Y Y
Z X Z X
Y Y
Z X Z X
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
1.0
log([Uex-Ufe]/[Uex])
1.5
2.0
2.5
Example: cantilever beam Consider the cantilever beam shown in fig. C.7
P x,u 2c
1.0
y,v
4 Horizontal field
3
2
1
0
1
2
3
40 5 10 15 20
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