Vous êtes sur la page 1sur 27

The Finite Element Method

Defined

The Finite Element Method (FEM) is a weighted


residual method that uses compactly-supported
basis functions.
Brief Comparison with Other
Methods

Finite Difference (FD) Finite Element (FE)


Method: Method:
FD approximates an FE uses exact operators
operator (e.g., the but approximates the
derivative) and solves a solution basis functions.
problem on a set of points Also, FE solves a problem
(the grid) on the interiors of grid
cells (and optionally on the
gridpoints as well).
Brief Comparison with Other
Methods

Spectral Methods: Finite Element (FE)


Method:
Spectral methods use
global basis functions to FE methods use compact
approximate a solution basis functions to
across the entire domain. approximate a solution on
individual elements.
Overview of the Finite Element
Method

S W G M
Strong Weak Galerkin Matrix
form form approx. form
Sample Problem
Axial deformation of a bar subjected to a uniform load
(1-D Poisson equation)
d 2u
EA 2 = p0
dx
L u 0 = 0
du
EA =0
p x = p0 dx xL

u = axial displacement
x = 0, L
E=Youngs modulus = 1
A=Cross-sectional area = 1
Strong Form

The set of governing PDEs, with boundary conditions, is


called the strong form of the problem.
Hence, our strong form is (Poisson equation in 1-D):

d 2u
2
= p0
dx
u 0 = 0
du
=0
dx xL
Weak Form
We now reformulate the problem into the weak form.
The weak form is a variational statement of the problem in
which we integrate against a test function. The choice of test
function is up to us.
This has the effect of relaxing the problem; instead of finding
an exact solution everywhere, we are finding a solution that
satisfies the strong form on average over the domain.
Weak Form

d 2u Strong Form
2
= p0
dx
d 2u
2
p0 = 0 Residual R=0
dx
L
d 2u
0 dx 2 p0 vdx = 0 Weak Form

v is our test function


We will choose the test function later.
Weak Form
Why is it weak?
It is a weaker statement of the problem.
A solution of the strong form will also satisfy the weak form,
but not vice versa.
Analogous to weak and strong convergence:
strong : lim xn x
n

weak : lim f xn f x f
n
Weak Form
Choosing the test function:

We can choose any v we want, so let's choose v such that it


satisfies homogeneous boundary conditions wherever the actual
solution satisfies Dirichlet boundary conditions. Well see why
this helps us, and later will do it with more mathematical rigor.

So in our example, u(0)=0 so let v(0)=0.


Weak Form
Returning to the weak form:
L
d 2u
0 dx 2 p0 vdx = 0
L
d 2u L
0 dx 2 vdx = 0 p0vdx
Integrate LHS by parts:
Integrate
xL
du
L
du dv
dx v( x)
0
dx dx dx x 0
L

du dv

dx v L du

v 0 du
0
dx dx dx xL dx x 0
Weak Form
Recall the boundary conditions on u and v:
u 0 = 0
du
=0
dx xL

v ( 0) 0

Hence,
H
The weak form
L
dx vL v0
du dv du du satisfies Neumann

0
dx dx dx xL dx x 0
conditions
L automatically!
du dv L
0 dx dx dx 0 p0vdx
Weak Form
Why is it variational?
L
du dv L
0 dx dx dx = 0 p0vdx

Variationa l statement :
Find u H 1 such that Bu, v F (v) v H 01
B a bilinear functional , F a linear functional

u and v are functions from an infinite-dimensional


function space H
Galerkins Method
We still havent done the finite element method yet, we have
just restated the problem in the weak formulation.
So what makes it finite elements?
Solving the problem locally on elements
Finite-dimensional approximation to an infinite- dimensional
space Galerkins Method
Galerkins Method
Choose finite basis
N
i i i

Then,
N
u x c j j x , c j unkowns to solve for
j 1
N
v x b j j x , b j arbitraril y chosen
j 1

Insert the se into our weak form :


L du dv L
0 dx dx dx 0 p0vdx
L N d j N
d i N

0 x bi x dx 0 p0 b j j x dx
L
cj
j 1 dx i 1 dx j 1
Galerkins Method

L N d j di N N

x bi x dx 0 p0 b j j x dx
L

0
j 1
cj
dx i 1 dx j 1

Rearrangin g :
N N d j di N

b c dx bi p0i dx
L L
i j
i 1 j 1
0 dx dx i 1
0

Cancelling :
N d j di
c
L L
j dx p0i dx
j 1
0 dx dx 0
Galerkins Method
N d j di
c
L L
j dx p0i dx
j 1
0 dx dx 0

We now have a matrix problem Kc F, where c j


is a vector of unknowns,
L d j d
K ij i
dx,
0 dx dx

L
and Fi p0i dx
0

We can already see K ij will be symmetric since we can


interchang e i, j without effect.
Galerkins Method
So what have we done so far?
1) Reformulated the problem in the weak form.
2) Chosen a finite-dimensional approximation to the solution.
Recall weak form written in terms of residual:
d 2u
2 p0 vdx Rvdx bi Ri dx 0
L L L
0
dx 0
i
0

This is an L2 inner-product. Therefore, the residual is orthogonal


to our space of basis functions. Orthogonality Condition
Orthogonality Condition
d 2u
2 p0 vdx Rvdx bi Ri dx 0
L L L
0
dx 0
i
0

The residual is orthogonal to our space of basis functions:

u H

Hh
uh i

Therefore, given some space of approximate functions Hh, we are


finding uh that is closest (as measured by the L2 inner product) to
the actual solution u.
Discretization and Basis Functions
Lets continue with our sample problem. Now we discretize our
domain. For this example, we will discretize x=[0, L] into 2
elements.

1 2
0 h 2h=L

In 1-D, elements are segments. In 2-D, they are triangles, tetrads,


etc. In 3-D, they are solids, such as tetrahedra. We will solve the
Galerkin problem on each element.
Discretization and Basis Functions
For a set of basis functions, we can choose anything. For
simplicity here, we choose piecewise linear hat functions.
Our solution will be a linear combination of these functions.

1 2 3

x1=0 x2=L/2 x3=L

Basis functions satisfy : i x j ij Our solution w ill be


interpolat ory. Also, they satisfy th e partition of unity.
Discretization and Basis Functions
To save time, we can throw out 1 a priori because, since in this
example u(0)=0, we know that the coefficent c1 must be 0.

2 3

x1=0 x2=L/2 x3=L


Basis Functions

2x
L if x 0, L2
2 3
2x
2 2 if x L2 , L
L
0 otherwise
x1=0 x2=L/2 x3=L

2x
1 if x L2 , L
3 L
0 otherwise
Matrix Formulation
Given our matrix problem Kc F :
N L d j d

L
cj i
dx p0i dx Kc F
j 1
0 dx dx

0

c F
K

We can insert the i chosen on the previous slide and


arrive at a linear algebra problem. Differenti ating the basis
functions, then evaluating the integrals, we have :
1 4 2 p0 12
K , F
L 2 2 L 14
In a computer code, differenti ating the basis functions can be
done in advance, since the basis functions are known, and
integratio n would be performed numericall y by quadrature .
It is standard in FEM to use Gaussian quadrature , since it is exact
for polynomial s.
Notice K is symmetric as expected.
Solution
Solving the Gaussian eliminatio n problem on the previous slide,
we obtain our coefficien ts ci :
3 p0 L
2

c p 8L2 , which wh en multiplied by basis functions i gives


02
our final numerical solution :
34 p0 Lx whe n x 0, L2
x 1
4 p0 ( L2 Lx) whe n x L2 , L
The exact analytical solution for this problem is :
p0 x 2
u x p0 Lx
2
Solution
0.6
0.5
0.4
Exact
u(x)

0.3
Approx
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
x

Notice the numerical solution is interpolatory, or nodally exact.


Concluding Remarks
Because basis functions are compact, matrix K is typically
tridiagonal or otherwise sparse, which allows for fast solvers that
take advantage of the structure (regular Gaussian elimination is
O(N3), where N is number of elements!). Memory requirements
are also reduced.
Continuity between elements not required. Discontinuous
Galerkin Method