lecture_00_fem_introduction
lecture_00_fem_introduction
1 / 33
What is FEM?
• Integral equations
• PDE → Ax = b
2 / 33
The FEM cookbook
(i)
3 / 33
The PDE (i)
Consider Poisson’s equation, the Hello World of partial
differential equations:
−∆u = f in Ω
u = u0 on ∂Ω
We find that: Z Z
∇u · ∇v dx = f v dx
Ω Ω
5 / 33
The variational problem (ii)
for all v ∈ V̂
The trial space V and the test space V̂ are (here) given by
V = {v ∈ H 1 (Ω) : v = u0 on ∂Ω}
V̂ = {v ∈ H 1 (Ω) : v = 0 on ∂Ω}
6 / 33
From continuous (ii) to discrete (iii) problem
Vh ⊂ V
V̂h ⊂ V̂
7 / 33
From discrete variational problem (iii) to
discrete system of equations (iv)
Choose a basis for the discrete function space:
Vh = span {φj }N
j=1
8 / 33
From discrete variational problem (iii) to
discrete system of equations (iv), contd.
Rearrange to get:
N
X Z Z
Uj ∇φj · ∇φi dx = f φi dx
j=1 |Ω {z } | Ω {z }
Aij bi
Au = f in Ω
AU = b
Aij = a(φj , φi )
bi = L(φi )
10 / 33
Important topics
• How to choose Vh ?
• How to solve AU = b?
11 / 33
How to choose Vh
12 / 33
Finite element function spaces
uh
13 / 33
The finite element definition (Ciarlet 1975)
on T of dimension n
a basis for the dual space V 0 ; that is, the space of bounded
linear functionals on V
14 / 33
The finite element definition (Ciarlet 1975)
T V L
v(x̄)
v(x̄) · n
R
T v(x)w(x) dx
15 / 33
The linear Lagrange element: (T, V, L)
16 / 33
The linear Lagrange element: L
17 / 33
The linear Lagrange element: Vh
uh (x, y)
T = {T }
18 / 33
The quadratic Lagrange element: (T, V, L)
19 / 33
The quadratic Lagrange element: L
20 / 33
The quadratic Lagrange element: Vh
21 / 33
Families of elements
22 / 33
Families of elements
23 / 33
Computing the sparse matrix A
24 / 33
Naive assembly algorithm
A=0
for i = 1, . . . , N
for j = 1, . . . , N
Aij = a(φj , φi )
end for
end for
25 / 33
The element matrix
Aij = a(φj , φi )
26 / 33
The local-to-global mapping
The global matrix ιT is defined by
I = ιT (i)
3 3
8
7
5 9 4
4
9 5
1
1
6 2
6
5 2 1 3
6
2 2
27 / 33
The assembly algorithm
A=0
for T ∈ T
Add AT to A according to ιT
end for
28 / 33
Adding the element matrix AT
ι1T (1) 2
3
ι1T (2)
AT,32
ι1T (3)
29 / 33
Solving AU = b
30 / 33
Direct methods
• Gaussian elimination
• Requires ∼ 2 3
3N operations
• LU factorization: A = LU
• Solve requires ∼ 2 3
3N operations
• Reuse L and U for repeated solves
• Solve requires ∼ 1 3
3N operations
• Reuse L for repeated solves
31 / 33
Iterative methods
Krylov subspace methods
• GMRES (Generalized Minimal RESidual method)
• CG (Conjugate Gradient method)
• Works if A is symmetric and positive definite
Multigrid methods
• GMG (Geometric MultiGrid)
Preconditioners
• ILU, ICC, SOR, AMG, Jacobi, block-Jacobi, additive
Schwarz, . . .
32 / 33
Which method should I use?
Rules of thumb
33 / 33