0% found this document useful (0 votes)
30 views17 pages

Fem Notes

The document provides an introduction to the finite element method (FEM) for solving partial differential equations. It begins with a simple example of using FEM to solve a 1D model problem, comparing solutions from collocation, averaging, and Galerkin formulations. It then discusses using piecewise linear basis functions and developing the weak formulation. Finally, it outlines how to construct the linear system for a general triangulation and provides an example of a 4-element mesh.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views17 pages

Fem Notes

The document provides an introduction to the finite element method (FEM) for solving partial differential equations. It begins with a simple example of using FEM to solve a 1D model problem, comparing solutions from collocation, averaging, and Galerkin formulations. It then discusses using piecewise linear basis functions and developing the weak formulation. Finally, it outlines how to construct the linear system for a general triangulation and provides an example of a 4-element mesh.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

The Finite Element Method – Lecture Notes

Per-Olof Persson
[email protected]

March 10, 2022

1 Introduction to FEM
1.1 A simple example
Consider the model problem
−u00 (x) = 1, for x ∈ (0, 1) (1.1)
u(0) = u(1) = 0 (1.2)
with exact solution u(x) = x(1 − x)/2. Find an approximate solution of the form
û(x) = A sin(πx) = Aϕ(x) (1.3)
Various ways to impose the equation:
Collocation : Impose −û00 (xc ) = 1 for some collocation point xc =⇒ Aπ 2 sin(πxc ) = 1
ˆ xc = 1
2 =⇒ A = 1
π2
= 0.1013

2
ˆ xc = 1
4 =⇒ A = π2
= 0.1433
Average : Impose the average of the equation over the interval:
Z 1 Z 1
00
−û (x) dx = 1 dx (1.4)
0 0
Z 1
2
Aπ 2 sin(πx) dx = Aπ 2 = 2Aπ = 1 (1.5)
0 π
1
A= = 0.159 (1.6)

Galerkin : Impose the weighted average of the equation over the interval:
Z 1 Z 1
00
−û (x)v(x) dx = 1 · v(x) dx (1.7)
0 0
A Galerkin method using the weight functions v(x) from the same space as the solution
space, that is, v(x) = ϕ(x). This gives
Z 1 Z 1
Aπ 2 sin2 (πx) dx = sin(πx) dx (1.8)
0 0
21 2
Aπ · = (1.9)
2 π
4
A = 3 = 0.129 (1.10)
π

1
0.18
0.16 ûAVG (x)
0.14 ûGAL (x)
0.12 u(x)
0.10
0.08 ûCOL (x)
0.06
0.04
0.02
0.00
0.0 0.2 0.4 0.6 0.8 1.0

Figure 1: Solutions of the model problem (1.1)-(1.2) using collocation, average, and
Galerkin.

The three solutions are shown in figure 1.1. The finite element method is based on the
Galerkin formulation, which in this example clearly is superior to collocation or averaging.

1.2 Other function spaces


Use piecewise linear, continuous functions of the form û(x) = Aϕ(x) with
(
2x x ≤ 21
ϕ(x) = (1.11)
2 − 2x x > 12

Galerkin gives the FEM formulation


Z 1 Z 1
−û00 (x)ϕ(x) dx = ϕ(x) dx (1.12)
0 0

Since û00 is not bounded, integrate LHS by parts:


Z 1 Z 1
0 0
 0 1
û (x)ϕ (x) dx − û (x)ϕ(x) 0 = û0 (x)ϕ0 (x) dx − û0 (1)ϕ(1) + û0 (0)ϕ(0) (1.13)
0 0
Z 1
= û0 (x)ϕ0 (x) dx, (1.14)
0

since ϕ(0) = ϕ(1) = 0. This leads to the final formulation


Z 1 Z 1
0 0
û (x)ϕ (x) dx = ϕ(x) dx. (1.15)
0 0

To solve for û(x) = Aϕ(x), note that û0 (x) = Aϕ0 (x) and
(
2 x ≤ 12
ϕ0 (x) = (1.16)
−2 x > 12

2
u3

u1

u2
ϕ1 ϕ2 ϕ3
1

x0 x1 x2 x3 x4

Figure 2: A refined piecewise linear function space, same solution and basis functions.

Equation (1.15) then becomes


Z 1/2 Z 1 Z 1/2 Z 1
(2A)(2) dx + (−2A)(−2) dx = 2x dx + (2 − 2x) dx (1.17)
0 1/2 0 1/2

or 4A = 1/2, that is, A = 1/8, and the FEM solution is û(x) = ϕ(x)/8.

1.3 More basis functions


To refine the solution space, introduce a triangulation of the domain Ω = [0, 1] into non-
overlapping elements:
Th = {K1 , K2 , . . .} (1.18)
such that Ω = ∪K∈Th K. Now consider the space of continuous functions that are piecewise
linear on the triangulation and zero at the end points:
Vh = {v ∈ C 0 ([0, 1]) : v|K ∈ P1 (K) ∀K ∈ Th , v(0) = v(1) = 0}. (1.19)
Here Pp (K) is the space of polynomials on K of degree at most p. Define a basis {ϕi } for
Vh by the basis functions ϕi ∈ Vh with ϕi (xj ) = δij , for i, j = 1, . . . , n. Our approximate
solution uh (x) can then be written in terms of its expansion coefficients and the basis
functions as
n
X
uh (x) = ui ϕi (x), (1.20)
i=1

where we note that this particular basis has the convenient property that uh (xj ) = uj , for
j = 1, . . . , n.
A Galerkin formulation for (1.1)-(1.2) can now be stated as: Find uh ∈ Vh such that
Z 1 Z 1
0 0
uh (x)v (x) dx = v(x) dx, ∀v ∈ Vh (1.21)
0 0

3
In particular, (1.21) should be satisfied for v = ϕi , i = 1, . . . , n, which leads to n equations
of the form
Z 1 Z 1
0 0
uh (x)ϕi (x) dx = ϕi (x) dx, for i = 1, . . . , n (1.22)
0 0
Pn
Insert the expression (1.20) for the approximate solution and its derivative, u0h (x) = 0
i=1 ui ϕi (x):
 
Z 1 X n Z 1
0 0
 uj ϕj (x) ϕi (x) dx =
 ϕx (x) dx, i = 1, . . . , n (1.23)
0 j=1 0

Change order of integration/summation:


X n Z 1  Z 1
0 0
uj ϕi (x)ϕj (x) dx = ϕi (x) dx, i = 1, . . . , n (1.24)
j=1 0 0

This is a linear system of equations Au = f , with A = [aij ], u = [ui ], f = [fi ], for


i, j = 1, . . . , n, where
Z 1
aij = ϕ0i (x)ϕ0j (x) dx (1.25)
0
Z 1
fi = ϕi (x) dx (1.26)
0

Example : Consider a triangulation of [0, 1] into four elements of width h = 1/4 between
the node points xi = ih, i = 0, . . . , 4. We then get a solution space of dimension
n = 3, and basis functions ϕ1 , ϕ2 , ϕ3 . When calculating the entries of A, note that
ˆ A is symmetric, that is, aij = aji
ˆ A is tridiagonal, that is, aij = 0 whenever |i − j| > 1
ˆ For our equidistant triangulation, aii = ajj and ai,i+1 = aj,j+1
This gives
1 1
a11 = 4 · 4 · + (−4)(−4) = 8 (1.27)
4 4
1
a12 = (−4) · 4 · = −4 (1.28)
4
a22 = a33 = a11 = 8 (1.29)
a21 = a12 = a23 = a32 = −4 (1.30)
a13 = a31 = 0 (1.31)

and
Z 1
1
f1 = f2 = f3 = ϕ1 (x) dx = (1.32)
0 4
and the linear system becomes
    
8 −4 0 u1 1/4
−4 8 −4 u2  = 1/4 (1.33)
0 −4 8 u3 1/4

4
with solution
u = (u1 , u2 , u3 )T = (3/32, 1/8, 3/32)T (1.34)
Note that the discretization exactly matches the one obtained with finite differences
and the 2nd order 3-point stencil:
    
2 −1 0 u1 1
1 
−1 2 −1   u2 = 1
  (1.35)
(1/4)2
0 −1 2 u3 1

1.4 Neumann boundary conditions


The Dirichlet conditions u(0) = u(1) = 0 where enforced directly into the approximation
space Vh . In the finite element method, a Neumann condition (or natural condition) is
instead implemented by modifying the variational formulation. Consider the model problem
−u00 (x) = f (x) for x ∈ (0, 1) (1.36)
u(0) = 0 (1.37)
0
u (1) = g (1.38)
The function space is only enforcing the Dirichlet condition at the left end point:
Vh = {v ∈ C 0 ([0, 1]) : v|K ∈ P1 (K) ∀K ∈ Th , v(0) = 0}, (1.39)
which in our example gives an additional degree of freedom. The Neumann condition
appears in the formulation after integration by parts:
Z 1 Z 1
1
û0 (x)v 0 (x) dx − û0 (x)v(x) 0 = û0 (x)v 0 (x) dx − û0 (1)v(1) + û0 (0)v(0)

(1.40)
0 0
Z 1
= û0 (x)v 0 (x) dx − gv(1) (1.41)
0
since v(0) = 0 0
and uh (1) = g. This leads to the final formulation: Find uh ∈ Vh such that
Z 1 Z 1
0 0
uh (x)v (x) dx = f (x)v(x) dx + gv(1), ∀v ∈ Vh (1.42)
0 0
Example : With our previous triangulation, we now get another basis function ϕ4 . For
simplicity, set f = g = 1. All the matrix entries and right-hand side values are then
identical, and we only calculate the new values:
1
a44 = (4)2 = 4 (1.43)
4
1
a34 = a43 = (−4) · 4 · = −4 (1.44)
4
1 9
f4 = + g · 1 = (1.45)
8 8
The linear system then becomes
    
8 −4 0 0 u1 1/4
−4 8 −4 0  u2  1/4
 0 −4 8 −4 u3  = 1/4 (1.46)
    

0 0 −4 4 u4 9/8
with solution
u = (u1 , u2 , u3 , u4 )T = (15/32, 7/8, 39/32, 3/2)T . (1.47)

5
1.5 Inhomogeneous Dirichlet problems
Use two spaces: Vh , which enforces the inhomogeneous Dirichlet condition, for the solu-
tion uh , and Vh0 , which enforces homogeneous Dirichlet conditions, for the test function v.
Consider for example the model problem

−u00 (x) = f, for x ∈ (0, 1) (1.48)


u(0) = 0 (1.49)
u(1) = 1 (1.50)

with exact solution u(x) = x(3 − x)/2. Use the spaces

Vh = {v ∈ C 0 ([0, 1]) : v|K ∈ P1 (K) ∀K ∈ Th , v(0) = 0, v(1) = 1}, (1.51)


Vh0 0
= {v ∈ C ([0, 1]) : v|K ∈ P1 (K) ∀K ∈ Th , v(0) = 0, v(1) = 0}. (1.52)

The FEM formulation becomes: Find uh ∈ Vh such that


Z 1 Z 1
0 0
uh v dx = f v dx, ∀v ∈ Vh0 . (1.53)
0 0

Note that the function space Vh is not a linear vector space, due to the inhomogeneous
constraint. In practice, Dirichlet conditions are implemented by first considering the all-
Neumann problem, and enforcing the Dirichlet conditions directly into the resulting system
of equations.
Example : For the model problem (1.48)-(1.50), first consider the corresponding all-
Neumann problem

−u00 (x) = f, for x ∈ (0, 1) (1.54)


0 0
u (0) = u (1) = 0 (1.55)

with the solution space

Vh = {v ∈ C 0 ([0, 1]) : v|K ∈ P1 (K) ∀K ∈ Th }. (1.56)

In our example with four elements of size h = 1/4, this gives 5 degrees of freedom and
the resulting linear system (with f = 1):
    
4 −4 0 0 0 u1 1/8
−4 8 −4 0 0 u2  1/4
   

 0 −4 8 −4 0  u3  = 1/4 (1.57)
    
0 0 −4 8 −4 u4  1/4
0 0 0 −4 4 u5 1/8
This system is singular (since the solution is undetermined up to a constant). We can
now impose the Dirichlet conditions u(0) = 0 and u(1) = 1 directly by replacing the
corresponding equations:
    
1 0 0 0 0 u1 0
−4 8 −4 0 0 u2  1/4
   

 0 −4 8 −4 0  u3  = 1/4 (1.58)
    
0 0 −4 8 −4 u4  1/4
0 0 0 0 1 u5 1

6
We can keep the symmetry of the matrix by eliminating the entries below/above the
diagonal of the Dirichlet variables:
      
1 0 0 0 0 u1 0 0
0 8 −4 0 0 u2  1/4 − (−4) · 0  1/4 
      
0 −4 8 −4 0 u3  =  1/4  =  1/4  (1.59)
      
0 0 −4 8 0 u4  1/4 − (−4) · 1 17/4
0 0 0 0 1 u5 1 1

with solution u = (u1 , . . . , u5 )T = (0, 11/32, 5/8, 27/32, 1)T . If necessary, the Dirichlet
degress of freedom can be removed from the system, to obtain the smaller system of
equations
    
8 −4 0 u2 1/4
−4 8 −4 u3  =  1/4  (1.60)
0 −4 8 u4 17/4

1.6 The stamping method (“Assembly”)


Consider a single element ek , and its local basis functions Hik (x), j = 1, 2, given by the
restriction of the global basis functions ϕj (x) to the element. The connection between the
local indices i and the global indices j are given by a mesh representation. For simplex
elements, we use the form
ˆ p: N × D node coordinates
ˆ t: T × (D + 1) element indices
Here, row k of t is the local-to-global mapping for element k. The local basis functions are:
ˆ Defined only inside the element ek
ˆ Polynomials of degree 1
We can then define an elemental matrix Ak , or a local stiffness matrix, by again considering
only the contribution to the global stiffmatrix from element ek :
Z
k
Aij = (Hik )0 · (Hjk )0 dx, i = 1, 2, j = 1, 2 (1.61)
ek

and, similarily, an elemental load vector bk by


Z
k
bi = f (x) · (Hik ) dx, i = 1, 2 (1.62)
ek

In the so-called stamping method, or the assembly process, each element matrix and
load vector are added at the corresponding global position in the global stiffness matrix and
right-hand side vector:
A = 0, b = 0
for all elements k
Calculate Ak , bk
A(t(k, :), t(k, :)) += Ak
b(t(k, :)) += bk
end for

7
Example : Equidistant 1D mesh, element width h, piece-wise linears, f = 1. The elemental
matrix and load vector are
   
k 1 1 −1 k h 1
A = , b = (1.63)
h −1 1 2 1
The mesh is represented by the arrays
   
x0 1 2
 x1  2 3 
p =  . , t = . (1.64)
   
 ..   ..


xn n n+1
The stamping method gives the global matrices:
1 −1
 
1 −1 1 −1
   
−1 2 −1 
−1 1  −1 2 −1   
     −1 2 −1 
1  1  −1 1  1  
 →  →  −1 1 
h


 h 


 h


     
 

1 −1
 
−1 2 −1 
 
 −1 2 −1 
1 
→ 
 −1 2 −1 =A (1.65)
h 
 −1 2 −1 

 −1 2 −1
−1 1
and, similarily, the right-hand side vector
h T
b= 1 2 ··· 2 1 (1.66)
2

1.7 Higher order


Introduce the space of continuous piece-wise quadratics:

Vh = {v ∈ C 0 (Ω) : v|K ∈ P2 (K) ∀K ∈ Th }. (1.67)

Parameterize by adding degrees of freedom at element midpoints. Each element then has
three local nodes: xk1 , xk2 , xk3 , and three local basis functions H1k (x), H2k (x), H3k (x). These
are determined by solving for the polynomial coefficients in

Hik = ai + bi x + ci x2 , i = 1, 2, 3 (1.68)

and requiring that Hik (xj ) = δij , for each i, j = 1, 2, 3. The leads to the linear system of
equations V C = I:
x21
    
1 x1 a1 a2 a3 1 0 0
1 x2 x22   b1 b2 b3  = 0 1 0 (1.69)
1 x3 x23 c1 c2 c3 0 0 1

8
which gives the coefficients C = V −1 . For example, with x1 = 0, x2 = h/2, x3 = h, we get
2 h
H1 (x) = 2
(x − )(x − h) (1.70)
h 2
4
H2 (x) = − 2 x(x − h) (1.71)
h
2 h
H3 (x) = 2 x(x − ) (1.72)
h 2
The corresponding element matrix and the element load can then be calculated as before:
Z h Z h
k k 0 k 0 k
Aij = Hi (x) Hj (x) dx, bi = f (x)Hik (x) dx (1.73)
0 0

for i, j = 1, 2, 3, which gives


   
7 −8 1 1
1 h
Ak = −8 16 −8 , bk = 4 (1.74)
3h 6
1 −8 7 1
For a global element with two elements of width h, the stamping method gives the stiff
matrix and right-hand side vector
   
7 −8 1 1
−8 16 −8   4 
1 
 1 −8 7 + 7 −8 1  ,
 h  
A= b=  1 + 1 (1.75)
3h 
  6 
−8 16 −8  4 
1 −8 7 1

1.8 Numerical Quadrature


For more general cases, the integrals cannot be computed analytically. We then use Gaussian
quadrature rules of the following form (not necessarily the same f as above):
Z 1 n
X
f (x) dx ≈ wi f (xi ) (1.76)
−1 i=1

when xi , wi , i = 1, . . . , n are specified points and weights. By choosing xi as the zeros of the
nth Legendre polynomial, and the weights such that the rule exactly integrates polynomials
up to degree n−1, the rule (1.76) gives exact integration for polynomials of degree ≤ 2n−1.
For example, the following rule has n = 2 and degree of precision 2 · 2 − 1 = 3:
Z 1
1 1
f (x) dx ≈ f (− √ ) + f ( √ ) (1.77)
−1 3 3
In our quadratic element example, the integrals for the element matrix were products of
derivatives of quadratics, that is, quadratics. Therefore they can be exactly evaluated using
this rule:
"   2 # Z h
2 3h
Ak11 = Set f (x) = 2 2x − = f (x) dx (1.78)
h 2 0
 
h h h h h 7
= f( − √ ) + f( + √ ) = · · · = (1.79)
2 2 2 3 2 2 3 3h

9
2 The Poisson Problem in 2-D
ˆ Consider the problem

−∇2 u = f in Ω (2.1)
n · ∇u = g on Γ (2.2)

for a domain Ω with boundary Γ

ˆ Introduce the space of piecewise linear continuous functions on a mesh Th :

Vh = {v ∈ C 0 (Ω) : v|K ∈ P1 (K) ∀K ∈ Th }. (2.3)

ˆ Seek solution uh ∈ Vh , multiply by a test function v ∈ Vh , and integrate:


Z Z
−∇2 uh v dx = f v dx (2.4)
Ω Ω

ˆ Apply the divergence theorem and use the Neumann condition, to get the Galerkin
form
Z Z I
∇uh · ∇v dx = f v dx + gv ds (2.5)
Ω Ω Γ

2.1 Finite Element Formulation


ˆ Expand in basis uh = i uh,i ϕi (x), insert into the Galerkin form, and set v = ϕi ,
P
i = 1, . . . , n:
 
Z X n Z I
 uh,j ∇ϕj · ∇ϕi dx =
 f ϕi dx + gϕi ds (2.6)
Ω j=1 Ω Γ

Switch order of integration and summation to get the finite element formulation:
n
X
Aij uh,j = bi , or Au = b (2.7)
j=1

where
Z Z I
Aij = ∇ϕi · ∇ϕj dx, bi = f ϕi dx + gϕi ds (2.8)
Ω Ω Γ

2.2 Discretization
ˆ Find a tringulation of the domain Ω into triangular elements T k , k = 1, . . . , K and
nodes xi , i = 1, . . . , n

ˆ Consider the space Vh of continuous functions that are linear within each element

ˆ Use a nodal basis Vh = span{ϕ1 , . . . , ϕn } defined by

ϕi ∈ Vh , ϕi (xj ) = δij , 1 ≤ i, j ≤ n (2.9)

10
ˆ A function v ∈ Vh can then be written
n
X
v= vi ϕi (x) (2.10)
i=1

with the nodal interpretation


n
X n
X
v(xj ) = vi ϕi (xj ) = vi δij = vj (2.11)
i=1 i=1

2.3 Local Basis Functions


ˆ Consider a triangular element T k with local nodes xk1 , xk2 , xk3
ˆ The local basis functions H1k , H2k , H3k are linear functions:
Hαk = ckα + ckx,α x + cky,α y, α = 1, 2, 3 (2.12)
with the property that Hαk (xβ ) = δαβ , β = 1, 2, 3
ˆ This leads to linear systems of equations for the coefficients:
 k   
1 xk1 y1k
    
cα 1 0 0
1 xk2 y2k   ckx,α  = 0 or 1 or 0 (2.13)
1 xk3 y3k xky,α 0 0 1
or C = V −1 with coefficient matrix C and Vandermonde matrix V

2.4 Elementary Matrices and Loads


ˆ The elementary matrix for an element T k becomes
k k
∂Hαk ∂Hβ ∂Hαk ∂Hβ
Z
Akαβ = + dx (2.14)
T k ∂x ∂x ∂y ∂y
= Areak (ckx,α ckx,β + cky,α cky,β ), α, β = 1, 2, 3 (2.15)

ˆ The elementary load becomes


Z
k
bα = f Hαk dx (2.16)
Tk
= (if f constant) (2.17)
k
Area
= f, α = 1, 2, 3 (2.18)
3

11
2.5 Assembly, The Stamping Method
ˆ Assume a local-to-global mapping t(k, α), giving the global node number for local
node number α in element k

ˆ The global linear system is then obtained from the elementary matrices and loads by
the stamping method:

A = 0, b = 0
for k = 1, . . . , K
A(t(k, :), t(k, :)) = A(t(k, :), t(k, :)) + Ak
b(t(k, :)) = b(t(k, :)) + bk

xt(k,2) xt(k,1)

Tk

xt(k,3)

2.6 Dirichlet Conditions


ˆ Suppose Dirichlet conditions u = uD are imposed on part of the boundary ΓD

ˆ Enforce uh,i = uD for all nodes i on ΓD directly in the linear system of equations:

i
   
   
   
0 · · ·
i  0 1 0 ··· uD 
0 uh = 
  (2.19)
   

ˆ Eliminate below/above diagonal of the Dirichlet nodes to retain symmetry

3 FEM Theory
3.1 Variational and minimization formulations
Consider the Dirichlet problem (D)

−∇2 u = f in Ω (3.1)
u = 0 on Γ (3.2)

12
Introduce the notation
Z
a(u, v) = ∇u · ∇v dx (bilinear form) (3.3)
ZΩ
`(v) = f v dx (linear form) (3.4)

Note that

a(u1 + u2 , v) = a(u1 , v) + a(u2 , v) (bilinearity) (3.5)


`(v1 + v2 ) = `(v1 ) + `(v2 ) (linearity) (3.6)
a(u, v) = a(v, u) (symmetry) (3.7)

Also,
Z
a(u, u) = k∇uk22 dx ≥ 0, (3.8)

and if u = 0 on Γ, then equality only for u = 0. This can then be used to define the energy
norm
p
k|uk| ≡ a(u, u) (3.9)

Now, define the spaces


Z
L2 (Ω) = {v : v is defined on Ω and v 2 dx < ∞} (3.10)

∂v
H 1 (Ω) = {v ∈ L2 (Ω) : ∈ L2 (Ω) for u = 1, . . . , d} (3.11)
∂xi
H01 (Ω) = {v ∈ H 1 (Ω) : v = 0 on Γ} (3.12)

where d is the number of space dimensions. Let V = H01 . The solution u to (D) then
satisfies a corresponding variational problem (V):

Find u ∈ V s.t. a(u, v) = `(v) ∀v ∈ V (3.13)

This is also called the weak form of (D), with a weak solution u. Note that a solution u of
(D) is also a solution of (V), since for any v ∈ V :
Z Z
2
−∇ uv dx = f v dx (3.14)
Z I Ω ZΩ

∇u · ∇v dx − n · ∇u v ds = f v dx (3.15)
Ω Z Γ ZΩ

∇u · ∇v dx = f v dx (3.16)
Ω Ω
a(u, v) = `(v) (3.17)

where we used the fact that v = 0 on Γ. The reverse can also be shown, (V) =⇒ (D), if u
is sufficiently regular.
Now consider the minimization problem (M):
1
Find u ∈ V s.t. F (u) ≤ F (v) ∀v ∈ V, where F (v) = a(v, v) − `(v) (3.18)
2

13
Suppose u solves (V). Then it also solves (M), since for any v ∈ V , set w = v − u ∈ V , and
1
F (v) = F (u + w) = a(u + w, u + w) − `(u + w) (3.19)
2
1 1 1 1
= a(u, u) + a(u, w) + a(w, v) + a(w, w) − `(u) − `(w) (3.20)
2 2 2 2
1 1
= a(u, u) − `(u) + a(u, w) − `(w) + a(w, w) ≥ F (u) (3.21)
|2 {z } | {z } |2 {z }
=0 ∀w∈V
F (u) ≥0

The reverse can also easily be shown, that is, (M) =⇒ (V).

3.2 FEM formulation


Now define the FEM formulation

Find uh ∈ Vh s.t. a(uh , v) = `(v) ∀v ∈ Vh (3.22)

for some finite-dimensional subspace Vh of V . Recall that the solution u to (V) satisfies
a(u, v) = `(v) for all v ∈ V , and in particular for all v ∈ Vh , we have

a(u − uh , v) = 0 ∀v ∈ Vh , (3.23)

or a(e, v) = 0 with the error e = u − uh . This means that the error also satisfies a
corresponding minimization problem (M), with `(v) = 0, which leads to the property:
1 1
a(v, v) − 0 = k|vk|2 is minimized by v = u − uh = e (3.24)
2 2
In other words, for any wh ∈ Vh , k|u − wh k| ≥ k|u − uh k|, or the FEM formulation finds the
best possible solution in the energy norm.
More generally, for any Hilbert space V with corresponding norm k · kV , we require that

(i) a(·, ·) is symmetric

(ii) a(·, ·) is continuous, i.e., ∃γ > 0 s.t. |a(v, w)| ≤ γkvkV kwkV , ∀v, w ∈ V

(iii) a(·, ·) is V -elliptic, i.e., ∃α > 0 s.t. a(v, v) ≥ αkvk2V , ∀v ∈ V

(iv) `(·) is continuous, i.e., ∃Λ > 0 s.t. |L(v)| ≤ ΛkvkV , ∀v ∈ V

The energy norm k| · k| is then equivalent to k · kV , that is, ∃c, C > 0 s.t.

ckvkV ≤ k|vk| ≤ CkvkV ∀v ∈ V (3.25)


√ √
for example with c = α and C = γ. This gives
γ
ku − uj kV ≤ ku − vkV ∀v ∈ Vh (3.26)
α

14
3.3 Interpolants
Consider a 1-D function w ∈ V and its linear interpolant wI ∈ Vh , where Vh is a space of
piecewise linear functions, defined by wI (xi ) = w(xi ), or
n
X
wI (x) = w(xi )ϕi (x) (3.27)
i=1

To find a bound on the energy norm of the difference w − wI , we first bound the derivative.
Consider a single element, and note that the difference w − wI is zero at the endpoints. A
point x = z must then exists, such that

[w(z) − wI (z)]0 = 0 (3.28)

For any other point x inside the element, we then have from the fundamental theorem of
calculus,
Z x
[w(x) − wI (x)]0 = [w(y) − wI (y)]00 dy (3.29)
z

but wI (y) is linear, so wI00 (y) = 0 and


Z x
[w(x) − wI (x)]0 = w00 (y) dy (3.30)
z

If the element width is h, this gives the bound

[w(x) − wI (x)]0 ≤ h max |w00 | (3.31)

A bound for the energy norm of w − wI can then be derived as follows. Note that the
number of elements T can be written as C1 /h, for some constant C1 .
T Z
2
X C1
k|w − wI k| = [(w − wI )0 ]2 dx ≤ · h · h2 · [max |w00 |]2 (3.32)
ek h
k=1
= C1 h2 [max |w00 |]2 (3.33)

or

k|w − wI k| ≤ Ch max |w00 | (3.34)

3.4 FEM error bounds


For a finite element solution uh , the optimality in the energy norm and the boundary on
the interpolat leads to

k|u − uh k| ≤ k|u − uI k| ≤ Kh max |u00 | = O(h) (3.35)

This implies convergence in the energy norm, at a linear rate w.r.t. the element sizes h.
This result does not imply that the solution itself in, for example, the L2 -norm is
quadratically convergent. However, using other techniques it can be shown that

ku − uh kL2 = O(h2 ) (3.36)

under suitable assumptions.

15
3.5 2-D interpolants
For piecewise interpolant on a triangular mesh in 2-D, it can be shown that

k|w − wI k| ≤ ChkwkH 2 (3.37)


2
kw − wI kL2 ≤ Ch kwkH 2 (3.38)

which again leads to the energy norm bound for a finite element solution uh

k|u − uh k| ≤ C1 hkukH 2 (3.39)

However, two new problems appear in 2-D:


ˆ “Bad elements”, consider e.g. interpolation of the function w(x, y) = x2 on a triangle
with corners at (x, y) = (−1, 0), (1, 0), and (0, ε). Since w(−1, 0) = w(1, 0) = 1, linear
interpolation gives wI (0, 0) = 1. But w(0, ε) = 0, so the derivative along the y-axis:
∂wI 1
(0, 0) = − → −∞ as θ → 180◦ (3.40)
∂y ε
where θ is the top angle. This does not affect the linear convergence of the energy
norm as h → 0, since the worst angle θ remains fixed, but it can cause a large constant
C1 if the mesh contains bad elements.

ˆ Lack of regularity of the solution, or geometry-induced singularities. For example on


a domain with convex corners, it can be shown that kukH 2 is not bounded which
reduces the convergence rate of the FEM solution.

4 Some extensions
4.1 Higher order elements in 2D
For the piecewise linear case on triangular meshes, we parameterized the space of continuous
functions as:
ˆ Representing a solution ui at the global nodes xi

ˆ Using a uniquely defined linear function u(x, y) = a + bx + cy on each triangle, from


the 3 corner nodes

ˆ Continuity is enforced since the node values are single-valued, and along an edge
between two elements there is a uniquely defined linear function.
This extends natually to piecewise quadratic elements:
ˆ Introduce the edge midpoints as global nodes

ˆ Each triangle is now associated with 6 nodes, with determines a unique quadratic
function u(x, y) = a + bx + cy + dx2 + exy + f y 2

ˆ Continuity obtained since along an edge, there is a uniquely defined quadratic


This can be generalized to Lagrange elements of any degree p in any dimension D, using
p+D
D nodes in a regular pattern.

16
4.2 Other PDEs
Consider the more general linear parabolic PDE:
∂u
ρ − ∇ · (D∇u + αu) + au = f in Ω (4.1)
∂t
with boundary conditions

n · (D∇u + αu) = g on ΓN (4.2)


u = uD on ΓD (4.3)

Note that the fields rho, D, α, g, and uD in general are time and space dependent.
A standard FEM formulation for (4.1) is: Find uh ∈ Vh s.t.
Z Z Z Z Z
ρu˙h v dx + (D∇uh + αuh ) · ∇v dx + auh v dx = f v dx + gv ds (4.4)
Ω Ω Ω Ω ΓN

for all v ∈ V0,h , where Vh is an appropriate finite dimensional space satisfying the Dirichlet
conditions. Considering the all-Neumann problem, discretization with basis functions ϕi (x)
leads to the linear system of ODEs

Mρ u̇ + Ku + Cu + Ma u = f + g (4.5)

where
Z
Mρ,ij = ρϕi ϕj dx (4.6)
ZΩ
Ma,ij = aϕi ϕj dx (4.7)
ZΩ
Kij = (D∇ϕj ) · ∇ϕi dx (4.8)
ZΩ
Cij = (αϕj ) · (∇ϕi ) dx (4.9)
ZΩ
fi = f ϕi dx (4.10)
IΩ
gi = gϕi ds (4.11)
Γ

This can be integrated in time using method of lines, with e.g. a BDF method or an implicit
Runge-Kutta. Note that explicit methods can be used, but they require inversion of Mρ
and will put stability constrains on the timestep.

17

You might also like