You are on page 1of 70

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty

- 1 -
2 Introduction to the Finite Element Method for
Linear Elastic Solids
2.1 Introduction
In the finite element method, boundary value problems are modelled as an assembly
of small (arbitrary shaped) regions, termed elements (see Figure 1). Elements have
nodes, defined on or within the element boundary. To begin with, a primary quantity
must be selected. Rules governing how this quantity varies throughout the element
must then be defined. In geotechnical engineering, it is usual to select displacement as
the primary quantity. Displacements are then assumed to vary according to pre-
defined polynomial functions over the element. These polynomial functions are called
shape functions. Each node in an element has a its own shape function. The shape
function for the i
th
nodes is denoted N
i
.

Figure 1: Finite element discretisation and displacement approximation (after Potts (2003))
The order of the shape functions depends on the number of nodes contained in the
element. For example, a 4-noded element assumes a linear variation, whereas an 8-
noded element assumes a quadratic variation in displacement u and v (see Figure 1)
(Potts 2003). An analysis will only be accurate if the displacement/deformation over
the element accurately matches how the soil wants to deform in the actual boundary
value problem. As smaller and smaller elements are used (and the number of elements
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 2 -
increase), the finite element method is able to more closely match displacements in
real boundary value problems. This increase in accuracy comes at the cost of
increased calculation time. However, with modern computers, this increase
computational cost is becoming less problematic.
This unit is restricted to plane strain and axisymmetric problems. Two element types
are considered; 4-noded linear strain quadrilateral and an 8-noded quadratic strain
quadrilateral. This section of the notes defines all equations associated with linear
elastic plane strain and axisymmetric elements. The elements equations are derived
with reference to the four solution requirements discussed in Lecture 1:
1. Equilibrium
2. Compatibility
3. Constitutive behaviour
4. Boundary conditions
2.2 Basic Element Types
In this unit, two element type will be considered;
1. 4-noded linear strain quadrilateral, and;
2. 8-noded quadratic strain quadrilateral.
These elements can be applied to both plane strain and axisymmetric continua. This
section describes the node numbering convention and derives the shape functions.
2.2.1 Linear Strain Quadrilateral
A 4-noded linear strain quadrilateral element is shown Figure 2. Each node has two
degrees of freedom, which correspond to displacements in the x- and y-directions. The
nodes for the element must be numbered in the ant-clockwise direction (to be
compatible with the MATLAB functions provided later). The element can be an
arbitrary shaped quadrilateral in the global coordinate system. The coordinates of
the i
th
node are denoted (x
i
, y
i
). In order to define the shape functions for this element,
and to simplify the integration (which will be discussed later), the global element is
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 3 -
mapped into local coordinates s and t, which, for every element regardless of its
shape and size, varies from -1 to +1. Nodes 1 to 4 have local coordinates (s, t) of (-1,-
1), (1,-1), (1, 1) and (-1, 1). This results in a square with a length of two units.

t
s
t = 1
t = -1
s = 1 s = -1
x/r
y/z
Global coordinate system
(x, y) /(r, z)
Local coordinate system
(s, t)
1(x
1
,y
1
)
2(x
2
,y
2
)
3(x
3
,y
3
)
4(x
4
,y
4
)
1(-1,-1)
2(1,-1)
3(1,1)
4(-1,1)

Figure 2: 4-noded linear strain quadrilateral element
Shape functions are a function of the local coordinate system. Shape functions are
derived to have the property that the shape function for the i
th
node, N
i
(s,t), has a
value of unity at the i
th
node and a value of zero at all other nodes. To compute the
shape function for node 1, we note that the equations of two line that pass through all
nodes, except Node 1, are s 1 = 0 and t 1 = 0. Therefore, the shape function for the
1
st
node must take the form
N
1
(s,t) = l(s 1) (t 1)............................................................................................................................. (1)
This form ensures that the value of N
1
(s,t) is zero at nodes 2 to 4. The value of the
multiplier is found by substituting the local coordinates for node 1 and setting N
1
(s,t)
= 1, i.e.
N
1
(-1,-1) = l( 1 1) ( 1 1) = 1 .......................................................................................................... (2)
This gives 4l= 1, therefore l= . Hence
N
1
(s,t) = (s 1) (t 1)............................................................................................................................ (3)
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 4 -
All other shape functions may derived in a similar manner, giving;
N
2
(s,t) = - (s + 1) (t - 1)........................................................................................................................... (4)
N
3
(s,t) = (s + 1) (t +1) .......................................................................................................................... (5)
N
4
(s,t) = - (s 1) (t +1) ......................................................................................................................... (6)
With all four shape functions defined, the displacement in the x-direction at any point
in the element, u(s,t), can be written as a function of displacement in the x-direction at
each of the nodes, u
1
, u
2
, u
3
and u
4
;
u(s,t) = N
1
(s,t)u
1
+ N
2
(s,t)u
2
+ N
3
(s,t)u
3
+ N
4
(s,t)u
4
................................................................................. (7)
Similarly, the displacement in the y-direction, u(s,t), at any point can be expressed as
a function of the nodal displacement components in the y-direction v
1
, v
2
, v
3
and v
4

v(s,t) = N
1
(s,t)v
1
+ N
2
(s,t)v
2
+ N
3
(s,t)v
3
+ N
4
(s,t)v
4
................................................................................... (8)
Equations (7) and (8) can be expressed more conveniently as
u(s,t) =
i=1
n
N
i
(s, t) u
i
.................................................................................................................................. (9)
and
v(s,t) =
i=1
n
N
i
(s, t) v
i
................................................................................................................................ (10)
, respectively, where n is the number of nodes in the element.
It is also necessary to be able to express the global coordinates (x,y) as a function of
the local coordinates (s,t). This can be done using the same shape functions used to
describe the variation in displacement. Elements that use the same shape functions to
model the variation of the primary quantity (displacement) and map the geometry of
the global coordinates to local coordinate system are call isoparametric elements. The
global coordinate can be
x(s,t) = N
1
(s,t)x
1
+ N
2
(s,t)x
2
+ N
3
(s,t)x
3
+ N
4
(s,t)x
4
................................................................................... (11)
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 5 -
y(s,t) = N
1
(s,t)y
1
+ N
2
(s,t)y
2
+ N
3
(s,t)y
3
+ N
4
(s,t)y
4
. ............................................................................. (12)
Or, more generally, for an element with n nodes;
x(s,t) =

i=1
n
N
i
(s, t) x
i
............................................................................................................................... (13)
and
y(s,t) =

i=1
n
N
i
(s, t) y
i
............................................................................................................................... (14)
2.2.2 Quadratic Strain Quadrilateral
An 8-noded quadratic strain quadrilateral element is shown Figure 3. Like the linear
strain element, each node has two degrees of freedom for both plane strain and
axisymmetric conditions. These correspond to displacements in the x- and y-directions
for the plane strain case, and displacements in the r- and z-directions for the
axisymmetric case. The nodes for the element must be numbered 1 to 4 in the ant-
clockwise direction for the corner nodes, and the mid-side nodes must be numbered 5
to 8, such that node 5 is on the mid-side between nodes 1 and 2, etc, as shown in
Figure 3 (to be compatible with the MATLAB functions provided).
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 6 -
1(x
1
,y
1
)
5(x
5
,y
5
)
6(x
6
,y
6
)
7(x
7
,y
7
)
8(x
8
,y
8
)
2(x
2
,y
2
)
t
s
t = 1
t = -1
s = 1 s = -1
x/r
y/z
Global coordinate system
(x, y) /(r, z)
Local coordinate system
(s, t)
3(x
3
,y
3
)
4(x
4
,y
4
)
1(-1,-1)
2(1,-1)
3(1,1)
4(-1,1)
5(0,-1)
6(1,0)
7(0,1)
8(-1,0)

Figure 3: 8-noded quadratic strain quadrilateral element
The shape functions are again derived on the basis that N
i
(s,t), has a value of unity at
the i
th
node and a value of zero at all other nodes. The equations of three lines that
pass through all nodes except Node 1 are; s 1 = 0, t 1 = 0 and s + t + 1 = 0.
Therefore, the shape function for the 1
st
node must take the form
N
1
(s,t) = l(s 1) (t 1)(s + t +1)............................................................................................................ (15)
This ensures that N
1
(s,t) is equal to zero at all nodes except Node 1. The value of the
multiplier is then found by substituting s = -1 and t = -1 and setting N
1
(s,t) = 1. i.e.
N
1
(s,t) = l( 1 1) ( 1 1)( 1 1 +1) = 1 .......................................................................................... (16)
This gives -4l= 1, therefore l= -. Hence
N
1
(s,t) = - (s 1) (t 1)(s + t +1).......................................................................................................... (17)
All other shape functions may derived in a similar manner.
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 7 -
2.3 Stress and Strain
2.3.1 General
In general, an may be subject to 3 dependant displacement components, as shown in
Figure 4. This results in 6 independent strain components and 6 corresponding stress
components. The strains may be defined as:

x
=
j(u)
jx
;
y
=
j(v)
jy
;
z
=
j(w)
jz
;
g
xy
=
j(u)
jy
+
j(v)
jx
; g
yz
=
j(w)
jy
+
j(v)
jz
; g
xz
=
j(w)
jx
+
j(u)
jz
................................................ (18)
where u, v and w are increments of displacement in the x-, y- and z-directions,
respectively.
x
is the strain in the x-direction, etc and g
xy
is the shear strain the x-y
plane, etc.

y
x
z
v
u
w

Figure 4: Element subject to three displacement components
For an isotopic, linear-elastic material, the increments of stress are related to
increments of strains through the elastic constitutive matrix.
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 8 -

z
t
xy
t
xz
t
zy
=
E
(1+)(1-2)

(
(
(
(
1- 0 0 0
1- 0 0 0
1- 0 0 0
0 0 0
1-2
2
0 0
0 0 0 0
1-2
2
0
0 0 0 0 0
1-2
2

)
`

z
g
xy
g
xz
g
zy
......................... (19)
where E is Youngs Modulus and is Poissons ratio.
2.3.2 Plane Strain
In geotechnical analysis, problems that have one very large spatial dimension
compared to the others are often encountered. For example, long retaining walls, strip
(continuous) footings, pipelines, the long slopes etc (see Figure (5)). In these
situations, it is often reasonable to assume that the displacement in the long direction
is zero. This allows a very significant simplification to be made, reducing the number
of stress and strain components from 6 to 4. i.e.

x
=
j(u)
jx
;
y
=
j(v)
jy
; g
xy
=
j(u)
jy
+
j(v)
jx
;

z
= g
yz
= g
yz
= 0 ................................................................................................................................ (20)
The relationship between the 4 non-zero stress and strain components is given by

z
t
xy
=
E
(1+)(1-2)

(
(
(
1- 0
1- 0
1- 0
0 0 0
1-2
2

z
g
xy
.......................................................... (21)


CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 9 -

y
x
z

Figure 5: Plane strain (after Potts and Zdravkovic (1999))

2.3.3 Axisymmetric
It is also common for problems to possess (approximate) rotational symmetry about
an axis in terms of both geometry and applied loading. For example see Figure 6. In
this case it may be assumed that the deformation and stress state are identical in any
radial plane. It is convenient to adopt a cylindrical coordinate system r, z, q, where r,
which measures the distance from the axis of symmetry (and r cannot have negative
values), z is the vertical coordinate and q measure the angle around the axis of
symmetry. Assuming displacement stresses are uniform on any radial plane, the stress
and strains simplify to

r
=
j(u)
jr
;
z
=
j(v)
jz
;
q
=
v
r
; g
rz
=
j(u)
jr
+
j(v)
jz
;
g
rq
= g
zq
= 0 ........................................................................................................................................ (22)
And the relationship between the 4 non-zero stress and strain components is given by


CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 10 -

t
rz
=
E
(1+)(1-2)

(
(
(
1- 0
1- 0
1- 0
0 0 0
1-2
2

g
rz
......................................................... (23)
Which is identical to that for plane strain.


Figure 6: Axisymmetric (after Potts and Zdravkovic (1999))
Problems also exist which have axisymmetric geometry, but non-axisymmetric
loading. For example, a circular footing subject to a horizontal load. These problems
must be modelled using three-dimensional finite elements, or using a Fourier series to
capture the loading (both of these topics are outside the scope of this unit).

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 11 -
2.4 Equations for a Plane Strain Element
In the displacement based finite element method, the primary unknown is the
displacement field, which may vary throughout the region being modelled. Stresses
and strains are secondary quantities and may be found from the displacement field,
once it has be determined (Potts and Zdravkovic). For two dimensional plane strain
situations, the displacements field is defined by displacement increments u and v in
the global x and y coordinate directions, respectively. Equations (9) and (10) can be
combined and written in matrix form:

)
`
du(s,t)
dv(s,t)
=[N]

u
1
v
1
u
2
v
2
.
u
n
v
n
......................................................................................................................... (24)
where
[N] =


(
N
1
(s,t) 0 N
2
(s,t) 0 . N
n
(s,t) 0
0 N
1
(s,t) 0 N
2
(s,t) .... 0 N
n
(s,t)
..........................................(25)
Combining equations (20) and (24) for an element with n nodes gives:

z
g
xy
=

(
(
(
jN
1
(s,t)
jx
0
jN
2
(s,t)
jx
0 .
jN
n
(s,t)
jx
0
0
jN
1
(s,t)
jy
0
jN
2
(s,t)
jy
.... 0
jN
n
(s,t)
jy
0 0 0 0 .... 0 0

jN
1
(s,t)
jy
jN
1
(s,t)
jx
jN
2
(s,t)
jy
jN
2
(s,t)
jx
....
jN
n
(s,t)
jy
jN
n
(s,t)
jx

u
1
v
1
u
2
v
2
.
u
n
v
n
......... (26)
The matrix containing the derivatives of the shape functions with respect to global
coordinates, relating nodal displacements to strains, is conventionally denoted as [B]
and the incremental strain and displacement vectors are denotes {} and {d},
respectively. i.e:
{} = [B]{d}......................................................................................................................................... (27)
The derivatives in [B], can be found as follows. First, using the chain rule
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 12 -
jN
i
(s,t)
js
=
jx
js

jN
i
(s,t)
jx
+
jy
js

jN
i
(s,t)
jy
........................................................................................................ (28)
and
jN
i
(s,t)
jt
=
jx
jt

jN
i
(s,t)
jx
+
jy
jt

jN
i
(s,t)
jy
........................................................................................................ (29)
Equations (28) and (29) can be combined in matrix form

(
(
jN
1
(s,t)
js

jN
2
(s,t)
js

jN
n
(s,t)
js
jN
1
(s,t)
jt

jN
2
(s,t)
jt
.
jN
n
(s,t)
jt
=

(
(
jx
js
jy
js
jx
jt
jy
jt

(
(
jN
1
(s,t)
jx

jN
2
(s,t)
jx

jN
n
(s,t)
jx
jN
1
(s,t)
jy

jN
2
(s,t)
jy
.
jN
n
(s,t)
jy
........................ (30)
The matrix containing the derivatives of the global coordinates with respect to the
local coordinates is the call the Jacobian matrix, and is denoted [J]. i.e:
[J] =

(
(
jx
js
jy
js
jx
jt
jy
jt
................................................................................................................................. (31)
Derivatives of the shape functions with respect to local coordinates (i.e. the terms on
the left hand side of equation (30)) can be easily found by differentiating the shape
functions with respect to the local coordinates. Terms in the Jacobian can be found by
differentiating the isoparametric relationships, given by equations (13) and (14). For
example, derivatives with respect to local coordinate s are given by:
jx
js

=
i=1
n

jN
i
(s,t)
js
x
i
.................................................................................................................................. (32)
jy
js

=
i=1
n

jN
i
(s,t)
js
y
i
.................................................................................................................................. (33)
A similar process is followed to find the derivatives with respect to t. The derivatives
of the shape functions with respect to the global coordinates, which are the terms that
populate the [B] matrix, are therefore found by inverting the Jacobian:
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 13 -

(
(
jN
1
(s,t)
jx

jN
2
(s,t)
jx

jN
n
(s,t)
jx
jN
1
(s,t)
jy

jN
2
(s,t)
jy
.
jN
n
(s,t)
jy
= [J]
-1

(
(
jN
1
(s,t)
js

jN
2
(s,t)
js

jN
n
(s,t)
js
jN
1
(s,t)
jt

jN
2
(s,t)
jt
.
jN
n
(s,t)
jt
......................................... (34)
Equation (26), which relates displacements at discrete nodal points to strains
anywhere within an element, is now fully defined. For linear elasticity, the
constitutive relationship (i.e. the relationship between strain and stress) for plane
strain conditions, is given in equation (21). The notation for this equation can be
simplified and written as:
{} = [D]{}........................................................................................................................................ (35)
where {} is the vector of incremental stress and [D] is the linear elastic constitutive
matrix.
2.5 Stiffness equations
The equations derived thus far satisfy compatibility and define a constitutive
relationship. Therefore, two of the four solution requirements have been met. Before
boundary conditions can be applied, equations relating nodal forces and nodal
displacements, that satisfy equilibrium within the element, must be derived. To do this,
first consider the bar of length L and cross-sectional area A, with a Youngs modulus
E shown in Figure 7a. The bar is acted on by a axial force F. This causes a
displacement d. The relationship between F and d, which satisfies equilibrium is
required. This takes the form F = Kd, where K is the stiffness of the bar.
As this problem is statically determinate, the axial stress, , which constant
throughout the bar, and can be determined directly from the applied force F:
=
F
A
................................................................................................................................................. (36)
As stress is related to strain through Youngs modulus (i.e. = E) and strain can
be related to displacement (i.e. = d/L) the following can be formed:
E =
F
A
=
d
L
E...................................................................................................................................... (37)
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 14 -
This equation can be rearranged to give:
F =
EA
L
d............................................................................................................................................... (38)
That is K = EA/L.

dF
dd
F
u
d
d


E
dF
dd
L

Figure 7: Bar subjected to axial load
A similar relationship between the nodal forces and nodal displacements for the
element shown in Figure 8, is now sought. Taking the approach just used for the bar,
the first step is to relate the nodal forces to the internal stresses (as done in equation
(36)). However, this cannot be done for the element in Figure 8 as it is statically
indeterminate. An alternative approach is required. One approach commonly used is
to invoke the principle of minimum potential energy. This states that the equilibrium
position of a loaded elastic body is one which minimises the total potential energy
(PE). The total potential energy of a body is defined as:
PE = Internal strain energy (W
i
) Work done by external applied loads (W
e
) ...................................... (39)
Setting PE = 0 (the minimum) implies that the work done by the external force to
extent the bar by d is equal to the internal strain energy. The external work, W
e
, is
equal to the area under the force displacement graph in Figure7b. i.e
W
e
= d F........................................................................................................................................... (40)
The internal work, W
e
, is equal to the area under the stress strain graph, integrated
over the volume of the bar:
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 15 -
W
i
=
]
(
vol
dV.................................................................................................................................. (41)
As the stress and strain are constant throughout the bar, the integral can be easily
evaluated as:
W
i
= V = AL ................................................................................................................... (42)
Equating the external and internal work (i.e equations (40) and (41)) gives:
d F = AL ............................................................................................................................. (43)
Substituting in the relationship between stress and strain, and strain and displacement
gives:
d F =
d
L
E
d
L
A L..................................................................................................................... (44)
which can be rearranged to give equation (38). Therefore, the same results has been
achieved with out requiring a direct relationship between the applied force and
internal stress. The only relationships required were those between stress and strain
and, strain and displacement, which have both been derived for the plane strain
element (equations (26) and (21), respectively). Therefore a similar approach can be
taken. The external work for a continuum element is now the product of two vectors:
W
e
= {d}
T
{F}.................................................................................................................................... (45)
where {F} = {F
u1
, F
v1
, F
u2
, F
v2
,...., F
un
, F
vn
}
T
and {d} = {u
1
, u
1
, u
2
,
u
2
,...., u
n
, u
n
}
T
for an n nodded element. The internal work is the product of the
stress and stain vectors integrated over the volume of the element:
W
i
=
]
(
vol
{}
T
{} dV ........................................................................................................................ (46)
Substituting equations (26) and (2121) into (46) gives:
W
i
=
]
(
vol
{d}
T
[B]
T
[D] [B]{d}dV ..................................................................................................... (47)
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 16 -
Equating internal and external work (i.e equations (47) and (45)) gives:
{d}
T
{F} =
]
(
vol
{d}
T
[B]
T
[D] [B]{d}dV..................................................................................... (48)
The term {d}
T
cancels on both side of the equation and {d} can be taken outside of
the integral, leaving:
{F} =
]
(
vol
[B]
T
[D] [B] dV {d} .............................................................................................................. (49)
The element stiffness matrix, [K
e
], relating nodal forces {F} to nodal displacements
{d}, is therefore:
[K
e
] =
]
(
vol
[B]
T
[D] [B]dV .......................................................................................................................... (50)
So that
{F} = [K
e
] {d} ..................................................................................................................................... (51)
Another relationship commonly used in finite element models can be obtained by
substituting {} = [D][B]{d} into equation (48), giving:
{F} =
]
(
vol
[B]
T
{}dV............................................................................................................................. (52)

1 2
3 4
dF
u1

dF
v1

dF
u2

dF
v2

dF
u3

dF
v3

dF
u4

dF
v4

1 2
3 4
du
1

dv
1

du
2

dv
2

du
3

dv
3

du
4

dv
3

Figure 8: Restrained and free degrees of freedom
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 17 -
2.6 Equations for an Axisymmetric Element
For axisymmetric conditions, the displacements field is defined by displacement
increments u and v in the global r and z cylindrical coordinate directions,
respectively. Displacements in the and direction are zero.

g
rz
=

(
(
(
jN
1
(s,t)
jr
0
jN
2
(s,t)
jr
0 .
jN
n
(s,t)
jr
0
0
jN
1
(s,t)
jz
0
jN
2
(s,t)
jz
.... 0
jN
n
(s,t)
jz
N
1
(s,t)
r
0
N
2
(s,t)
r
0 ....
N
n
(s,t)
r
0

jN
1
(s,t)
jz
jN
1
(s,t)
jr
jN
2
(s,t)
jz
jN
2
(s,t)
jr
....
jN
n
(s,t)
jz
jN
n
(s,t)
jr

u
1
v
1
u
2
v
2
.
u
n
v
n
......... (53)

t
rz
=
E
(1+)(1-2)

(
(
(
1- 0
1- 0
1- 0
0 0 0
1-2
2

g
rz
......................................................... (54)



CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 18 -
2.7 Numerical Integration
To compute the stiffness matrix and the load vector for a plane strain element, it is
necessary to evaluate the integrals in equations (50) and (48), respectively. In general
it is not possible to do this analytically. Therefore, numerical integration is normally
used. Gaussian integration is one of the most efficient methods for evaluating
integrals, and is used widely in the finite element method. The method involves
replacing the integral by a weighted sum of the function evaluated at a number of
integration points, and it assumes the integral is in a standard from, where the limits
range from -1 to +1.
]
(
-1
+1
f(s)ds =
i=1
n
f(s
i
)w
i
............................................................................................................................. (55)
where s
i
is a specified coordinate for the ith integration point, and w
i
is a specified
weight for the ith integration point, and n is the number of integration points. The
method is very efficient for integrating polynomials, since an n-point rule is exact for
any polynomial of degree 2n-1 or less. The coordinates and weights for 1 to 3-point
Gauss integration for one-dimensional problems are given in Table 1.
Table 1: Gauss point local coordinates
Number of Points
Gauss Point Local
Coordinates
Weights
Exact for a
Polynomial of
degree
n s
i
w
i
i
1 0 2 1
-1/ 3
1
2
1/ 3
1
3
-1/ 0.6
5/9
0 8/9 3
1/ 0.6
5/9
5
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 19 -
Most integrals are not of standard form (i.e do not have limits of -1 to +1). Therefore,
a change of variable is needed. Consider the integral
]
(
a
b
g(x)dx ................................................................................................................................................. (56)
An equation for a local variable s can be derived that has a value of -1 at a and +1 at
b:
s =
2x - (b + a)
(b - a)
........................................................................................................................................ (57)
and x is then given by
x =
s(b - a) + (b + a)
2
............................................................................................................................... (58)
Substituting for x gives
]
(
a
b
g(x)dx =
]
(
-1
+1
f(s)
jx
js
ds =
(b - a)
2

]
(
-1
+1
f(s) ds........................................................................................ (59)
The above integral can then be evaluated using Gaussian integration. As an example,
consider the following integral
]
(
5
8
x
3
dx.................................................................................................................................................... (60)
which can be evaluated analytically to give 867.76. This integral can be written in
standard form as:
]
(
5
8
x
3
dx =
(b - a)
2

]
(
-1
+1
f(s) ds =
(8 - 5)
2

]
(
-1
+1

\
|
.
|
s(8 - 5) + (8 + 5)
2

3
ds ........................................................ (61)
The integral is a third order polynomial and so can be evaluated using two-point
integration
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 20 -
]
(
5
8
x
3
dx = =
(8 - 5)
2

\
|
.
|
-0.5773(8 - 5) + (8 + 5)
2

3
+
(8 - 5)
2

\
|
.
|
0.5773(8 - 5) + (8 + 5)
2

3
= 867.76........ (62)
Which matches the exact value of the integral.
To evaluate the plane strain stiffness matrix, equation (50) must be integrated.
Assuming the element is of unit thickness (in the z-direction), this involves integrating
over two dimensions, x and y. The integration can be performed over the local
coordinates, s and t, which are in the standard from (i.e range between -1 and +1)
provided the change of variables is accounted for. This is done using the determinate
of the Jacobian matrix (equation (31)),J, which accounts for the actual area of the
element in the global coordinate system. i.e
[K
e
] =
]
(
vol
[B]
T
[D] [B]dV =
]
(
s

]
(
t
[B(s
i
,t
i
)]
T
[D] [B(s
i
,t
i
)]Jdsdt............................................................. (63)
Numerical integration involves replacing the integral by a weighted sum of the
function evaluated at a number of integration points, i.e
[K
e
]
i=1
n
[B(s
i
,t
i
)]
T
[D] [B(s
i
,t
i
)]w
i
J
i
.................................................................................................. (64)
The coordinates and weights for 1 to 9-point Gauss integration for two-dimensional
problems are given in Table 2.
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 21 -
Table 2: Gauss point local coordinates
Number of
Points
Gauss Point Local Coordinates Weights
Exact for
Polynomial of
degree
n s
i
t
i
w
i

1 0 0 4 1
-1/ 3 -1/ 3
1
-1/ 3 1/ 3
1
1/ 3 -1/ 3
1
4
1/ 3 1/ 3
1
3
-
3
5
-
3
5

25
81

-
3
5

3
5

25
81

3
5
-
3
5

25
81

3
5

3
5

25
81

3
5

0
40
81

-
3
5

0
40
81

0
3
5

40
81

0
-
3
5

40
81

9
0 0
64
81

3

2.8 MATLAB Functions Form_B_N_detJ and Form_D
The following MATLAB functions are provided.
2.8.1 Form_B_N_detJ
A MATLAB function provided as Form_B_N_detJ.m can be implemented as:
[B,detJ,N,x,y] = Form_B_N_detJ(coord, s, t, type)
The function inputs (contained in the round brackets on the right hand side) are:
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 22 -
o coord =

(
(
(
x
1
y
1
x
2
y
2
.. ..
x
n
y
n
, where is a matrix containing the global coordinates of the
element nodes. The ordering of the nodes must match the numbering
conventions discussed in Section 2.2.
o s and t are the local element coordinates (with values between -1 and +1)
o type is a switch which is set equal to 0 for a plane strain element or 1 for an
axisymmetric element.
This function outputs variable contained in the square brackets on the left hand side,
which are:
o B the strain displacement operator,
o detJ is the determinate of the Jacobian matrix,
o N the matrix of shape functions (as defined by Equation (25)) and;
o x and y the global coordinates x and y for plane strain, or r, z for
axisymmetric.
2.8.2 Form_D
A MATLAB function provided as Form_D.m can be implement with the following:
[D] = Form_D(E,NU,dof)
The function inputs (contained in the round brackets on the right hand side) are:
o E The value of Youngs Modulus
o NU is the value of Poissons ratio
This function outputs is
o D The plane strain or axisymmetric constitutive matrix (defined in Equation
(35) )

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 23 -
2.8.3 Example of Numerical Integration
In this example, the stiffness matrix for the four nodded quadratic element shown in
Figure 9 will be integrated using 1, 4 and 9 point Gaussian integration in the
MATLAB command window, using the functions Form_B_N_detJ and Form_D,
discussed in Section 2.8.

20m
E= 10000kN/m
2
u = 0.3
20m
a) 1-Point
Integration
b) 4-Point
Integration
c) 9-Point
Integration

Figure 9: 4-noded element with a) 1-Point Integration; b) 4-Point Integration; and c) 9-Point
Integration

2.8.3.1 Example 1-Point Integration of a 4-Noded Plane Strain Element
The function Form_B_N_detJ requires 4 input variable to be defined. The variables
nnode and type are integers and can be assigned values by typing the variable
name, then = and then the required value next to the >> symbol and pressing
enter. i.e
>> nnode=4

nnode =

4
The variable and its assigned value are then displaced on the lines below. Repeating
again for type, which is set to zero as the element is plane strain.
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 24 -
>> type=0

type =

0
The variable coord is a matrix. MATLAB uses special delimiters to define the shape
of the matrix. Square brackets delimit the matrix, the semicolons delimit the rows, and
the commas delimit the values. The variable coord, for the element shown in Figure
9, can be created in the correct form in the MATLAB command window as follows:
>> coord=[0,0; 20,0; 20,20; 0,20]

coord =

0 0
20 0
20 20
0 20

For 1-point Gauss integration, the local coordinates s and t are both zero (Table 2).
Variables could be assigned for these, or number can be passed to the MATLAB
function directly as shown below. The function is called with the following statement,
and output variables B, N, detJ, x and y are displaced.
>> [B,N,detJ,x,y]=Form_B_N_detJ(coord,0,0,nnode,type)

B =

-0.025 0 0.025 0 0.025 0 -0.025 0
0 -0.025 0 -0.025 0 0.025 0 0.025
0 0 0 0 0 0 0 0
-0.025 -0.025 -0.025 0.025 0.025 0.025 0.025 -0.025


N =

0.25 0 0.25 0 0.25 0 0.25 0
0 0.25 0 0.25 0 0.25 0 0.25


detJ =

100


x =

10
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 25 -


y =

10



The matrix [D] must now be defined. This can be done using the function
Form_D.m. This requires the Youngs modulus and Poissons ratio to be defined:
>> E=10000

E =

10000

>> v=0.3

v =

0.3
A call the to Form_D.m is then executed as:
>> D=FormD(E,v,2)

D =

1.00E+04 *

1.3462 0.5769 0.5769 0
0.5769 1.3462 0.5769 0
0.5769 0.5769 1.3462 0
0 0 0 0.3846
The weight for single point Gauss integration is 4. With all other variable defined, the
stiffness matrix for the 4-noded element in Figure 9 can be integrated (following
equation (64)) with the following command (noting the MATLAB transpose operator
is '):
>> K=B'*D*B*detJ*4

K =

1.00E+03 *

4.3269 2.4038 -2.4038 0.4808 -4.3269 -2.4038 2.4038 -0.4808
2.4038 4.3269 -0.4808 2.4038 -2.4038 -4.3269 0.4808 -2.4038
-2.4038 -0.4808 4.3269 -2.4038 2.4038 0.4808 -4.3269 2.4038
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 26 -
0.4808 2.4038 -2.4038 4.3269 -0.4808 -2.4038 2.4038 -4.3269
-4.3269 -2.4038 2.4038 -0.4808 4.3269 2.4038 -2.4038 0.4808
-2.4038 -4.3269 0.4808 -2.4038 2.4038 4.3269 -0.4808 2.4038
2.4038 0.4808 -4.3269 2.4038 -2.4038 -0.4808 4.3269 -2.4038
-0.4808 -2.4038 2.4038 -4.3269 0.4808 2.4038 -2.4038 4.3269

2.8.3.2 Example 4-Point Integration of a 4-Noded Plane Strain Element
With the D and coord matrices, and scalars nnode and type already defined
above, the first step in performing 4-point Gauss integration is to set up a vectors of
the local Gauss point coordinates (s and t) corresponding to the Gauss point
coordinates in Table 2. This can be done as:
>> s=[-1/sqrt(3); -1/sqrt(3); 1/sqrt(3); 1/sqrt(3)]

s =

-0.5774
-0.5774
0.5774
0.5774

>> t=[-1/sqrt(3); 1/sqrt(3); -1/sqrt(3); 1/sqrt(3)]

t =

-0.5774
0.5774
-0.5774
0.5774
The function can then be evaluated at the first Gauss point as:
>> [B1,N1,detJ1,x1,y1]=Form_B_N_detJ(coord,s(1),t(1),nnode,type)

B1 =

-0.0394 0 0.0394 0 0.0106 0 -0.0106 0
0 -0.0394 0 -0.0106 0 0.0106 0 0.0394
0 0 0 0 0 0 0 0
-0.0394 -0.0394 -0.0106 0.0394 0.0106 0.0106 0.0394 -0.0106


N1 =

0.622 0 0.1667 0 0.0447 0 0.1667 0
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 27 -
0 0.622 0 0.1667 0 0.0447 0 0.1667


detJ1 =

100


x1 =

4.2265


y1 =

4.2265
This is repeated at the remaining 3 Gauss Points
>> [B2,N2,detJ2,x2,y2]=Form_B_N_detJ(coord,s(2),t(2),nnode,type)

B2 =

-0.0106 0 0.0106 0 0.0394 0 -0.0394 0
0 -0.0394 0 -0.0106 0 0.0106 0 0.0394
0 0 0 0 0 0 0 0
-0.0394 -0.0106 -0.0106 0.0106 0.0106 0.0394 0.0394 -0.0394


N2 =

0.1667 0 0.0447 0 0.1667 0 0.622 0
0 0.1667 0 0.0447 0 0.1667 0 0.622


detJ2 =

100


x2 =

4.2265


y2 =

15.7735

>> [B3,N3,detJ3,x3,y3]=Form_B_N_detJ(coord,s(3),t(3),nnode,type)

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 28 -
B3 =

-0.0394 0 0.0394 0 0.0106 0 -0.0106 0
0 -0.0106 0 -0.0394 0 0.0394 0 0.0106
0 0 0 0 0 0 0 0
-0.0106 -0.0394 -0.0394 0.0394 0.0394 0.0106 0.0106 -0.0106


N3 =

0.1667 0 0.622 0 0.1667 0 0.0447 0
0 0.1667 0 0.622 0 0.1667 0 0.0447


detJ3 =

100


x3 =

15.7735


y3 =

4.2265

>> [B4,N4,detJ4,x4,y4]=Form_B_N_detJ(coord,s(4),t(4),nnode,type)

B4 =

-0.0106 0 0.0106 0 0.0394 0 -0.0394 0
0 -0.0106 0 -0.0394 0 0.0394 0 0.0106
0 0 0 0 0 0 0 0
-0.0106 -0.0106 -0.0394 0.0106 0.0394 0.0394 0.0106 -0.0394


N4 =

0.0447 0 0.1667 0 0.622 0 0.1667 0
0 0.0447 0 0.1667 0 0.622 0 0.1667


detJ4 =

100


x4 =

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 29 -
15.7735


y4 =

15.7735
A vector of integration weights can also be set up for 4-point integration as:
>> weights=[1; 1; 1; 1]

weights =

1
1
1
1
The stiffness matrix can now be integrated as:
>>
K=B1'*D*B1*detJ1*weights(1)+B2'*D*B2*detJ2*weights(2)
+B3'*D*B3*detJ3*weights(3)+B4'*D*B4*detJ4*weights(4)

K =

1.00E+03 *

5.7692 2.4038 -3.8462 0.4808 -2.8846 -2.4038 0.9615 -0.4808
2.4038 5.7692 -0.4808 0.9615 -2.4038 -2.8846 0.4808 -3.8462
-3.8462 -0.4808 5.7692 -2.4038 0.9615 0.4808 -2.8846 2.4038
0.4808 0.9615 -2.4038 5.7692 -0.4808 -3.8462 2.4038 -2.8846
-2.8846 -2.4038 0.9615 -0.4808 5.7692 2.4038 -3.8462 0.4808
-2.4038 -2.8846 0.4808 -3.8462 2.4038 5.7692 -0.4808 0.9615
0.9615 0.4808 -2.8846 2.4038 -3.8462 -0.4808 5.7692 -2.4038
-0.4808 -3.8462 2.4038 -2.8846 0.4808 0.9615 -2.4038 5.7692

It can be seen that the stiffness matrix using 4-point integration is different to that
evaluated using single point integration. This indicates that single point integration is
not sufficiently accurate for a 4-noded element.
2.8.3.3 Example 9-Point Integration of a 4-Noded Plane Strain Element
Using 9-point Gauss integrations, vectors containing the local coordinates and weight
values (from Table 2) must be defined as:
>> s=[-sqrt(3/5); -sqrt(3/5); sqrt(3/5); sqrt(3/5);sqrt(3/5); -sqrt(3/5); 0; 0; 0]

s =
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 30 -

-0.7746
-0.7746
0.7746
0.7746
0.7746
-0.7746
0
0
0

>> t=[-sqrt(3/5); sqrt(3/5); -sqrt(3/5); sqrt(3/5); 0; 0; sqrt(3/5); -sqrt(3/5); 0]

t =

-0.7746
0.7746
-0.7746
0.7746
0
0
0.7746
-0.7746
0

>> weights9=[25/81; 25/81; 25/81; 25/81; 40/81; 40/81; 40/81; 40/81; 64/81]

weights9 =

0.3086
0.3086
0.3086
0.3086
0.4938
0.4938
0.4938
0.4938
0.7901
Given the significant effort required to manually call the function 9 times a MATLAB
for loop will be used. To perform integration in a loop, the stiffness matrix must be
initially set to zero. This can be done using the following command:
>> K=zeros(8,8)

K =

0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 31 -
0 0 0 0 0 0 0 0
As shown above, this give an 8 by 8 matrix of zeros. The MATLAB syntax for a for
loop is:
>> for i=1:9
[B,N,detJ,x,y]=Form_B_N_detJ(coord,s(i),t(i),nnode,type);
K=K+B'*D*B*detJ*weights(i);
end
The semicolon at the end of each line suppresses the MATLAB output. Having
entered return after typing the above, MATLAB performs the calculation over the
loop 9 times. The resulting stiffness matrix can be displaced by typing the variable
name (and pressing enter).
>> K

K =

1.00E+03 *

5.7692 2.4038 -3.8462 0.4808 -2.8846 -2.4038 0.9615 -0.4808
2.4038 5.7692 -0.4808 0.9615 -2.4038 -2.8846 0.4808 -3.8462
-3.8462 -0.4808 5.7692 -2.4038 0.9615 0.4808 -2.8846 2.4038
0.4808 0.9615 -2.4038 5.7692 -0.4808 -3.8462 2.4038 -2.8846
-2.8846 -2.4038 0.9615 -0.4808 5.7692 2.4038 -3.8462 0.4808
-2.4038 -2.8846 0.4808 -3.8462 2.4038 5.7692 -0.4808 0.9615
0.9615 0.4808 -2.8846 2.4038 -3.8462 -0.4808 5.7692 -2.4038
-0.4808 -3.8462 2.4038 -2.8846 0.4808 0.9615 -2.4038 5.7692
It can be seen that the stiffness matrix from the 4-point and 9-poiunt Gauss integration
are the same. This indicated that the accuracy of the integration scheme converged to
the exact solution using 4-points. Therefore, 4-point Gauss integration is sufficient for
a 4-noded linear elastic continuum element.




CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 32 -
2.9 Boundary Conditions
A stiffness matrix for a finite element has now been formed based on equilibrium,
compatibility and constitutive behaviour. The fourth and final solution requirement is
application of boundary conditions. This is discussed below.
2.9.1 Prescribed Displacements
Prescribed displacements are not only used to model the application of load in a finite
element analysis, but they must also be used to constrain the model to prevent it from
undergoing rigid body rotations or translations. The 4-noded element shown in Figure
10 has pin and roller support. The pin restrains the node from displacing in both the
horizontal (x) and vertical (y) directions, while the roller prevents displacements in the
vertical direction. These restrains are the minimum required to prevent the element
from displacing or rotating as a rigid body. For example, if the roller support was
removed, the element could rotate as a rigid body about the pin. If the pin support was
changed to a roller support, then the element could translate as a rigid body in the x-
direction.

20m
20m
E = 10,00kPa
u = 0.3
Pin
restraint
Roller
restraint
Prescribed
displacement of
1m

Figure 10: 4-noded element subject to prescribed displacement
In order to apply the boundary conditions above, the finite element equation must be
partition into prescribed and free and interacting degrees of freedom, as:
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 33 -

)
`

{f
f
}
{f
p
}
=

(
(
[K
f
] [K
fp
]
[K
fp
]
T
[ K
p
]

)
`

{u
f
}
{u
p
}
...............................................................................(65)
Where {u
f
} is a vector containing the unknown free displacements, {u
p
} contains the
known prescribed displacements. Nodal forces at the free degrees of freedom{f
f
} are
known, as they are equal to the applied values in a given boundary value problem, or
they are zero if no forces are applied. At the restrained degrees of freedom, nodal
forces {f
p
} are unknown. [K
f
] is the component of the stiffness matrix containing only
free degrees of freedom, [K
p
] contains only the prescribed degrees of freedom, while
[K
fp
] contains the off diagonal terms that interact between free and prescribed degrees
of freedom. To solve, this system of equations can be split into two sperate systems.
Firstly
{f
f
}= [K
f
]{u
f
} + [K
fp
]{u
p
}......................................................................................................................... (66)
This can be rearranged, making the unknown free displacements the subject of the
formula
{u
f
} = [K
f
]
-1
{{f
f
}-[K
fp
]{u
p
}}..................................................................................................................... (67)
This equation can be solved to give the nodal displacements at the freed degrees of
freedom. With all displacement found, the unknown forces at the prescribed degrees
of freedom can then be found from:
{f
p
}= [K
fp
]
T
{u
f
} + [K
p
]{u
p
}...................................................................................................................... (68)
The stiffness matrix for the element in Figure 10 is the same as that integrated in
Section 2.8.3. Therefore the first step in solving the boundary value problem is to
partition the stiffness matrix into components (discussed above). Figure 11 shows the
free and prescribed degrees of freedom. The stiffness matrix for the element is shown
below, with shaded areas identifying which components of the matrix belong to the
free, prescribed and interacting degrees of freedom.
>> K
Free
K = Prescribed
Interacting
1.00E+03 *

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 34 -
5.7692 2.4038 -3.8462 0.4808 -2.8846 -2.4038 0.9615 -0.4808
2.4038 5.7692 -0.4808 0.9615 -2.4038 -2.8846 0.4808 -3.8462
-3.8462 -0.4808 5.7692 -2.4038 0.9615 0.4808 -2.8846 2.4038
0.4808 0.9615 -2.4038 5.7692 -0.4808 -3.8462 2.4038 -2.8846
-2.8846 -2.4038 0.9615 -0.4808 5.7692 2.4038 -3.8462 0.4808
-2.4038 -2.8846 0.4808 -3.8462 2.4038 5.7692 -0.4808 0.9615
0.9615 0.4808 -2.8846 2.4038 -3.8462 -0.4808 5.7692 -2.4038
-0.4808 -3.8462 2.4038 -2.8846 0.4808 0.9615 -2.4038 5.7692

1 2
3 4
5
6
1
7
2 4
3
8

Prescribed

Free

Figure 11: Restrained and free degrees of freedom
A techniques is therefore needed to extract the relevant components of the above
stiffness matrix. MATLAB offers a very useful method for indexing matrices, known
as logical indexing which can do this with minimal programming effort. Logical
indexing uses logical indices, which are logical variable the same size as the variable
being accessed. To create a logical index, we must first create a vector that identify
which degrees of freedom are free and which are prescribed. This is done below using
a vector called steer (so called as it is used to steer components of the element
stiffness matrix into the partitioned matrices). The vector steer is of length equal to
the number of degrees of freedom for the boundary value problem (for this example
that is 8). The first position in the vector corresponds to the first degree of freedom,
and the second position to the second degree of freedom, and so on. Values in these
position are set equal to 1 if they are free or 0 if the are fixed, as shown below.
>> steer=[1; 0; 0; 0; 1; 1; 1; 0]

steer =

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 35 -
1
0
0
0
1
1
1
0
Logical indexing vector, free, that can point MATLAB to the free degrees of
freedom can now be created with the following syntax.
>> free=(steer>0)

free =

1
0
0
0
1
1
1
0


free is the same size as steer, with 1s in the location where the elements of steer
are greater than 0, and logical 0s everywhere else. In fact, free looks identical to
steer, however it can be used in ways that steer cannot. This is because free is
a logical variable (it will have a different symbol in the MATLAB workspace). It can
be used to point MATLAB to the free degrees of freedom in K using the following
syntax.
>> kf=K(free,free)

kf =

1.00E+03 *

5.7692 -2.8846 -2.4038 0.9615
-2.8846 5.7692 2.4038 -3.8462
-2.4038 2.4038 5.7692 -0.4808
0.9615 -3.8462 -0.4808 5.7692

It can be seen that the new variable kf is a matrix equal to the free component of the
overall stiffness matrix shaded above. A logical indexing vector for the prescribed
degrees of freedom pres can be created in a similar manner.
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 36 -
>> pres=(steer==0)

pres =

0
1
1
1
0
0
0
1
Now the prescribed and interacting degrees of freedom can be extracted as:
>> kp=K(pres,pres)

kp =

1.00E+03 *

5.7692 -0.4808 0.9615 -3.8462
-0.4808 5.7692 -2.4038 2.4038
0.9615 -2.4038 5.7692 -2.8846
-3.8462 2.4038 -2.8846 5.7692

>> kfp=K(free,pres)

kfp =

1.00E+03 *

2.4038 -3.8462 0.4808 -0.4808
-2.4038 0.9615 -0.4808 0.4808
-2.8846 0.4808 -3.8462 0.9615
0.4808 -2.8846 2.4038 -2.4038
Vectors of prescribed displacements up and nodal forces at free degrees of freedom
ff can be set up as:
>> up=[0; 0; 0; -1]

up =

0
0
0
-1

>> ff=[0;0;0;0]

ff =

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 37 -
0
0
0
0

All terms on the right hand side of equation (67) have now been defined. The
displacements at the free degrees of freedom, uf , can be computed as:
>> uf=kf\(ff-kfp*up)

uf =

-0.1475
-0.6557
0.3115
-0.8033
The above uses the MATLAB backslash operator (\) to solve the system of linear
equations (which does not involve finding the inverse of kf). The nodal reaction
forces, fp, at the prescribed degrees of freedom can be found as:
>> fp=kfp'*uf+kp*up

fp =

1.00E+03 *

3.7831
0
0
-3.7831
It can be seen that the force required to cause a displacement of 1m (-1m) at degree of
freedom 8 is -3.7831kN. This is reacted by the fore at degree of freedom 2, which is
equal and opposite. Therefore, external vertical equilibrium is satisfied. As there are
no horizontal forces, equilibrium is also satisfied in the horizontal direction. It can
also be easily shown that moment equilibrium is satisfied.
2.9.2 Point Loads
Point loads can be applied at free nodes only. They are simply decomposed into
components acting in the x- and y-coordinate directions (or r and z for axisymmetric)
and assembled into the appropriate components of the system and assembled into the
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 38 -
{f
f
} vector (or in ff in MATLAB notation). As an example, Figure12 shows a force
of 3.7831kN is applied in the downward direction at node 4 (i.e. degree of freedom 8)

20m
20m
E = 10,00kPa
u = 0.3
Pin
restraint
Roller
restraint
Applied Point
load 3.7831kN

Figure 12: 4-noded element subject to point load
Compared with the previous example, the vector steer is changed to reflect the fact
that the 8
th
degree of freedom is free (therefore a 1 is entered into the 8
th
row of steer).
>> steer=[1; 0; 0; 0; 1; 1; 1; 1]

steer =

1
0
0
0
1
1
1
1

Logical indexing vectors are formed in the usual way.
>> free=(steer>0)

free =

1
0
0
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 39 -
0
1
1
1
1

>> pres=(steer==0)

pres =

0
1
1
1
0
0
0
0
The matrix partitioned as:
>> kf=K(free,free)

kf =

1.00E+03 *

5.7692 -2.8846 -2.4038 0.9615 -0.4808
-2.8846 5.7692 2.4038 -3.8462 0.4808
-2.4038 2.4038 5.7692 -0.4808 0.9615
0.9615 -3.8462 -0.4808 5.7692 -2.4038
-0.4808 0.4808 0.9615 -2.4038 5.7692

>> kp=K(pres,pres)

kp =

1.00E+03 *

5.7692 -0.4808 0.9615
-0.4808 5.7692 -2.4038
0.9615 -2.4038 5.7692

>> kfp=K(free,pres)

kfp =

1.00E+03 *

2.4038 -3.8462 0.4808
-2.4038 0.9615 -0.4808
-2.8846 0.4808 -3.8462
0.4808 -2.8846 2.4038
-3.8462 2.4038 -2.8846
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 40 -
The vector containing nodal loads at free degrees of freedom ff now includes a
non-zero value, whereas the prescribed displacement vector up contains all zeros.
>> ff=[0; 0; 0; 0; -3.7831]

ff =

0
0
0
0
-3.7831

>> up=[0; 0; 0]

up =

0
0
0
The unknown displacements uf and nodal reactions up are then found as:
>> uf=kf\(ff-kfp*up)

uf =

1.00E-03 *

-0.1475
-0.6557
0.3115
-0.8033
-1

>> fp=kfp'*uf+kp*up

fp =

3.7831
0
0
It can be seen that applying a force of -3.7831kN at degree of freedom 8 caused a
displacement of -1m. This is expected, since in the previous example a prescribed
displacement of -1m generated a force of -3.7831kN.


CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 41 -
2.9.3 Distributed Loads
There are many instances in geotechnical analysis where a loads may be more
realistically modelled as distributed pressures over an area. For example, water
pressures acting on a excavation face, or pressure from a bulk liquid storage tank (oil
tank) with a flexible base. In the finite element method, information into and out of
the model must be conveyed via the nodes. Therefore, a distributed load, as shown
Figure 13, must be converted in to equivalent nodal forces. The nodal forces are
evaluated by equating the work done by the nodal forces with the work done by the
distributed load. This is easiest to illustrate with a with a line element subject to a
distributed vertical load shown in Figure 14. The results obtained from considering
the line element below can be applied to a two-dimensional element (this is because
the local coordinate only varies in one-dimension along the edge of the element).

x
L
w (x) kPa
dF
v1

=
L/2
dF
v2
dF
v3


Figure 13: Distributed loads
The shape functions for each node can be easily derived based on the condition that
N
i
(x) has unit value at the ith node and a value of zero at other nodes. This gives:
N
1
(x)= 2/L
2
(x - L)(x - L/2)........................................................................................................................ (69)
N
2
(x)= -4/ L
2
(x - L)x................................................................................................................................ (70)
N
3
(x)= 2/L
2
(x - L/2)x................................................................................................................................ (71)
The equivalent nodal force at Node-1, dF
v1
, can be evaluated by assuming this node
undergoes a displacement dv
1
due to the load. The work done by the nodal forces (W
n
)
is then
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 42 -
W
n
= dF
v1
dv
1
....................................................................................................................................... (72)
The displacement at any point along the element dv(x) due is then given by
dv(x) = N
1
(x) dv
1
..................................................................................................................................... (73)
The work done by the distributed load W
w
is then
W
w
=
]
(
0
L
w(x) N
1
(x) dv
1
dx .................................................................................................................. (74)
Equating the work done by the nodal force and the distributed load gives
dF
v1
=

]
(
0
L
w(x) N
1
(x) dx............................................................................................................................. (75)
A similar relationship can be obtained for the other nodes. For example, considering
the linearly increasing load shown Figure 14, the distributed load can be written as a
function of x as: w(x) = ax. The equivalent load at Node-1 can be obtained from

x
L
dF
v1

=
L/2
dF
v2
dF
v3

aL (kN/m)

Figure 14: Example of a distributed load
dF
v1
=

]
(
0
L
ax (2/L
2
(x - L)(x - L/2))dx ......................................................................................................... (76)
Evaluating this integral gives dF
v1
= 0. The load at the second nodes can found from
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 43 -
dF
v2
=

]
(
0
L
ax (-4/ L
2
(x - L)x)dx ................................................................................................................. (77)
Evaluating this integral gives dF
v2
= aL
2
/3. The load at the third node can found from
dF
v3
=

]
(
0
L
ax (2/L
2
(x - L/2)x)dx ................................................................................................................. (78)
Evaluating this integral gives dF
v3
= aL
2
/6.
2.9.4 Initial Stress and Self-Weight
For the majority of geotechnical problems, it is important to account for the initial
stress state of the soil. It is therefore important to evaluate the initial stress at Gauss
points. Indeed, gravity loads, or self-weight loads, are one of the major components of
loading in geotechnical analysis problems. Self-weight can be accounted for in one of
two ways, depending on the nature of the problem. For problems involving only
horizontal soil layers (i.e one-dimensional geometry) the initial stresses at the Gauss
points can be simply established by calculating the depth below the surface to the
Gauss point and multiplying by the unit weight of the soil. For example, Figure 15
shows a 4-noded element used to model a 20m deep soil deposit with a unit weight g
= 20kN/m3 and a Poissons ratio m = 0.3 and a Youngs modulus E = 10MPa. The
vertical stress at Gauss points 1 and 3 can be simply calculated as
y
= gy
1
. The
horizontal stresses, can then be found by using an assumed value of K0, which is the
ratio of the horizontal to vertical effective stress .ie
z
=
x
= K0*
y
. K0 is a
geotechnical parameter and one of the more difficult parameters to determine
accurately. (Note, to date we have not distinguished between total and effective stress.
This will be done later in the unit.)
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 44 -

20m
g = 20kN/m
3
u = 0.3
E = 10MPa
4.23
15.77
1
2
3
4

Figure 15: 20m deep soil deposit modelled with single 4-noded element
For problems that involve inclined surface, or inclined layers of different unit weight,
(i.e where the geometry is not one-dimensional) this method in no longer valid. A
self-weight load step must be conducted. This involves calculating the self-weight
stresses as equivalent nodal loads {F
g
}. These equivalent nodal loads are then applied
to the elements in the finite element mesh to generate nodal displacements. From
these displacements, strains and hence stresses can be calculated at Gauss points.
The equivalent nodal loads are calculated by integrating the following:
{F
g
} =
]
(
vol
[N(s,t)]
T
{g}dV....................................................................................................................... (79)
where {g} is a vector of length equal to the number of dimensions in the problem (i.e
2 for plane stain and axisymmetric, and 3 for three-dimensional). For gravity acting
purely in the y-direction {g} is given by
{g} =

)
`
0
-g
........................................................................................................................................... (80)
where g is the unit weight of the material (in kN/m
3
).
2.9.4.1 Example: Self-weight loading for 4-Noded
The function Form_B_N_detJ can be used to integrated equation (79) to form the self-
weight body load vector {F
g
} for the 4-noded element shown in Figure 15. Assuming
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 45 -
coord, s and t, nnode and type have been defined, the next step is to define
the unit weight vector, Fw.
>> gamma=[0;-20]

gamma =

0
-20
Next, establish a vector of zeros for Fg so integration can take place in a for loop.
>> Fg=zeros(8,1)

Fg =

0
0
0
0
0
0
0
0
The syntax for the integration loop is as follows
>> for i=1:4
[B,N,detJ,x,z] = Form_B_N_detJ(coord,s(i),t(i),nnode,type);
Fg=Fg+N'*gamma*detJ*weights(i);
end
And the resulting self-weight body vector is
>> Fg

Fg =

1.00E+03 *

0
-2
0
-2
0
-2
0
-2
The loads from Fg are shown in Figure 16.
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 46 -

20m
4.23
15.77
2000kN 2000kN
2000kN
2000kN
1
2

Figure 16: Self-weight body load vector acting on 4-noded element
This equivalent nodal forces must then be applied to the element in a self-weight
load step. To perform the self-weight load step, establish the vector steer identify
free and prescribed degrees of freedom.
>> steer=[0;0;0;0;0;1;0;1]

steer =

0
0
0
0
0
1
0
1
This is used to form logical steering vectors free and pres
>> free=(steer>0)

free =

0
0
0
0
0
1
0
1

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 47 -
>> pres=(steer==0)

pres =

1
1
1
1
1
0
1
0
Which can then be used to partition the stiffness matrix K (which for this element
was formed in Section 2.8.3).
>> kf=K(free,free)

kf =

1.00E+03 *

5.7692 0.9615
0.9615 5.7692

>> kp=K(pres,pres)

kp =

1.00E+03 *

5.7692 2.4038 -3.8462 0.4808 -2.8846 0.9615
2.4038 5.7692 -0.4808 0.9615 -2.4038 0.4808
-3.8462 -0.4808 5.7692 -2.4038 0.9615 -2.8846
0.4808 0.9615 -2.4038 5.7692 -0.4808 2.4038
-2.8846 -2.4038 0.9615 -0.4808 5.7692 -3.8462
0.9615 0.4808 -2.8846 2.4038 -3.8462 5.7692

>> kfp=K(free,pres)

kfp =

1.00E+03 *

-2.4038 -2.8846 0.4808 -3.8462 2.4038 -0.4808
-0.4808 -3.8462 2.4038 -2.8846 0.4808 -2.4038
The nodal loads at the free degrees of freedom ff can be obtained from Fg using
the logical steering vector free.
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 48 -
>> ff=Fg(free)

ff =

1.00E+03 *

-2
-2
All prescribed displacements are zero, hence
>> up=zeros(6,1)

up =

0
0
0
0
0
0
Can now solve for the free displacements uf
>> uf=kf\(ff-kfp*up)

uf =

-0.2971
-0.2971

Now displacements have been computed, the strains and stresses at each of the Gauss
points can be evaluated. First establish a displacement vector for the element.
>> U=zeros(8,1)

U =

0
0
0
0
0
0
0
0
Then use free to steer the uf into the appropriate parts of U
>> U(free)=uf

U =
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 49 -

0
0
0
0
0
-0.2971
0
-0.2971

Evaluate the B matrix at the 1
st
Gauss point, and use this to compute the strains
eps.
>> [B,N,detJ,x,z] = Form_B_N_detJ(coord,s(1),t(1),nnode,type);
>> eps=B*U

eps =

0
-0.0149
0
0
The strains can then be used to compute the stresses sigma
>> sigma=D*eps

sigma =

-85.7152
-200.0021
-85.7152
0

This process can be repeated at the second Gauss point.
>> [B,N,detJ,x,z] = Form_B_N_detJ(coord,s(2),t(2),nnode,type);
>> eps=B*U

eps =

0
-0.0149
0
0
Calculating the stress
>> sigma=D*eps

sigma =
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 50 -

-85.7152
-200.0021
-85.7152
0
It can bee seen that the strains are the same at both Gauss points, which results in the
same stress at both Gauss points. The computed vertical stress is approximately -
200kPa. The actual vertical stress (
y
) expected at Gauss point 1 is equal to the depth
to the Gauss point (15.77m) multiplied by the unit weight (20kN/m
3
), which gives
315.4kPa, while the vertical stress at Gauss point 2 would be 84.6kPa. Clearly, the 4-
noded element is not able to model the correct stress variation over the depth.
2.9.4.2 Example: Self-weight loading for 8-Noded
The above example is now repeated for the 8-noded element shown in Figure 17.

20m
20m
20m
g = 20kN/m
3
u = 0.3
E = 10MPa

Figure 17: Self-weight body load vector acting on 4-noded element
The nodal coordinates for this element are
>> coord=[0,0; 20,0; 20,20; 0,20; 10,0; 20,10; 10,20; 0,10]

coord =

0 0
20 0
20 20
0 20
10 0
20 10
10 20
0 10
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 51 -
The stiffness matrix for this element has not yet been computed. However, this can be
done in the same for loop used to integrated the self-weight body load vector. To
begin, appropriate sized vector and matrix are created.
>> Fg=zeros(16,1);
>> K=zeros(16,16);
The integration loop is then
>> for i=1:4;
[B,N,detJ,x,z] = Form_B_N_detJ(coord,s(i),t(i),8,type);
Fg=Fg+N'*gamma*detJ*weights(i);
K=K+B'*D*B*detJ*weights(i);
end
The stiffness matrix for the element is
K =

1.00E+04 *

Columns 1 through 9

0.9615 0.4541 0.5128 -0.016 0.4808 0.187 0.3526 0.016 -1.1538
0.4541 0.9615 0.016 0.3526 0.187 0.4808 -0.016 0.5128 -0.2778
0.5128 0.016 0.9615 -0.4541 0.3526 -0.016 0.4808 -0.187 -1.1538
-0.016 0.3526 -0.4541 0.9615 0.016 0.5128 -0.187 0.4808 0.2778
0.4808 0.187 0.3526 0.016 0.9615 0.4541 0.5128 -0.016 -0.641
0.187 0.4808 -0.016 0.5128 0.4541 0.9615 0.016 0.3526 -0.1068
0.3526 -0.016 0.4808 -0.187 0.5128 0.016 0.9615 -0.4541 -0.641
0.016 0.5128 -0.187 0.4808 -0.016 0.3526 -0.4541 0.9615 0.1068
-1.1538 -0.2778 -1.1538 0.2778 -0.641 -0.1068 -0.641 0.1068 2.5641
-0.1496 -0.1923 0.1496 -0.1923 -0.1068 -0.3205 0.1068 -0.3205 0
-0.3205 -0.1068 -0.1923 0.1496 -0.1923 -0.1496 -0.3205 0.1068 0
-0.1068 -0.641 0.2778 -1.1538 -0.2778 -1.1538 0.1068 -0.641 -0.4274
-0.641 -0.1068 -0.641 0.1068 -1.1538 -0.2778 -1.1538 0.2778 1.0256
-0.1068 -0.3205 0.1068 -0.3205 -0.1496 -0.1923 0.1496 -0.1923 0
-0.1923 -0.1496 -0.3205 0.1068 -0.3205 -0.1068 -0.1923 0.1496 0
-0.2778 -1.1538 0.1068 -0.641 -0.1068 -0.641 0.2778 -1.1538 0.4274

Columns 10 through 16

-0.1496 -0.3205 -0.1068 -0.641 -0.1068 -0.1923 -0.2778
-0.1923 -0.1068 -0.641 -0.1068 -0.3205 -0.1496 -1.1538
0.1496 -0.1923 0.2778 -0.641 0.1068 -0.3205 0.1068
-0.1923 0.1496 -1.1538 0.1068 -0.3205 0.1068 -0.641
-0.1068 -0.1923 -0.2778 -1.1538 -0.1496 -0.3205 -0.1068
-0.3205 -0.1496 -1.1538 -0.2778 -0.1923 -0.1068 -0.641
0.1068 -0.3205 0.1068 -1.1538 0.1496 -0.1923 0.2778
-0.3205 0.1068 -0.641 0.2778 -0.1923 0.1496 -1.1538
0 0 -0.4274 1.0256 0 0 0.4274
1.2821 -0.4274 0 0 -0.2564 0.4274 0
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 52 -
-0.4274 1.2821 0 0 0.4274 -0.2564 0
0 0 2.5641 0.4274 0 0 1.0256
0 0 0.4274 2.5641 0 0 -0.4274
-0.2564 0.4274 0 0 1.2821 -0.4274 0
0.4274 -0.2564 0 0 -0.4274 1.2821 0
0 0 1.0256 -0.4274 0 0 2.5641
And the resulting self-weight body load vector is
>> Fg

Fg =

1.00E+03

0
0.6667
0
0.6667
0
0.6667
0
0.6667
0
-2.6667
0
-2.6667
0
-2.6667
0
-2.6667
These loads are illustrated in Figure 18.

666.67kN 666.67kN
666.67kN 666.67kN
-2666.67kN -2666.67kN
-2666.67kN
-2666.67kN

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 53 -
Figure 18: Self-weight body load vector acting on 4-noded element
These loads can be applied to the element by first forming
>> steer=[0;0;0;0;0;1;0;1;0;0;0;1;1;1;0;1]

steer =

0
0
0
0
0
1
0
1
0
0
0
1
1
1
0
1
Then the logical steering vectors
>> free=(steer>0)

free =

0
0
0
0
0
1
0
1
0
0
0
1
1
1
0
1

>> pres=(steer==0)

pres =
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 54 -

1
1
1
1
1
0
1
0
1
1
1
0
0
0
1
0
Then partitioning the stiffness matrix.
>> kf=K(free,free)

kf =

1.00E+04 *

0.9615 0.3526 -1.1538 -0.2778 -0.1923 -0.641
0.3526 0.9615 -0.641 0.2778 -0.1923 -1.1538
-1.1538 -0.641 2.5641 0.4274 0 1.0256
-0.2778 0.2778 0.4274 2.5641 0 -0.4274
-0.1923 -0.1923 0 0 1.2821 0
-0.641 -1.1538 1.0256 -0.4274 0 2.5641

>> kp=K(pres,pres)

kp =

1.00E+04 *

0.9615 0.4541 0.5128 -0.016 0.4808 0.3526 -1.1538 -0.1496 -0.3205 -0.1923
0.4541 0.9615 0.016 0.3526 0.187 -0.016 -0.2778 -0.1923 -0.1068 -0.1496
0.5128 0.016 0.9615 -0.4541 0.3526 0.4808 -1.1538 0.1496 -0.1923 -0.3205
-0.016 0.3526 -0.4541 0.9615 0.016 -0.187 0.2778 -0.1923 0.1496 0.1068
0.4808 0.187 0.3526 0.016 0.9615 0.5128 -0.641 -0.1068 -0.1923 -0.3205
0.3526 -0.016 0.4808 -0.187 0.5128 0.9615 -0.641 0.1068 -0.3205 -0.1923
-1.1538 -0.2778 -1.1538 0.2778 -0.641 -0.641 2.5641 0 0 0
-0.1496 -0.1923 0.1496 -0.1923 -0.1068 0.1068 0 1.2821 -0.4274 0.4274
-0.3205 -0.1068 -0.1923 0.1496 -0.1923 -0.3205 0 -0.4274 1.2821 -0.2564
-0.1923 -0.1496 -0.3205 0.1068 -0.3205 -0.1923 0 0.4274 -0.2564 1.2821

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 55 -
>> kfp=K(free,pres)

kfp =

1.00E+04 *

0.187 0.4808 -0.016 0.5128 0.4541 0.016 -0.1068 -0.3205 -0.1496 -0.1068
0.016 0.5128 -0.187 0.4808 -0.016 -0.4541 0.1068 -0.3205 0.1068 0.1496
-0.1068 -0.641 0.2778 -1.1538 -0.2778 0.1068 -0.4274 0 0 0
-0.641 -0.1068 -0.641 0.1068 -1.1538 -1.1538 1.0256 0 0 0
-0.1068 -0.3205 0.1068 -0.3205 -0.1496 0.1496 0 -0.2564 0.4274 -0.4274
-0.2778 -1.1538 0.1068 -0.641 -0.1068 0.2778 0.4274 0 0 0
Then forming the prescribed displacement vector
>> up=zeros(10,1)

up =

0
0
0
0
0
0
0
0
0
0

>> ff=Fg(free)

ff =

1.00E+03 *

0.6667
0.6667
-2.6667
0
-2.6667
-2.6667
And then solving for the free displacements
>> uf=kf\ff

uf =

-0.2971
-0.2971
-0.2229
0
-0.2971
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 56 -
-0.2229
Now from the element displacement vector
>> U=zeros(16,1)

U =

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
And assemble uf into the appropriate parts
>> U(free)=uf

U =

0
0
0
0
0
-0.2971
0
-0.2971
0
0
0
-0.2229
0
-0.2971
0
-0.2229
The strain at Gauss point 1 is given by
>> [B,N,detJ,x,z] = Form_B_N_detJ(coord,s(1),t(1),8,type);
>> eps=B*U

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 57 -
eps =

0
-0.0234
0
0
which can then be used to compute the stress.
>> sigma=D*eps

sigma =

-135.2015
-315.4701
-135.2015
0
Repeating this at the second Gauss points gives the following strains
>> [B,N,detJ,x,z] = Form_B_N_detJ(coord,s(2),t(2),8,type);
>> eps=B*U

eps =

0
-0.0063
0
0
And the following stress
>> sigma=D*eps

sigma =

-36.2271
-84.5299
-36.2271
0
The 8-noded element is able to model a linear increase in stress with depth. Therefore,
it is able to match the expect stress at the Gauss points. While the stress matches the
expected stress profile, it can be seen that the stresses on horizontal planes are not
necessarily in equilibrium with the applied nodal forces. For example, on a plane cut
through Gauss points 1 and 4, the vertical stress is -84.5299kPa. The total force on a
plane (of unit width) is 20 84.5299 = 1690.6kN, while the external vertical force is
2666.7-666.67-666.67 = 1333.3kN. This is a further demonstration that the finite
element method satisfies equilibrium in an approximate sense only.
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 58 -
2.9.4.3 K0 for self-weight loading
The coefficient of at rest earth pressure for self-weight loading is a function of the soil
model used. More specifically, it is a function of the terms in the [D] matrix. For one-
dimensional self weight load step it can been that the only non-zero strain is
y
, (the
strain in the vertical direction). From equation (21), the vertical stress is given by

y
=
E
(1+)(1-2)
(1-)
y
, ...................................................................................................................... (81)
and horizontal stresses are given

x
=
z
=
E
(1+)(1-2)
()
y
, ................................................................................................................. (82)
(as all other strains are zero). The ratio of horizontal to vertical stress, which is the K0
parameter, is therefore
K0 =

y


=

(1-)
...................................................................................................................................... (83)
This implies that the K0 in self-weight step, when using a linear elastic material is a
function of the Poissons ratio.
2.9.4.4 Self-weight displacements
If the purpose of the self-weight load step is to establish the initial stress of a mass of
existing soil, the resulting displacements are usually of little practical significance (i.e
the displacements are normally zeroed for subsequent loads steps). However, for
problems where soil is added to the model, such as when simulating the construction
of an embankment, displacements may be of considerable practical consequence. It is
interesting to note that both the 4-noded and 8-noded elements gave the same vertical
displacement at the top nodes (i.e. -0.2971m). The analytical displacement profile
(v(d)) for the self-weight loading of soil can be easily derived, given the vertical stress
profile is
y
(y) = -20d, where d is the depth below the ground surface. The vertical
strain profile (
y
(d)) is
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 59 -

y
(d) =

y
(d)
E
0
=
-20d
E
0
................................................................................................................................ (84)
where E
0
, where is the constrained modulus and is related to Youngs modulus by:
E
0
= E
(1-u)
(1+u)(1-2u)
= 10000
(0.3)
(1.3)(0.6)
= 13461.538........................................................................ (85)
(note that as the element is prevented from displacing laterally, the relationship
between vertical stress and vertical strain is given by the constrained modulus E
0
, not
Youngs modulus). The displacement profile can be obtained by integrating the
equation (84), which gives
v(d) =
-10d
2
E
0
+ C..................................................................................................................................... (86)
where C is an integration constant. A boundary condition is supplied by noting that
the vertical displacement at depth of 20m is zero (i.e v(20) = 0). Hence the integration
constant can be found:
v(20) = 0 =
-10(20
2
)
E
0
+ C......................................................................................................................... (87)
which gives C = 0.2971. Substituting d = 0 and C = 0.2971 into equation (86) gives
the displacement at the ground surface of v(0) = 0.2971. Therefore, both the 4-noded
and 8-noded element are able to match the vertical displacement at the ground surface
exactly despite 4-noded element not modelling the correct stress profile and despite
the 8-noded element not producing equilibrium between the external loads and the
internal stresses. The displacement profile with depth is plotted in Figure 19.

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 60 -
0
2
4
6
8
10
12
14
16
18
20
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35
Vertical Displacement (m)
D
e
p
t
h

(
m
)
Analtical Displacement Profile

Figure 19: Self-weight displacement profile


CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 61 -
2.10 Manual Assembly and Solution of Global Stiffness Matrix
and Loading Vector for Multiple Elements
It was stated in Section 2.1 that an analysis will only be accurate if the
displacement/deformation over the element accurately matches how the soil (or
indeed any material) wants to deform in boundary value problem. To date, we have
only consider applying loads to single elements. Therefore, the displacement fields for
entire problems were limited to matching a linear combination of the shape functions
defined by the element (i.e equation (24)). In order to provide more realistic solutions,
many elements must be used in the analysis. Displacement fields are then a linear
combination of many more shape functions. To illustrate how multiple continuum
elements can be used in an analysis, consider the cantilever beam shown in Figure 20.
The beam is 1m wide into the page (i.e in the plane strain direction).

1.0m
0.5m
10kN
E = 10MPa
m = 0.3
g = 0

Figure 20: Principal stress space
A very approximate solution to this problem can be obtained using two 4-noded plane
strain finite elements, as shown in Figure 21.
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 62 -

0.5m 0.5m
0.5m
1 2 3
6 5 4
10kN/m
E = 10MPa
m = 0.3
g = 0

Figure 21: Cantilever beam discretised with two 4-noded elements
The stiffness matrices for each element can be obtained in the usual way. This
involves setting up a matrix of nodal coordinates for each element (ensuring the nodes
are ordered an in anti-clockwise direction). For element 1 (with nodes 1, 2, 4 and 5)
>> coord1=[0,0; 0.5,0; 0.5,0.5; 0,0.5]

coord1 =

0 0
0.5 0
0.5 0.5
0 0.5
Assuming that vectors of Gauss integration coordinates and weights are already in the
MATLAB workspace, and the constitutive matrix D has been obtained, the stiffness
matrix for element 1 can be obtained, by first zeroing a 8 8 matrix
>> k1=zeros(8,8);

And then integrating the matrix over the 4 Gauss Points
>> for i=1:4
[B,N,detJ,x,z] = Form_B_N_detJ(coord1,s(i),t(i),4,0);
k1=k1+B'*D*B*detJ*weights(i);
end
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 63 -
For each of the above the above commands, the MATLAB output has been
suppressed using ; at the end of each statement. The stiffness matrix can be shown
by typing k1:
>> k1

k1 =

1.00E+03 *

5.7692 2.4038 -3.8462 0.4808 -2.8846 -2.4038 0.9615 -0.4808
2.4038 5.7692 -0.4808 0.9615 -2.4038 -2.8846 0.4808 -3.8462
-3.8462 -0.4808 5.7692 -2.4038 0.9615 0.4808 -2.8846 2.4038
0.4808 0.9615 -2.4038 5.7692 -0.4808 -3.8462 2.4038 -2.8846
-2.8846 -2.4038 0.9615 -0.4808 5.7692 2.4038 -3.8462 0.4808
-2.4038 -2.8846 0.4808 -3.8462 2.4038 5.7692 -0.4808 0.9615
0.9615 0.4808 -2.8846 2.4038 -3.8462 -0.4808 5.7692 -2.4038
-0.4808 -3.8462 2.4038 -2.8846 0.4808 0.9615 -2.4038 5.7692
Following a similar approach for the second element
>> coords2=[0.5,0;1,0;1,0.5;0.5,0.5]

coords2 =

0.5 0
1 0
1 0.5
0.5 0.5
Now zeroing the stiffness matrix for the second element before integrating.
>> K2=zeros(8,8);

Then executing the integration loop
>> for i=1:4
[B,N,detJ,x,z] = Form_B_N_detJ(coords2,s(i),t(i),4,0);
k2=k2+B'*D*B*detJ*weights(i);
end
>> k2

k2 =

1.00E+03 *

5.7692 2.4038 -3.8462 0.4808 -2.8846 -2.4038 0.9615 -0.4808
2.4038 5.7692 -0.4808 0.9615 -2.4038 -2.8846 0.4808 -3.8462
-3.8462 -0.4808 5.7692 -2.4038 0.9615 0.4808 -2.8846 2.4038
0.4808 0.9615 -2.4038 5.7692 -0.4808 -3.8462 2.4038 -2.8846
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 64 -
-2.8846 -2.4038 0.9615 -0.4808 5.7692 2.4038 -3.8462 0.4808
-2.4038 -2.8846 0.4808 -3.8462 2.4038 5.7692 -0.4808 0.9615
0.9615 0.4808 -2.8846 2.4038 -3.8462 -0.4808 5.7692 -2.4038
-0.4808 -3.8462 2.4038 -2.8846 0.4808 0.9615 -2.4038 5.7692

The two element stiffness matrices (k1 and k2) must now be assembled to form a
global stiffness matrix K. As there are 6 nodes, each with 2 degrees of freedom
(including the fixed degrees of freedom), K must be of size 12 12.
>> K=zeros(12,12)

K =

0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
The assembly of element stiffness matrices into the global stiffness matrix is done
using element steering vectors g. The length of g is equal to the number of degrees
of freedom for each element. For as each node has two degrees of freedom, the 4-
noded planes strain element has a total degrees of freedom per element. The
numbering convention used is horizontal degree of freedom for the ith node is 2i-1,
where as the vertical degree of freedom is numbered 2i. The steering vector for
element 1 (g_1) is therefore:
>> g_1=[1;2;3;4;9;10;11;12]

g_1 =

1
2
3
4
9
10
11
12

CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 65 -
k1 can then be assembled into K as follows
>> K(g_1,g_1)=K(g_1,g_1)+k1

K =

1.00E+03 *

5.7692 2.4038 -3.8462 0.4808 0 0 0 0 -2.8846 -2.4038 0.9615 -0.4808
2.4038 5.7692 -0.4808 0.9615 0 0 0 0 -2.4038 -2.8846 0.4808 -3.8462
-3.8462 -0.4808 5.7692 -2.4038 0 0 0 0 0.9615 0.4808 -2.8846 2.4038
0.4808 0.9615 -2.4038 5.7692 0 0 0 0 -0.4808 -3.8462 2.4038 -2.8846
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
-2.8846 -2.4038 0.9615 -0.4808 0 0 0 0 5.7692 2.4038 -3.8462 0.4808
-2.4038 -2.8846 0.4808 -3.8462 0 0 0 0 2.4038 5.7692 -0.4808 0.9615
0.9615 0.4808 -2.8846 2.4038 0 0 0 0 -3.8462 -0.4808 5.7692 -2.4038
-0.4808 -3.8462 2.4038 -2.8846 0 0 0 0 0.4808 0.9615 -2.4038 5.7692
The steering vector for the second element is
>> g_2=[3;4;5;6;7;8;9;10]

g_2 =

3
4
5
6
7
8
9
10
And
>> K(g_2,g_2)=K(g_2,g_2)+k2

K =

1.00E+04 *
Columns 1 through 8
0.5769 0.2404 -0.3846 0.0481 0 0 0 0
0.2404 0.5769 -0.0481 0.0962 0 0 0 0
-0.3846 -0.0481 1.1538 0 -0.3846 0.0481 -0.2885 -0.2404
0.0481 0.0962 0 1.1538 -0.0481 0.0962 -0.2404 -0.2885
0 0 -0.3846 -0.0481 0.5769 -0.2404 0.0962 0.0481
0 0 0.0481 0.0962 -0.2404 0.5769 -0.0481 -0.3846
0 0 -0.2885 -0.2404 0.0962 -0.0481 0.5769 0.2404
0 0 -0.2404 -0.2885 0.0481 -0.3846 0.2404 0.5769
-0.2885 -0.2404 0.1923 0 -0.2885 0.2404 -0.3846 -0.0481
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 66 -
-0.2404 -0.2885 0 -0.7692 0.2404 -0.2885 0.0481 0.0962
0.0962 0.0481 -0.2885 0.2404 0 0 0 0
-0.0481 -0.3846 0.2404 -0.2885 0 0 0 0

Columns 9 through 12
-0.2885 -0.2404 0.0962 -0.0481
-0.2404 -0.2885 0.0481 -0.3846
0.1923 0 -0.2885 0.2404
0 -0.7692 0.2404 -0.2885
-0.2885 0.2404 0 0
0.2404 -0.2885 0 0
-0.3846 0.0481 0 0
-0.0481 0.0962 0 0
1.1538 0 -0.3846 0.0481
0 1.1538 -0.0481 0.0962
-0.3846 -0.0481 0.5769 -0.2404
0.0481 0.0962 -0.2404 0.5769
A vector containing nodal loads can now be formed noting that the load is in the y-
direction an the 4
th
node. It therefore is assembles in the 2i = 24 = 8th position in the
load vector.
>> F=zeros(12,1);
>> F(8)=-10

F =

0
0
0
0
0
0
0
-10
0
0
0
0
The usual steering vector is now used to identify free and restrained degrees of
freedom
>> steer=[0;0;1;1;1;1;1;1;1;1;0;0]

steer =

0
0
1
1
1
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 67 -
1
1
1
1
1
0
0
And logical steering vectors are formed in the usual way.
>> free=(steer>0)

free =

0
0
1
1
1
1
1
1
1
1
0
0

>> pres=(steer==0)

pres =

1
1
0
0
0
0
0
0
0
0
1
1
The global stiffness matrix can now be partitioned as follows
>> kf=K(free,free)

kf =

1.00E+04 *
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 68 -

1.1538 0 -0.3846 0.0481 -0.2885 -0.2404 0.1923 0
0 1.1538 -0.0481 0.0962 -0.2404 -0.2885 0 -0.7692
-0.3846 -0.0481 0.5769 -0.2404 0.0962 0.0481 -0.2885 0.2404
0.0481 0.0962 -0.2404 0.5769 -0.0481 -0.3846 0.2404 -0.2885
-0.2885 -0.2404 0.0962 -0.0481 0.5769 0.2404 -0.3846 0.0481
-0.2404 -0.2885 0.0481 -0.3846 0.2404 0.5769 -0.0481 0.0962
0.1923 0 -0.2885 0.2404 -0.3846 -0.0481 1.1538 0
0 -0.7692 0.2404 -0.2885 0.0481 0.0962 0 1.1538

>> kp=K(pres,pres)

kp =

1.00E+03 *

5.7692 2.4038 0.9615 -0.4808
2.4038 5.7692 0.4808 -3.8462
0.9615 0.4808 5.7692 -2.4038
-0.4808 -3.8462 -2.4038 5.7692

>> kfp=K(free,pres)

kfp =

1.00E+03 *

-3.8462 -0.4808 -2.8846 2.4038
0.4808 0.9615 2.4038 -2.8846
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
-2.8846 -2.4038 -3.8462 0.4808
-2.4038 -2.8846 -0.4808 0.9615
The loading vector portioned also
>> ff=F(free)

ff =

0
0
0
0
0
-10
0
0

>> up=zeros(4,1)

up =
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 69 -

0
0
0
0
And the system of equations solved to give the unknown displacements.
>> uf=kf\ff

uf =

-0.00524
-0.0079
-0.00675
-0.02191
0.007118
-0.02316
0.005158
-0.0077
The global displacement vector is then formed
>> U=zeros(12,1)

U =

0
0
0
0
0
0
0
0
0
0
0
0
And set using the logical steering vector
>> U(free)=uf

U =

0
0
-0.0052
-0.0079
-0.0067
-0.0219
0.0071
CIVL 8120 Computational Geomechanics (2010) Dr James P Doherty
- 70 -
-0.0232
0.0052
-0.0077
0
0
Using the global displacement vector, the nodal reactions can be computed
>> F=K*U

F =

20
4.7451
0
0
0
0
0
-10
0
0
-20
5.2549
These are shown in Figure 22. It can be seen that nodal forces are in external
equilibrium.

1 2 3
6 5 4
10kN/m
5.2549kN/m
4.7451kN/m
20kN/m
20kN/m

Figure 22: Reactions

You might also like