You are on page 1of 3

Institute of Aircraft Design and

Lightweight construction

IFL

Exercise 1: Construction of shape functions

1 Basics and examples


For introduction a short review of the basics from the lecture will be given. In the finite element me-
thod in structural mechanics, the displacement in spatial discretization has generally the following
approach:
 
u1
n
 u2 
X 
u(x, y, z) = Nu i (x, y, z) ui = Nu 1 Nu 2 . . . Nu n  .  = N u u(e) , (1)
i=1
 .. 
un

Here N is the vector of the shape functions and u(e) the vector for the displacements of the nodes
in x-direction. The other components of displacement are obtained analogously with:
n
X
v(x, y, z) = Nv i (x, y, z) vi = N v v (e) (2)
i=1
n
X
w(x, y, z) = Nw i (x, y, z) vi = N w w(e) . (3)
i=1

The aim is to find a scheme to determine the vector of the shape functions, taking into account
that the coordinate system alternates. In practice, the task is to find first the shape functions
for one-dimensional problems and then extends them to two- or three-dimensional problems by
multiplicative combination. Therefore, the structure is divided into multiple elements. For each
element a polynomial-ansatz is made in the local, non-dimensional coordinate system:
 
α0
 α1 
 
u(ξ1 ) = α0 + α1 ξ1 + α2 ξ12 + · · · = 1 ξ1 ξ12 . . . ξ1t  .  = P α , (4)
 .. 
αt

Here P includes the terms of the polynomial and the vector α its coefficients. The node coordinates
are substituted into Eq. 4, in order to obtain a system of equations. In order to satisfy the condition
of completeness, it takes the same number of equations as coefficients αi . That means for a quadratic
line element with t = 2, three nodal coordinates, in the element, are required. Thus, the system of
equations can then be written as:
2 t
    
u1 1 ξ11 ξ11 . . . ξ11 α0
 u2   1 ξ12 ξ12 2 t 
. . . ξ12   α1 

u(e) =  .  =  . = P (e) α . (5)
  
. . . . .
 ..   .. .. .. .. ..   .. 
 

2 t
ut 1 ξ1t ξ1t . . . ξ1t αt

In order to eliminate the coefficients αi and to obtain the shape functions in the local, non-
dimensional coordinate system, the matrix P (e) must be inverted:
−1
u(ξ1 ) = P α = P P (e) u(e) = N (ξ1 ) u(e) . (6)

Finally, Eq. 6 is the desired mathematical description.

Finite Element Method II 1


Institute of Aircraft Design and
Lightweight construction

IFL

1.1 A one-dimensional example with polynomial degree t = 1 (linear line element)


For a one-dimensional linear line element with the interval boundaries [−1, +1] and two nodes, the
relations can be written as:
 
 α0
u(ξ1 ) = P α = 1 ξ1
α1
    
(e) u1 (e) 1 −1 α0
u = =P α=
u2 1 1 α1
 −1  
−1 1 −1 u1
u(ξ1 ) = P P (e) u(e) = 1 ξ1

1 1 u2
  
 1/2 1/2 u1
= 1 ξ1
−1/2 1/2 u2
   
1 1 1 1
 u1  u1
= 2 − 2 ξ 1 2 + 2 ξ1 = N 1 N 2 .
u2 u2

2 Determination and visualization of 1D shape functions


The example above of the one-dimensional line element can be visualized with the help of
Paraview. The exercise folder includes the following Python-scripts:
• shape functions linear.py
• shape functions 1D.py

• shape functions 2D.py


We take the shape functions linear.py as example. Open the file with an editor, e.g.: with SciTE.
For programming the example, only the rows between the two hashtags are important. The code
is limited to a few lines and shows the sequence of the example. The function is used as filter
in Paraview. Open Paraview 3.14 by typing paraview314 in the console. Under Menu Bar →
Macros you can find the macro UE1 which constructs the filter pipeline. Press Apply to visualize
the linear shape functions. To see the shape function of the other node set in the field linear the
node_number=2. Note that the shape functions are shown just in the plate. That means the 1D
shape functions are only extruded in a 2D space.

2.1 Assignment: Construction of 1D shape functions with arbitrary polynomial de-


gree
The given example is to be extended so that the shape functions of a 1D line element can have
arbitrary polynomial degree. Open the file shape functions 1D.py with an editor. In this function
the three lines, marked with ’ ????’, must be changed. The previous example serves for orientation.
If the required changes were done run the macro UE1 1D . The error messages are displayed in a
separate window of Paraview. For troubleshooting the file can be read again by rerunning the macro
UE1 1D . Then the polynomial degree can be adjusted in the filter 1D with polynomialDregree.
The node number can be selected through shapefunctionId.

3 2D shape functions
Shape functions for rectangular elements, in particularly rectangular elements of Lagrange-class,
are constructed by multiplicative combination of 1D dimensional shape functions.

Nij (ξ1 , ξ2 ) = Ni (ξ1 ) · Nj (ξ2 ) . (7)

Finite Element Method II 2


Institute of Aircraft Design and
Lightweight construction

IFL

The individual shape-functions Nij can be determined as components of the dyadic product (also
known as outer product) in the spatial directions of 1D shape function vectors:
 
N11 . . . N1t2
 .. .. ..  = N (ξ )T N (ξ )
 . . .  ξ1 1 ξ2 2 (8)
Nt 1 1 ... Nt1 t2

It should be noted that in the spatial directions different polynomial degrees can be used, which
leads to a non-square dyad. However, this shouldn’t be use in this context.

3.1 Assignment: Construction of 2D shape functions with arbitrary polynomial de-


gree
The task is to construct 2D shape functions with arbitrary polynomial degree. Herein, the poly-
nomial degrees should be equal in both directions. For this, the dyadic product of the 1D shape
function vectors has to be determined in the spatial directions. Open the file shape functions 2D.py
with an editor. The shape-functions in ξ1 -direction are identical to the shape functions of the one-
dimensional line element. The only difficulty is to implement the shape functions in ξ2 -direction,
which are labelled with ’ ????’. Note that the matrix P (e) will not change. Run the macro UE1 2D
to view the shape functions in Paraview. Again, the polynomial degree can be set in the filter 2D
with polynomialDregree. The number of considered shape function can be set with shapefunc-
tionId (e.g. 23“ for N23 created of N2 (ξ1 ) · N3 (ξ2 )). To compare the different shape functions

show or hide the corresponding WarpByScalar -filter for linear, 1D and 2D.

Finite Element Method II 3

You might also like