Mathematical methods for engineering.
The finite element method
Ana Alonso
University of Trento
Doctoral School in Environmental Engineering - January 25,
2012
FEM: Remarks on programming
−∆u = f on Ω = (0, 1) × (0, 1) u = 0 in ∂Ω
Find u ∈ V such that Z
Ω
∇u · ∇v dx = Z
Ω
f v dx ∀v ∈ V
We consider a triangulation of the domain T h = {K k } nel k=1 and the finite dimensional space V h of piecewise linear functions on T h .
Find u h ∈ V h such that Z
Ω
∇u h · ∇v h dx = Z
Ω
f v h dx ∀v h ∈ V h
Ana Alonso Mathematical methods for engineering
The linear system
Let {φ i } ndof i =1 be a base of V h . Then u h (x ) =
ndof
X
j =1
U j φ j (x ) and in particular
Z
Ω
∇ ndof X
j =1
U j φ j (x )
·∇φ i (x ) dx = Z
Ω
f (x ) φ i (x ) dx ∀i = 1, . . . , ndof
ndof
X
j =1
U j Z
Ω
∇φ j (x )·∇φ i (x ) dx = Z
Ω
f (x ) φ i (x ) dx ∀i = 1, . . . , ndof
a i ,j = Z
Ω
∇φ j (x ) · ∇φ i (x ) dx , f i = Z
Ω
f (x ) φ i (x ) dx
A U = f
The element matrix A K and the element load f K
a i ,j = Z
Ω
∇φ j (x ) · ∇φ i (x ) dx =
nel
X
l =1
Z
K l
∇φ j (x ) · ∇φ i (x ) dx
Each element stiffness matrices is a 3 × 3 matrix.
S K =
s 1,1 s 1,2 s 1,3 s 2,1 s 2,2 s 2,3 s 3,1 s 3,2 s 3,3
In order to calculate s i ,j = R
K ∇φ i · ∇φ j (local numeration) it is easier to work on the reference element.
Analogously f i =
Z
Ω
f (x ) φ i (x ) dx =
nel
X
l =1
Z
K l
f (x ) φ i (x ) dx
and we can consider an element load f K that is a vector with three components.
Ana Alonso Mathematical methods for engineering
Main steps
I Construction and representation of the triangulation.
I Computation of the element stiffness matrices A K and element loads f K .
I Assembly of the global stiffness matrix A and load vector f.
I Solution of the system of equations A U = f.
I Postprocesing.
Representation of the triangulation
1 2
3
4 5
6 7
8 9
10 11
12 13 14
15
16
elem =
1 1 3 2 . . . 14 3 4 7 7 . . . 16 2 3 2 8 . . . 15
To represent a triangulation we will use:
I A matrix coor containing for each node its coordinates.
I coor has two rows and nnod columns.
I In this way we have numerated the nodes.
I Another matrix elem containg for each element its nodes.
I elem has three rows and nel columns.
I In this way we have a local numeration for the nodes of each triangle.
Ana Alonso Mathematical methods for engineering
The reference element
0 1
1 P P
P
0 1
2