Sei sulla pagina 1di 14

A very short introduction to the Finite Element

Method
Till Mathis Wagner
Technical University of Munich
JASS 2004, St Petersburg
May 4, 2004
1 Introduction
This is a short introduction to the nite element method (FEM), which is,
besides others like the nite differences approximation, a technique to solve
partial differential equations (PDEs) numerically.
The FEM was mainly developed for equations of elasticity and struc-
tural mechanics. In these elds problems have to be solved in complicated
and irregular geometries. So one of the main advantages of the FEM, in
comparison to the nite differences approximation, lies in the exibility
concerning the geometry of the domain where the PDE is to be solved.
Moreover the FEM is perfectly suitable as adaptive method, because it
makes local renements of the solution easily possible.
The method does not operate on the PDE itself, instead the PDE is trans-
formed to a equivalent variational or weak form. This will be the topic of
the second part: the variational principle.
A rst approach to solve the variational or weak form was made by
Ritz (1908). A discussion of this method is the subject in the third section:
the Ritz method.
Considering the disadvantages of the Ritz method will lead to the nite
element method and to the fourth and last part: the nite element method.
1
2 The Variational Principle
Partial differential equations (PDE) are separated into different types which
behave very differently and demand an entirely own treatment. In the eld
of second-order linear differential equations three types are of fundamental
interest, these are the hyperbolic, parabolic and elliptic equations. Depend-
ing on the type of the PDE boundary or initial conditions have to be given.
The main focus of the nite element method are elliptic PDEs so we
will concentrate on this type. The correct side conditions for elliptic PDEs
are boundary conditions.
Denition: Elliptic Partial Differential Equation
Let be R
n
open, f : R and L a linear elliptic Operator in the form
Lu =
n

i,j=1

j
(a
ij
(x)
i
u) + a
0
(x)u (1)
where A(x) := (a
ij
(x))
ij
symmetric positive denite.
Then
Lu = f in
is called elliptic partial differential equation.
Example 1:
for A(x) =
_
_
_
1
.
.
.
1
_
_
_
a
ij
(x) =
ij
and a
0
(x) = 0
Lu =
n

i=1

2
i
u = u
so we obtain the Poisson Equation u = f which is the prototype of an
elliptic partial differential equation.
Boundary conditions for elliptic partial differential equations are
u = g on (Dirichlet boundary condition)
or

u = h on (Neumann boundary condition)


Consider now the elliptic PDE with homogeneous Dirichlet boundary
conditions:
Lu = f in
u = 0 on
for this situation will we state the following theorem.
2
Theorem: The Variational Principle
Let be L a linear elliptic Operator as in (1), a
0
0 and V = {v C
2
C() :
v = 0 on }.
For u V are equivalent:
(i) Lu = f
(ii) a(u, v) = (f, v) v V
where a(u, v) =
_

n
i,j=1
a
ij

i
u
j
v + a
0
uvdx
and (f, v) =
_

fvdx
(iii) u = arg min
vV
I(v) with I(v) =
1
2
a(v, v) (f, v)
Proof:
(i)(ii):
Lu = f 0 =
_

v(Lu f)dx v V
0 =
_

i,j
a
ij

i
u
j
v + a
0
uv fvdx v V
a(u, v) = (f, v) v V
the second transformation is done by Greens Theorem whereas the bound-
ary integral is zero since v V vanishes on .
(ii)(iii): For u, v V and t R we get
I(u + tv) =
1
2
a(u + tv, u + tv) (f, u + tv)
= I(u) + t(a(u, v) (f, v)
. .
=0
) +
t
2
2
a(v, v)
If t = 1 and v = 0 then
I(u + v) = I(u) +
1
2
a(v, v)
. .
>0
> I(u)
So u minimises I over V . Additionally, for v V is: a(v, v) = 0 v = 0 ,
thus u is the unique minimal point of I over V .
(iii)(ii): I has a stationary point at u, since u minimises I, so

t
I(u + tv)

t=0
= 0
3
with
I(u + tv) =
1
2
a(u, u) (f, u) + ta(u, v) (f, v) + t
2
1
2
a(v, v)
we recieve

t
I(u + tv)

t=0
= (a(u, v) (f, v) + t(a(v, v))

t=0
= a(u, v) (f, v)
together
0 = a(u, v) (f, v)
Remarks:
The boundary condition u = 0 on is satised through the choice
of the space V = {v C
2
() C() : v = 0 on }.
Equation (ii) a(u, v) = (f, v) is called weak form of the pde.
Equation (iii) u = arg min
vV
I(v) is called variational form of the
pde.
If such an u exists, it is unique.
A solution can be guaranteed (by the Lax-Milgram Theorem ) if the
space V is expanded appropriate (Sobolev Spaces)
Example 2: Assume the Poisson equation with homogeneous Dirichlet
boundary condition:
u = f u = 0 on (2)
With V = {v C
2
()C() : v = 0 on } and a(u, v) =
_

i,j
a
ij

i
u
j
v+
a
0
uvdx where a
ij
=
ij
, a
0
= 0 (cp. example 1) so a(u, v) =
_

i,j

i
u
j
vdx
the variational principle says, that instead of (2) we may solve
min
vV
I(v) =
1
2
_

i
(
i
)
2
dx
. .
a(v,v)

fvdx
. .
(f,v)
or
a(u, v) = (f, v) v V
So far we have been assuming that the problem is given with homoge-
nous Dirichlet boundary conditions (i.e. u = 0 on ). In general this
4
may not be the case. Nonetheless it is no loss of generality if we assume
homogenous Dirichlet boundary conditions.
Suppose the problem: Lu = f, u = g on
If we solve the equation a(w, v) = (f Lg, v) v V
we get with w := u g : a(w, v) = (f Lg, v)
a(u, v) a(g, v) = (f, v) (Lg, v)
a(u, v) = (f, v)
so u satises Lu = f. On we have:
0 = w

= (u g)

= g

so u also satises the boundary condition u = g on .


Now we are going to have a short view on Neumann boundary condi-
tions. Suppose the problem: Lu = f,

n
i,j
a
ij

u = h on
Remember that we used Greens Theorem to transform (Lu, v) into
a(u, v), and no boundary integrals are left in the bilinear form a because of
the homogeneous Dirichlet boundary condition (v = 0 on ). In the above
problem Neumann boundary conditions are given, so we cannot expect
that v will vanish at the boundary of . Hence the boundary integral does
not vanish and (Lu, v) becomes:
(Lu, v) = a(u, v) + (h, v)

where (h, v)

=
_

hvdx
so the weak form of the PDE changes to:
a(u, v) = (f, v) (h, v)

and the variational form becomes:


I(v) =
1
2
a(v, v) (f, v) (h, v)

3 The Ritz Method


So far we have seen, that instead of solving the PDE we may solve the equa-
tion a(u, v) = (f, v) v V with a particular bilinear form a which de-
pends on the given PDE, or minimise a certain functional I(v) =
1
2
a(v, v)
(f, v) respectively.
But since V = {v C
2
() C() : v = 0 on } is an innite-dimensional
space, this is still a though problem.
5
In 1908 Ritz posed the idea, to search the solution u on a nite-dimensional
subspace V
h
V . So he was looking for a approximation of u by nding a
function u
h
V
h
that satises
a(u
h
, v
h
) = (f, v
h
) v
h
V
h
This rises immediately the questions how to nd such u
h
, if it is easy to
nd it and how good it approximates our solution u. We will answer these
questions in this order.
How to nd this u
h
? Let (
i
)
i=1=n
be a basis of V
h
. So u
h
V
h
can be
written as u
h
=

n
i=1
c
i

i
.
Then u
h
must satisfy:
a(u
h
, v
h
) = (f, v
h
) v
h
V
h
a(u
h
,
j
) = (f,
j
) j
a(

i
c
i

i
,
j
) = (f,
j
) j

i
c
i
a(
i
,
j
)
. .
:=a
ij
= (f,
j
)
. .
:=b
j
j
which is nothing else but a, linear system of equations: Ac = b .
The approach from the variational form respectively the minimising
problem
min
v
h
V
h
I(v
h
)

v
h
I(v
h
) = 0 v
h
V
h


c
j
I(

i
c
i

i
) = 0 j
lead to the same linear system of equations.
Obviously this is now a very simple problem and many methods in nu-
merical linear algebra exists to solve linear systems of equations, so nding
u
h
is very easy.
The Matrix A = (a(
i
,
j
))
j,i
is called stiffness matrix due to the fact
that rst applications of the nite element method has been made by engi-
neers in the eld of structural mechanics.
Example 3:
Consider the Poisson equation with homogeneous Dirichlet boundary con-
ditions in one dimension:
u = x
2
, u = 0 on and = [0, 1]
6
Let the basis {
1
,
2
} of V
h
be as follows:

1
= x(1 x)

1
= 1 2x

2
= x
2
(1 x)

2
= 2x
2
3x
3
with a(u, v) =
_

i,j

i
u
j
vdx (cp. example 2) we get
a(
1
,
1
) =
_
1
0
(

1
)
2
dx =
1
3
a(
2
,
2
) =
_
1
0
(

2
)
2
dx =
2
15
a(
1
,
2
) = a(
2
,
1
) =
_
1
0

2
dx =
1
6
so the stiffness matrix is: A
h
=
_
_
1
3
1
6
1
6
2
15
_
_
Moreover
(f,
1
) =
_
1
0
f
1
dx =
1
20
(f,
2
) =
_
1
0
f
2
dx =
1
30
therefore we obtain the right hand side b
h
=
_
_

1
20

1
30
_
_
.
Solving A
h
c = b
h
yields c =
_
_

1
15

1
6
_
_
.
Finally we receive the approximation u
h
of u (Fig. 1):
u
h
= c
1

1
+ c
2

2
=
1
6
x
3
+
1
10
x
2
+
1
15
x
Remarks:
Solving a PDE is reduced to solving a linear system of equations,
which is a relatively easy task in numerics and there are lot of meth-
ods for this problem
7
Figure 1: example for Ritz method
u
h
is the best approximation in V
h
in respect to the Norm induced
by a (Cea Lemma) (which answers our third questions raised in the
beginning of this chapter).
This method has still two disadvantages:
First the matrix A
h
is dense, so the computation of A
h
c = b
h
will be
relatively slow, because we can expect, that A
h
will become very big
for accurate approximations.
And second may it be quite difcult to nd a basis (
i
)
i=1...n
of V
h
where all the functions
i
satisfy the boundary conditions, especially
for irregular domains .
The nite element method will overcome these two problems.
4 The Finite Element Method
If it is possible to nd a basis (
i
)
i=1...n
of V
h
where each
i
vanishes on
most part of the domain (this is called
i
has local support (Fig. 2)), it
follows that:
a(
i
,
j
) = 0 for most ij, because whenever one of the basis functions
is zero at a certain point x the product of

i
and

j
vanishes and
so does a(
i
,
j
).
the matrix A
h
will be sparse, since most of the entries a(
i
,
j
) are
zero.
the boundary conditions have to be satised by only these few
i
,
which do not vanish at .
8
Figure 2: local support of basis functions
The idea of the FEM is to discretise the domain into nite elements
and dene functions
i
which vanish on most of these elements.
First we choose a geometric shape and divide the domain into a nite
number of regions. In one dimension the domain is split into intervals.
In two dimensions the elements are usually of triangular or quadrilateral
shape. And in three dimensions tetrahedral or hexahedral forms are most
common. Most elements used in practice have fairly simple geometries,
because this results in very easy computation, since integrating over these
shapes is quite basic.
The basis functions
i
are usually not dened directly. Instead a func-
tion type, the so called ansatz function, (e.g. linear or quadratic polynomial)
is selected which our approximation u
h
of u should adopt on each of these
elements. Most commonly a linear ansatz function is chosen, which means
that u
h
will be a linear function on each element and continuous over
(but not continuously differentiable).
Each element possesses a set of distinguishing points called nodal points
or nodes. Nodes dene the element geometry, and are the degrees of free-
dom of the ansatz function. So the number of nodes in a element depends
on the ansatz function as well as the geometry. They are usually located at
the corners or end points of elements. For higher-order (higher than linear)
ansatz functions, nodes are also placed on sides or faces, as well as perhaps
the interior of the element (Fig. 3).
The combination of the geometric shape of the nite element and their
associated ansatz function on this region is referred as nite element type.
The basis (
i
)
i=1...n
arise from the choice of the nite element type.
Example 4: Linear nite elements in 1 dimension
Let us approximate u by a piecewise linear function u
h
on the domain
R (Fig. 4).
9
Figure 3: example of nite element types
Figure 4: linear nite elements in 1 dimension
10
This leads to the well kmown B-Spline basis (Fig. 5):
Figure 5: basis of 1 dimensional linear nite elements

i
(x) =
_

_
xx
i1
x
i
x
i1
x [x
i1
, x
i
]
x
i+1
x
x
i+1
x
i
x [x
i
, x
i+1
]
0 else
And u
h
can be written as
u
h
=

i
y
i

i
In 2 dimensions the basis looks similar (Fig. 6).
Figure 6: basis function of 2 dimensional linear nite elements
Advantages of the Finite Element Basis
It is very easy to nd a basis (
i
)
i=1...n
for any given (and arbitrarily
irregular) domain .
It is very easy to put up
Every
i
has local support
11
Model Algorithm of the Finite Element Method
1. transform the given PDE Lu = f via the variational principle into
a(u, v) = (f, v) v V
2. select a nite element type
3. discretise the domain
4. derive the basis (
i
)
i=1...n
fromthe discretisation and the chosen ansatz
function
5. calculate the stiffness matrix A
h
= (a(
i
,
j
))
ji
and the right hand
side b
h
= (f,
i
)
6. solve A
h
c = b
h
7. obtain (and visualise) the approximation u
h
=

i
c
i

i
Remarks:
The size of the stiffness matrix A
h
and therefore the calculation costs
depends on the number of nodes in the discretisation of . Further-
more is the quantity of nodal points depending on the number of
elements the domain is divided into and the used ansatz function.
Actually we do not have to put up the basis (
i
)
i=1...n
explicit (step 4)
to calculate the stiffness matrix A
h
. Instead it is possible to calculate
for each element the contribution to A
h
and sum these contributions
up. Usually the contributions differ only by a factor from each other,
so there are very few integrals to evaluate to acquire the stiffness ma-
trix A
h
.
Example 5:
Again, consider the Poisson equation with homogeneous Dirichlet bound-
ary conditions in one dimension:
u = x
2
, u = 0 on and = [0, 1]
12
We choose linear nite elements (Fig. 5) and with a(u, v) =
_

i,j

i
u
j
vdx =
_
1
0
u

dx (cp. example 2) we get for each element (Fig. 7)


a(
i
,
i
) =
_
element i
(

i
)
2
dx =
1
h
a(
i1
,
i1
) =
1
h
a(
i1
,
i
) = a(
i1
,
i
) =
_
element i

i1

i
dx =
1
h
so the contribution from every element i to the stiffness matrix is
Figure 7: elementwise integration of the basis functions
A
hi
=
1
h
_
1 1
1 1
_
and under consideration of the boundary conditions we receive
A
h
=

i
A
hi
=
1
h
_
_
_
_
_
_
2 1
1
.
.
.
.
.
.
.
.
.
.
.
.
1
1 2
_
_
_
_
_
_
Computing b
h
= (x
2
,
i
) is done similarly.
Solving A
h
c = b
h
yields the approximation we see in Fig. 8.
This is denitely the most simple version of the FEM, but in principle
all FEM programs work in this way.
More sophisticated versions of the FEM use geometric shapes which are
more complicated and adjusted to the given problem. Moreover they use
13
Figure 8: approximation of 1 dimensional poisson equation
other basis functions, to obtain approximations with certain properties, e.g.
more smoothness.
Additionally it is usually possible to make local renements of the approxi-
mation u
h
which means that the resolution of u
h
is not equal over the whole
domain . This leads to the situation, that the basis functions have a very
small support in a certain region of the domain (where a good approx-
imation of u is important, e.g. the solution is changing very fast) and in
other regions the support of the basis functions are relatively big.
But these are all subtleties, and this is only to draw the outline of the con-
cept of the nite element method.
References
[1] G. Strang, G. Fix: An analysis of the nite element method, Wellesley-
Cambridge Press, 1988
[2] D. Braess: Finite Elemente, Springer-Verlag, 1997
14

Potrebbero piacerti anche