1. Finite Elements: Basis functions
1-D elements
coordinate transformation
1-D elements
linear basis functions
quadratic basis functions
cubic basis functions
2-D elements
coordinate transformation
triangular elements
linear basis functions
quadratic basis functions
rectangular elements
linear basis functions
quadratic basis functions
Scope: Understand the origin and shape of basis functions used in classical
finite element techniques.
Finite element method – basis functions
1
2. 1-D elements: coordinate transformation
We wish to approximate a function u(x) defined in
an interval [a,b] by some set of basis functions
n
u ( x) = ∑ ciϕ i
i =1
where i is the number of grid points (the edges of
our elements) defined at locations xi. As the basis
functions look the same in all elements (apart from
some constant) we make life easier by moving to a
local coordinate system
x − xi
ξ=
xi +1 − xi
so that the element is defined for x=[0,1].
Finite element method – basis functions
2
3. 1-D elements – linear basis functions
There is not much choice for the shape of a
(straight) 1-D element! Notably the length can vary
across the domain.
We require that our function u(ξ) be approximated
locally by the linear function
u (ξ ) = c1 + c2ξ
Our node points are defined at ξ1,2=0,1 and we
require that
u1 = c1
u2 = c1 + c2
⇒ c1 = u1
⇒ c2 = −u1 + u2
c = Au
⎡ 1 0⎤
A= ⎢
- 1 1⎥
⎣
⎦
Finite element method – basis functions
3
4. 1-D elements – linear basis functions
As we have expressed the coefficients ci as a
function of the function values at node points ξ1,2
we can now express the approximate function
using the node values
u (ξ ) = u1 + (−u1 + u 2 )ξ
= u1 (1 − ξ ) + u2ξ
= u1 N1 (ξ ) + N 2 (ξ )ξ
.. and N1,2(x) are the linear
basis functions for 1-D
elements.
Finite element method – basis functions
4
5. 1-D quadratic elements
Now we require that our function u(x) be
approximated locally by the quadratic function
u (ξ ) = c1 + c2ξ + c3ξ 2
Our node points are defined at ξ1,2,3=0,1/2,1 and
we require that
u1 = c1
u2 = c1 + 0.5c2 + 0.25c3
c = Au
u3 = c1 + c2 + c3
0
0⎤
⎡1
A= ⎢− 3 4 − 1⎥
⎢
⎥
⎢ 2 −4 2 ⎥
⎣
⎦
Finite element method – basis functions
5
6. 1-D quadratic basis functions
... again we can now express our approximated
function as a sum over our basis functions
weighted by the values at three node points
u (ξ ) = c1 + c2ξ + c3ξ 2 = u1 (1 − 3ξ + 2ξ 2 ) + u2 (4ξ − 4ξ 2 ) + u3 (−ξ + 2ξ 2 )
3
= ∑ ui N i (ξ )
i =1
... note that now we re
using three grid points
per element ...
Can we approximate a
constant function?
Finite element method – basis functions
6
7. 1-D cubic basis functions
... using similar arguments the cubic basis
functions can be derived as
u (ξ ) = c1 + c2ξ + c3ξ 2 + c4ξ 3
N1 (ξ ) = 1 − 3ξ 2 + 2ξ 3
N 2 (ξ ) = ξ − 2ξ 2 + ξ 3
N 3 (ξ ) = 3ξ 2 − 2ξ 3
N 4 (ξ ) = −ζ 2 + ξ 3
... note that here we
need derivative
information at the
boundaries ...
How can we
approximate a constant
function?
Finite element method – basis functions
7
8. 2-D elements: coordinate transformation
Let us now discuss the geometry and basis
functions of 2-D elements, again we want to
consider the problems in a local coordinate
system, first we look at triangles
y
η
P3
P3
P2
P1
x
before
Finite element method – basis functions
P1
P2
ξ
after
8
9. 2-D elements: coordinate transformation
Any triangle with corners Pi(xi,yi), i=1,2,3 can be
transformed into a rectangular, equilateral triangle
with
x = x1 + ( x2 − x1 )ξ + ( x3 − x1 )η
η
P3
P1 (0,0)
P2 (1,0)
P3 (0,1)
P2
P1
ξ
y = y1 + ( y2 − y1 )ξ + ( y3 − y1 )η
using counterclockwise numbering. Note that if
η=0, then these equations are equivalent to the 1D tranformations. We seek to approximate a
function by the linear form
u (ξ ,η ) = c1 + c2ξ + c3η
we proceed in the same way as in the 1-D case
Finite element method – basis functions
9
10. 2-D elements: coefficients
η
P3
... and we obtain
u1 = u (0,0) = c1
P1 (0,0)
P2 (1,0)
P3 (0,1)
P2
u2 = u (1,0) = c1 + c2
P1
u3 = u (0,1) = c1 + c3
ξ
... and we obtain the coefficients as a function of the
values at the grid nodes by matrix inversion
c = Au
⎡ 1 0 0⎤
A= ⎢− 1 1 0⎥
⎢
⎥
⎢− 1 0 1⎥
⎣
⎦
Finite element method – basis functions
containing the
1-D case
⎡ 1 0⎤
A= ⎢
- 1 1⎥
⎣
⎦
10
11. triangles: linear basis functions
from matrix A we can calculate the linear basis
functions for triangles
N1 (ξ ,η ) = 1 − ξ − η
N 2 (ξ ,η ) =
N 3 (ξ ,η ) =
Finite element method – basis functions
ξ
η
η
P3
P1 (0,0)
P2 (1,0)
P3 (0,1)
P2
P1
ξ
11
12. triangles: quadratic elements
Any function defined on a triangle can be approximated by the quadratic
function
2
2
u ( x, y ) = α1 + α 2 x + α 3 y + α 4 x + α 5 xy + α 6 y
and in the transformed system we obtain
u (ξ ,η ) = c1 + c2ξ + c3η + c4ξ 2 + c5ξη + c6η 2
η
P1 (0,0)
P2 (1,0)
P3
P3 (0,1)
+
P6
P1
+
+
as in the 1-D case
we need additional
points on the
element.
P4 (1/2,0)
+
+
P4
Finite element method – basis functions
P5 (1/2,1/2)
P5
P6 (0,1/2)
+
P2
ξ
12
13. triangles: quadratic elements
To determine the coefficients we calculate the
function u at each grid point to obtain
u1 = c1
η
P3
+
P6
+
u2 = c1 + c2 + c4
u3 = c1 + c3 + c6
u4 = c1 + 1 / 2c2 + 1 / 4c4
P1 (0,0)
P2 (1,0)
P3 (0,1)
P4 (1/2,0)
P5 (1/2,1/2)
P6 (0,1/2)
+
P+
1
+
P4
P5
P2
+
ξ
u5 = c1 + 1 / 2c2 + 1 / 2c3 + 1 / 4c4 + 1 / 4c5 + 1 / 4c6
u6 = c1 + 1 / 2c3 + 1 / 6c6
... and by matrix inversion we can calculate the coefficients as a function of
the values at Pi
c = Au
Finite element method – basis functions
13
14. triangles: basis functions
c = Au
0 0
0 0 0⎤
⎡1
⎢− 3 − 1 0
4 0 0⎥
⎢
⎥
⎢− 3 0 − 1 0 0 4 ⎥
A=⎢
⎥
2
2 0 −4 0 0 ⎥
⎢
⎢4
0 0 − 4 4 − 4⎥
⎢
⎥
0 2
0 0 − 4⎥
⎢2
⎣
⎦
η
P1 (0,0)
P2 (1,0)
P3 (0,1)
P4 (1/2,0)
P5 (1/2,1/2)
P6 (0,1/2)
P3
+
P6
+
+
P+
1
+
P4
P5
P2
+
ξ
... to obtain the basis functions
N1 (ξ ,η ) = (1 − ξ − η )(1 − 2ξ − 2η )
N 2 (ξ ,η ) = ξ (2ξ − 1)
N 3 (ξ ,η ) = η (2η − 1)
N 4 (ξ ,η ) = 4ξ (1 − ξ − η )
N 5 (ξ ,η ) = 4ξη
N 2 (ξ ,η ) = 4η (1 − ξ − η )
... and they look like ...
Finite element method – basis functions
14
15. triangles: quadratic basis functions
η
P3
+
Finite element method – basis functions
P6
+
+
P+
1
The first three quadratic basis functions ...
+
P
P5
4
P1 (0,0)
P2 (1,0)
P3 (0,1)
P4 (1/2,0)
P5 (1/2,1/2
P6 (0,1/2)
P
+2
ξ
15
16. triangles: quadratic basis functions
η
P3
+
Finite element method – basis functions
P6
+
+
P+
1
.. and the rest ...
+
P
P5
4
P1 (0,0)
P2 (1,0)
P3 (0,1)
P4 (1/2,0)
P5 (1/2,1/2
P6 (0,1/2)
P
+2
ξ
16
17. rectangles: transformation
Let us consider rectangular elements, and transform them into a local
coordinate system
y
η
P3
P4
P4
P3
P2
P1
x
before
Finite element method – basis functions
P1
P2
ξ
after
17
18. rectangles: linear elements
With the linear Ansatz
u (ξ ,η ) = c1 + c2ξ + c3η + c4ξη
we obtain matrix A as
⎡1 0
⎢− 1 1
A=⎢
⎢− 1 0
⎢
⎣ 1 −1
0⎤
0⎥
⎥
0 1⎥
⎥
1 − 1⎦
0
0
and the basis functions
N1 (ξ ,η ) = (1 − ξ )(1 − η )
N 2 (ξ ,η ) = ξ (1 − η )
N 3 (ξ ,η ) = ξη
N 4 (ξ ,η ) = (1 − ξ )η
Finite element method – basis functions
18
19. rectangles: quadratic elements
With the quadratic Ansatz
u (ξ ,η ) = c1 + c2ξ + c3η + c4ξ 2 + c5ξη + c6η 2 + c7ξ 2η + c8ξη 2
we obtain an 8x8 matrix A ... and a basis function looks
e.g. like
N1 (ξ ,η ) = (1 − ξ )(1 − η )(1 − 2ξ − 2η )
N 5 (ξ ,η ) = 4ξ (1 − ξ )(1 − η )
N1
Finite element method – basis functions
η
P4
P7
+
+
P8
P1
N2
P3
+ P6
+
P5
P2
ξ
19
20. 1-D and 2-D elements: summary
The basis functions for finite element problems can be obtained by:
Transforming the system in to a local (to the element) system
Making a linear (quadratic, cubic) Ansatz for a function defined across
the element.
Using the interpolation condition (which states that the particular basis
functions should be one at the corresponding grid node) to obtain the
coefficients as a function of the function values at the grid nodes.
Using these coefficients to derive the n basis functions for the n node
points (or conditions).
Finite element method – basis functions
20