Académique Documents
Professionnel Documents
Culture Documents
Haihang You
Department of Electrical Engineering and Computer Science,
The University of Tennessee, Knoxville, TN 37996, U.S.A.
(Dated: October 29, 2008)
Finite Element Method is a powerful and widely used method for numerical solutions of partial
differential equations. Continuous Galerkin finite element method is a well established PDE solver.
This article tries to introduce the method and the software to solve the Poissons equation fast and
with high order accuracy, it is complicated as it includes mesh generation, mesh refinement, 1st , 2nd
and even higher order approximation, stiffness matrix assembly , and fast linear solver. This program
will solve Poissons equation with Dirichlet boundary condition. It utilize the triangulation software:
Triangle[a], which is a Two-Dimensional quality mesh generator and delaunay triangulator. Mesh
refinement, 1st , 2nd order approximation, and Conjugate Gradient solver are also implemented in
the program.
PACS numbers:
I.
INTRODUCTION
(f, v) =
(1)
(2)
where Rd , d = 2, 3, gD denotes Dirichlet boundary condition, and boundary with n being the unit
outward normal vector. Let V = {v H 1 () : v =
(6)
u vdx
(7)
f vdx
(8)
Let us consider the following second order elliptic problem of Poissons equation:
u = f in
u = gD on
v V
where
Poissons Equation
(4)
MATHEMATICAL DESCRIPTION
A.
u
vdx
n
a(u, v) =
II.
B.
Let h = {Ki : i = 1, 2, ..., mh } be a set of star-like nonoverlapping partitions of with length of 0 < h 1, such
that = Kh K = K1 K2 ... Kmh . Each element
of h satisfies the minimal angle condition[2]. Internal
edges are defined as E I = {e = Ki Kj , d1 (e) >
0, 1 < i mh }, and boundary edges are defined as E B =
{e = Ki , d1 (e) > 0, 1 < i mh }, and E = E I
B
E B , where Dirichlet boundary edges are ED
, Neumann
B
B
B
B
B
boundary edges are EN
, E B = ED
EN
and ED
EN
=.
Define the energy space Eh as:
Y
Eh =
H 2 (K)
Kh
A is called the StiffnessMatrix which is symmetric positive definite with each element defined in Eq(14), b is a
vector which is defined in Eq(15), and the solution of the
linear system, = (1 , 2 , ..., N )T are the result of the
finite element approximation over internal DOFs in .
A = b
Kh
(16)
(9)
C.
Stiffness Matrix
1
1
0.8
0.5
0.8
0.6
1
1
0.6
0
1
0.4
0.8
0.6
0.4
0.8
0.2
0.4
0.2
0.6
0.4
0.2
0
0.2
(a) A triangulated 2D
mesh.
0
(0, 0)
1
(1, 0)
(a) K
0
(x0 , y0 )
2
(x2 , y2 )
(b) K
1.
Affine Transformation
N
X
i i (xi )
(12)
i=1
i j dx =
f j dx
(13)
where
aji = aij =
i j dx
(14)
f j dx
(15)
fj =
x
+
(17)
=
y0
y
y1 y0 y2 y0
y
The Affine transformation F1 from reference triangle
is:
K to triangle K
1
x
y2 y0 (x2 x0 )
x x0
=
y
y y0
2|K| (y1 y0 ) x1 x0
(18)
or
3.
1
2|K|
c11 c12
c21 c22
x x0
y y0
(19)
1
2|K|
c11 c21
c12 c22
i j dxdy
K
Z
1
l )T (C
m )d
aji = aij =
(C
xd
y
2|K| K
aji = aij =
(20)
(21)
(22)
z2 = (x2 , y2 )
z2 = (1, 0) z3 = (0, 1)
z5 = (0.5, 0.5) z6 = (0, 0.5)
Vertices on a triangle:
z0 = (x0 , y0 )
z3 = (x3 , y3 )
z1 = (x1 , y1 )
z4 = (x4 , y4 )
z2 = (x2 , y2 )
z5 = (x5 , y5 )
(23)
(24)
2.
5 (
x, y) = 4
xy
6 (
x, y) = 4
xy 4
y 2 + 4
y
3. 1st order derivative basis functions are:
4
x + 4
y3
0 (
x, y) =
4
x + 4
y3
4
x1
1 (
x, y) =
0
0
2 (
x, y) =
4
y1
8
x 4
y+4
3 (
x, y) =
4
x
4
y
4 (
x, y) =
4
x
4
y
5 (
x, y) =
4
x 8
y+4
As we have shown above, on each triangle, we have 3
DOFs for 1st order polynomials, 6 for 2nd order, and for
3rd order and 4th order polynomials, we have 10 and 16
DOFs respectively.
2 (
x, y) = y
III.
x, y) =
1
1
1 (
x, y) =
0
0
2 (
x, y) =
1
SOFTWARE DEVELOPMENT
In Section II, we have seen the descriptions of calculations on each triangle, which will contribute to stiffness
matrix and right hand side vector. Before we can do any
computation, we need triangulate the domain. I used
software Triangle to generate initial triangulation, then
read in triangulation information. The program can refine the mesh by bi sectioning each edge. Fig 3(a) is the
initial mesh. Fig 3(b) shows the refined mesh.
x 10
4
3.5
3
2.5
2
1.5
1
0.5
1
0.5
0.5
0
0.2
0.4
0.6
0.8
0
1
Application 2:
IV.
APPLICATION
(28)
(29)
(25)
(1, 1)
1.2
1
0.8
0.6
0.4
0.2
0
0.2
0
0.8
0.6
0.5
0.4
0.2
1
(0, 0)
(1, 0)
FIG. 5: Result of application 2.
Application 1:
f (x, y) = 1, when x, y (0.49, 0.51)
gD = 0 on
(26)
(27)
[1] R. Courant. Variational methods for the solutions of equilibrium and vibrations. Bull. Amer. Math. Soc., pages
123, 1943.
[2] Peter Knabner and Lutz Angermann. Numerical Methods
for Elliptic and Parabolic Partial Differential Equations: