Shape Functions in Finite Element Method: Handouts
Shape Functions in Finite Element Method: Handouts
Shape Functions in Finite Element Method: Handouts
on
Dr.M.Madhavi, Professor
Contents:
1.0 Introduction
2.0 Methods to Derive Shape Functions
3.0 1D Element – Bar Element
3.1 Cartesian Coordinate: Linear Shape functions
3.2 Natural Coordinate : Linear and Quadratic Shape functions
3.3 Serendipity Approach
3.4 Lagrange Approach
4.0 Beam Element
4.1 Cartesian Coordinate
4.2 Hermite Shape functions
5.0 2D Element- Triangle Element
5.1 Cartesian Coordinate
5.2 Natural Coordinate
6.0 2D Element- Quadrilateral Element
6.1 Mapping of Rectangular Element
6.2 Shape functions of 9 Noded Element
7.0 3D Element
8.0 Bibliography
1.0 Introduction:
Finite Element Method can be viewed simply as a method of finding approximate solutions for
partial differential equations or as a tool to transform partial differential equations into algebraic
equations, which are then easily solved. The basic steps in Finite element formulation:
1. Since the solution for the field variable satisfying both the boundary conditions and the
differential equation is unknown, we begin with an assumed trial solution. The trial solution is
chosen such that the boundary conditions are satisfied.
2. The trial solution assumed in general does not satisfy the differential equation exactly and leaves
a domain residual defined as the error in satisfying the differential equation.
3. The accuracy of the assumed trial solution can be improved by discretizing the domain into
several segments (called finite elements) and use several piece-wise continuous trial functions,
each valid within a segment (finite element).
Shape functions:
In the finite element method, continuous models are approximated using information at a finite
number of discrete locations. Dividing the structure into discrete elements is called discretization.
Interpolation within the elements is achieved through shape functions.
“u” is the single generic translation in x , thus equation 𝑢̅ = 𝑢 is for entire solid displacement
Let q1 , q2 be the nodal displacements in x- direction at node 1 & 2
𝑞 = [𝑞1 , 𝑞2 ] = [𝑢1 , 𝑢2 ]
Displacement models:
For the displacement formulation, the essential step consists of approximation in the variation of
displacement in the element by a suitable function.
𝑢 = 𝑐1 + 𝑐2 𝑥 + 𝑐3 𝑥 2 + 𝑐4 𝑥 3 + …
Where𝑐1, 𝑐2 , 𝑐3 , are unknown coefficients and are also called as generalized coordinates
Now the displacement u at any point with in the element in Fig.2 varies linearly with x as
𝑢̅ = 𝑐1 +𝑐2 𝑥
Boundary condition :at x=0, u=q1 ; x=L, u=q2
𝑞2 −𝑞1
𝑢̅ = 𝑞1 + ( )𝑥
𝐿
𝑥 𝑥
𝑢 = 𝑞1 + (1 − ) + 𝑞1 ( )
𝐿 𝐿
𝑥 𝑥 𝑞1
𝑢 = [1 − ][ ]
𝐿 𝐿 𝑞2
𝑢̅ = 𝑓𝑞
Where ,𝑢̅ = 𝑑𝑖𝑠𝑝𝑙𝑎𝑐𝑒𝑚𝑒𝑛𝑡 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 ; 𝑞 = 𝑛𝑜𝑑𝑎𝑙 𝑑𝑖𝑠𝑝𝑙𝑎𝑐𝑒𝑚𝑒𝑛𝑡𝑠 = {𝑞𝑖 }
f= shape function or interpolation function
“The shape function defines displacements within an element when the ith element d.o.f has a unit value
and all other elements d.o.f is zero”.
The unknown displacement field within an element will be interpolated by linear distribution. To
implement this linear interpolation linear shape functions will be introduced.
Fig.4 Interpolation Functions for Four segment approximation.
We will designate the natural coordinate used for one dimensional case by ζ.Consider a child line shown
in figure.5 with two end points defined by their coordinates A(x1) and B(x2).The parent line indicating ζ
varying from A’(-1) to B’(+1) is also shown in the figure.5.An appropriate linear transformation
between x and ζ is given by
(𝑥1 + 𝑥2 ) (𝑥2 − 𝑥1 )
x(ζ) = + ζ
2 2
(1− 𝜁) (1+ 𝜁)
= 𝑥1 + 𝑥2
2 2
= N1 x1 + N2 X2
(1− 𝜁) (1+ 𝜁)
N1 = N2 =
2 2
Where Ni represent the interpolation functions used for coordinate transformation.Here we interpolate
the coordinates of an interior point(within the element) from the coordinates of the nodal points in the
same way as we interpolated the unknown field variable.If,in fact,the same shape functions are used for
interpolating the unknown field variable and geometry transformation,we call them isoparametric
elements.If the shape functions used for coordinate transformation are of a lower degree than those for
the unknown field variable,then we call them sub-parametric elements.If,on the other hand,the shape
functions used for coordinate transformation are of a higher degree than those for the unknown field
variable,then we call them Superparametric elements.
For a point P’, ζ =0.5,correspondingly,
(𝑥1 + 3𝑥2 )
x= ; Which is the point,P
4
For a point Q,
(𝑥2 + 𝑥1 )
x = (𝑥1 ) + 4
correspondingly, ζ = -0.5,which is the point Q’.
3.2.1 Quadratic Transformation between x and ζ :
A quadratic element is a line element with three nodes and each node having u as the nodal degree of
freedom.
Fig.6 Quadratic element- ID element with midnode
In order to fit a quadratic transformation between x and ζ ,we need one more point C as shown in
figure.6.The corresponding parent line A’ C’ B’ is also shown in figure.We observe that C’ is always
located at ζ =0 while the corresponding point C can be located at any desired position on the line AB in
the Cartesian frame.
X(ζ) = ∑ 𝑁𝑖 𝑥𝑖 = 𝑁1 𝑥1 + 𝑁2 𝑥2 + 𝑁3 𝑥3
N3 = (𝟏 + 𝝃 )(𝟏 − 𝝃 )
The displacement field within the element is written in terms of the nodal displacement as
𝒖 = 𝑵𝟏 𝒒𝟏 + 𝑵𝟐 𝒒𝟐 + 𝑵𝟑 𝒒𝟑
𝒖 = 𝑵𝒒
Property of Shape function: N1 + N2 + N3 = 1
Fig.7. Shape functions of a Quadratic Element
An easy way of writing down the necessary shape or interpolation functions by inspection is as follows:
If we observe the characteristic of shape functions of the above equation,we see that each N i takes a
value of unity at the point I and goes to zero at all other points j≠ i.This has to be so in order to satisfy
the relation, x= ∑ 𝑁𝑖 𝑥𝑖 ,……We can use this fact to write down the shape functions very easily.
For example,we can now write the shape function N1 in Quadratic equation based on the above
observation that N1 should be unity at point 1 and zero at points 2 and 3.Since the coordinates of points 2
and 3 are ζ =1 and 0,respectively,the functions which become zero at the points 2 and 3 are simply ( ζ -
0) and (ζ-1).Thus we can write the required shape function as:
N1 = (SF) ( ζ -0) (ζ-1)
Where scale factor(SF) is determined from the requirement that N1 be unity at point 1 i.e.,(ζ =-1).We
readily find that SF=0.5.Thus the required shape function is
On similar lines,we can directly write the other two shapes functions as
N3 = - (ζ + 1)(ζ-1)
x(ζ) = 𝑁1 𝑥1 + 𝑁2 𝑥2 + 𝑁3 𝑥3
x(ζ) = (1+ζ)2
We can fit a nonlinear transformation between x and such a transformation can be used to formulate
finite elements which possess curved edges so that we can model curved structural geometry.
The shape functions for the quadratic transformation for the data points: ζ1=-1 ; ζ2=1 ; ζ3 =0 and the
corresponding function values x1, x2 and x3.
(𝜁 − 𝜁)(𝜁3 − 𝜁) (1−𝜁)(0−𝜁) (𝜁)(𝜁−1)
N1= (𝜁 2−𝜁 = =
2 1 )(𝜁3 −𝜁1 ) (1+1)(0+1) 2
A beam element undergoes transverse deformation. Beam element is a simple line element representing
the neutral axis of the beam with two nodes and each node having two degrees of freedom.
4.1Cartesian Coordinate
Fig.8 Beam Element with two nodes and each node having two degrees of freedom.
Figure.8 shows flexural (beam) element, for which x-y is plane of bending
Where, V – Translation in y- direction
b – Body force acting in y- direction
At node 1:
𝒒𝟏 –Translation in y- direction
𝒒𝟐 – Rotation in z- direction
At node 2:
𝒒𝟑 –Translation in y- direction
𝒒𝟒 – Rotation in z- direction
Vector noded displacements,
𝒒 = [ 𝒒𝟏 𝒒𝟐 𝒒𝟑 𝒒𝟒 ]
= [ 𝑽𝟏 𝑸𝒁𝟏 𝑽𝟐 𝑸𝒁𝟐 ]
Which,
𝒅𝑽𝟏 𝒅𝑽𝟐
𝑸𝒁𝟏 = , 𝑸𝒁𝟐 =
𝒅𝒙 𝒅𝒙
𝒈𝟏
𝒅𝒈𝟏𝟏 𝟎 𝟎 𝟎 at x = 0
𝒅𝒙 𝟎 𝟏 𝟎 𝟎
𝒉= 𝒈 =[ ]
𝟐 𝟏 𝑳 𝑳𝟐 𝑳𝟑 at x = L
𝒅𝒈𝟐
[ ] 𝟎 𝟏 𝟐𝑳 𝟑𝑳𝟐
𝒅𝒙
Inverse of 𝒉:
𝑳𝟑 𝟎 𝟎 𝟎
𝟏 𝟎 𝑳 𝟑
𝟎 𝟎 ]
𝒉−𝟏 = 𝟑[
𝑳 −𝟑𝑳 −𝟐𝑳𝟐 𝟑𝑳 −𝑳𝟐
𝟐 𝑳 −𝟐 𝑳
̅ = 𝒈𝒉−𝟏 𝒒
𝒖
̅ = 𝒇𝒒
but initially 𝒖
𝒈𝒉−𝟏 𝒒 = 𝒇𝒒
𝒇 = 𝒈𝒉−𝟏
Where 𝒇 = 𝑺𝒉𝒂𝒑𝒆 𝑭𝒖𝒏𝒄𝒕𝒊𝒐𝒏
𝑳𝟑 𝟎 𝟎 𝟎
𝟐 𝟑
𝟏 𝟎 𝑳 𝟑
𝟎 𝟎 ]
𝒇 = [𝟏 𝒙 𝒙 𝒙 ] 𝟑 [
𝑳 −𝟑𝑳 −𝟐𝑳𝟐 𝟑𝑳 −𝑳𝟐
𝟐 𝑳 −𝟐 𝑳
= [ 𝒇𝟏 𝒇𝟐 𝒇𝟑 𝒇𝟒 ]
𝟏
= 𝑳𝟑 [ 𝟐𝒙𝟑 − 𝟑𝒙𝟐 𝑳 + 𝑳𝟑 𝒙𝟑 𝑳 − 𝟐𝒙𝟐 𝑳𝟐 + 𝒙𝑳𝟑 − 𝟐𝒙𝟑 + 𝟑𝒙𝟐 𝑳 𝒙𝟑 𝑳 − 𝒙 𝟐 𝑳 𝟐 ]
The shape functions for beam element are called “Hermite shape functions” They require to
satisfy both slope continuity as well as displacement continuity.
𝟐𝒙𝟑 −𝟑𝒙𝟐 𝑳+𝑳𝟑
1) 𝒇𝟏 = 𝒕𝒓𝒂𝒏𝒔𝒍𝒂𝒕𝒊𝒐𝒏 𝒂𝒕 𝒏𝒐𝒅𝒆 𝟏 =
𝑳𝟑
𝒙 = 𝟎 , 𝒇𝟏 = 𝟏
𝒙 = 𝑳 , 𝒇𝟏 = 𝟎
𝒙𝟑 𝑳−𝟐𝒙𝟐 𝑳𝟐 +𝒙𝑳𝟑
2) 𝒇𝟐 = 𝒓𝒐𝒕𝒂𝒕𝒊𝒐𝒏 𝒂𝒕 𝒏𝒐𝒅𝒆 𝟏 =
𝑳𝟑
𝒙 = 𝟎 , 𝒇𝟐 = 𝟎
𝒙 = 𝑳 , 𝒇𝟐 = 𝟎
−𝟐𝒙𝟑 +𝟑𝒙𝟐 𝑳
3) 𝒇𝟑 = 𝒕𝒓𝒂𝒏𝒔𝒍𝒂𝒕𝒊𝒐𝒏 𝒂𝒕 𝒏𝒐𝒅𝒆 𝟐 =
𝑳𝟑
𝒙 = 𝟎 , 𝒇𝟑 = 𝟎
𝒙 = 𝑳 , 𝒇𝟑 = 𝟏
𝒙𝟑 𝑳−𝒙𝟐 𝑳𝟐
4) 𝒇𝟒 = 𝒓𝒐𝒕𝒂𝒕𝒊𝒐𝒏 𝒂𝒕 𝒏𝒐𝒅𝒆 𝟐 =
𝑳𝟑
𝒙 = 𝟎 , 𝒇𝟒 = 𝟎
𝒙 = 𝑳 , 𝒇𝟒 = 𝟎
𝟏−𝝃 𝟏+𝝃 𝒙𝟏 + 𝒙𝟐 𝒙𝟐 − 𝒙𝟏
𝒙=( ) 𝒙𝟏 + ( ) 𝒙𝟐 + ( )+( )𝝃
𝟐 𝟐 𝟐 𝟐
Where 𝒍𝒆 =(𝒙𝟐 − 𝒙𝟏 ) ; is the length of the element
Fig.9. Hermite Shape Functions of a Beam Element
Let 𝑯𝒊 = 𝒂𝒊 + 𝒃𝒊 𝝃 + 𝒄𝒊 𝝃𝟐 + 𝒅𝒊 𝝃𝟑 and 𝒊 = 𝟏, 𝟐, 𝟑, 𝟒
From above graphs
𝑯𝟏 𝑯𝟏𝟏 𝑯𝟐 𝑯𝟏𝟐 𝑯𝟑 𝑯𝟏𝟑 𝑯𝟒 𝑯𝟏𝟒
ξ =-1 1 0 0 1 0 0 0 0
ξ=1 0 0 0 0 1 0 0 1
Let u,v be generic displacements in x and y directions. The displacements components of a local node
in the x and y directions as shown in Figure.10., respectively
𝑞 = [ 𝑞1 , 𝑞2 , 𝑞3 … … … … . . 𝑞6 ]𝑇
The d.o.f. in x- direction are {𝑞2 , 𝑞4 , 𝑞6 } and d.o.f. in y direction are {𝑞1 , 𝑞3 , 𝑞5 }
For the given triangular element,
𝑢 = 𝑐1 + 𝑐2 𝑥 + 𝑐3 𝑦
𝑢 = 𝑐4 + 𝑐5 𝑥 + 𝑐6 𝑦
𝑐1
𝑐2
1 𝑥 𝑦 0 0 0 𝑐3
𝑢= [ ]
0 0 0 1 𝑥 𝑦 𝑐4
𝑐5
[𝑐6 ]
Where g= geometric matrix
1 𝑥 𝑦 0 0 0
=[ ]
0 0 0 1 𝑥 𝑦
Let h= [gi]
1 𝑥1 𝑦1 0 0 0
0 0 0 1 𝑥1 𝑦1
1 𝑥2 𝑦2 0 0 0
=
0 0 0 1 𝑥2 𝑦2
1 𝑥3 𝑦3 0 0 0
[0 0 0 1 𝑥3 𝑦3 ]
Since 𝑢 = 𝑓𝑞 and
𝑢 = 𝑔𝑞
But q=hc
Where 𝑞= nodal displacement vectors
Then, c=h-1q
f= gh-1
From the above relation
1 𝑥1 𝑦1 0 0 0 −1
0 0 0 1 𝑥1 𝑦1
1 𝑥 𝑦 0 0 0 1 𝑥2 𝑦2 0 0 0
𝑓=[ ]
0 0 0 1 𝑥 𝑦 0 0 0 1 𝑥2 𝑦2
1 𝑥3 𝑦3 0 0 0
[0 0 0 1 𝑥3 𝑦3 ]
𝑓1 0 𝑓2 0 𝑓3 0
𝑓=[ ]
0 𝑓1 0 𝑓2 𝑥 𝑓3
1
𝑓1 = [𝑥 𝑦 − 𝑥3 𝑦2 − 𝑦23 𝑥 + 𝑥23 𝑦]
2𝐴123 2 3
1
𝑓2 = [𝑥 𝑦 − 𝑥1 𝑦3 − 𝑦31 𝑥 + 𝑥31 𝑦]
2𝐴123 3 1
1
𝑓3 = [𝑥 𝑦 − 𝑥2 𝑦1 − 𝑦12 𝑥 + 𝑥12 𝑦]
2𝐴123 1 2
𝑥12 = 𝑥2 − 𝑥1
𝑦12 = 𝑦2 − 𝑦1
𝑦23 = 𝑦3 − 𝑦2
Where 𝐴123 = area of the triangular element
Property of Shape function: f1 + f2 + f3 = 1
𝑵𝟏 = 𝝃
𝑵𝟐 = 𝜂
𝑵𝟑 = 𝟏 − 𝝃 − 𝜼
We will designate the natural coordinates used for two- dimensional domains by and .Thus we are
looking for transformation between (x-y) and (-). Consider the general quadrilateral ABCD shown in
Figure13.The parent square A1 B1 C1 D1 indicating , varying from -1 to +1 is also shown in figure
13.If the element in the (x-y) frame were rectangular (size l X h),
It is easy to see that the coordinate transformation would be simply a scale factor and is given by
𝟐𝒙
= 𝒍
𝟐𝒚
= 𝒉
For a general quadrilateral element, we have to obtain the transformation
(x,y) f(,)
This transformation , which yields the coordinates of a point P(x,y) within the element in terms of the
nodal coordinates ( just as we interpolate the displacement/ temperature field), can be written as
𝑥𝑝 = ∑ 𝑁𝑖 𝑥𝑖
𝑦𝑝 = ∑ 𝑁𝑖 𝑦𝑖
Where i =1,2,… , NNOEL which stands for the number of nodes per element (= 4 here ). Considering
that 𝑁𝑖 must be unity at node1 and zero at all other nodes, the shape functions 𝑁𝑖 can be obtained as
𝑁1 = (SF)(Equation of line 2-3)(Equation of the line 3-4)
= (SF)(1-)(1-)
Where the scale factor(SF) is to be chosen such that 𝑁1 is unity at node 1 and the product of equation of
lines 2-3 and 3-4 has been taken to ensure that 𝑁1 is zero at nodes 2, 3 and 4.
At node 1, = = -1 and, therefore SF=0.25, Thus our shape functions id given by
1
𝑁1 = ( ) (1 − )(1 − )
4
On similar lines, we can obtain the other shape functions as
1
𝑁2 = ( ) (1 + )(1 − )
4
1
𝑁3 = ( ) (1 + )(1 + )
4
1
𝑁4 = ( ) (1 − )(1 + )
4
Property of Shape Function: N1 + N2 + N3 + N4 = 1
Using this coordinate transformation, we will be able to map a parent square element in (,) space into
a general quadrilateral element in physical (x-y) coordinate space. Consider, for example, the general
quadrilateral shown in Fig , Using the nodal coordinate data given, we can write
𝑥 = ∑ 𝑁𝑖 𝑥𝑖 = −𝑁1 + 𝑁3
𝑦 = ∑ 𝑁𝑖 𝑦𝑖 = −5𝑁2 + 5𝑁4
Thus, we have
1
𝑥= [(1 + )(1 + ) − (1 − )(1 − )]
4
5
𝑦= [(1 − )(1 + ) − (1 + )(1 − )]
4
Fig.14 Shape Functions Ni ( i = 1,2,3,4 ) for Quad4 element.
7.0 3D Element:
Triangles in two dimensions generalize to tetrahedra in three. The corresponding generalization of a
quadrilateral is a hexahedron, also known in the finite element literature as brick. A hexahedron is
topologically equivalent to a cube. It has eight corners, twelve edges or sides, and six faces. Finite
elements with this geometry are extensively used in modelling three-dimensional solids.
The construction of hexahedra shape functions and the computation of the stiffness matrix was greatly
facilitated by three advances in finite element technology: natural coordinates, isoparametric mapping
and numerical integration.
Hexahedron Natural Coordinates
The natural coordinates for this geometry are called ξ , η and µ, and are called isoparametric
hexahedral coordinates or simply natural coordinates.
These coordinates are illustrated in Figure 16.As can be seen they are very similar to the quadrilateral
coordinates ξ and η. They vary from -1 on one face to +1 on the opposite face, taking the value zero
on the “median” face. As in the case of quadrilaterals, this particular choice of limits was made to
facilitate the use of the standard Gauss integration formulas.
The Eight Node (Trilinear) Hexahedron