Sei sulla pagina 1di 94

Finite Elements - A Crash Course

Mats G Larson
mgl@math.chalmers.se

Chalmers Finite Element Center


and
Fraunhofer Chalmers Centre for Industrial Mathematics

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.1


Outline
• Function Spaces
• Function Approximation
• Finite Elements
• Time Dependent Problems
• Stabilized Methods
• Mixed Methods
• Systems of PDE

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.2


Linear Functions
Let P1 (I) be the space of linear functions on the
interval I = [a, b].

A natural basis for P1 (I) is {λ1 , λ2 }, where


b−x x−a
λ1 (x) = , λ2 (x) = ,
b−a b−a
because any v(x) ∈ P1 (I) can be written:
v(x) = v(a)λ1 (x) + v(b)λ2 (x)

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.3


Interval Partition
For a given interval I = [a, b] let
a = x0 < x1 < x2 < . . . < xN = b,
be a partition of I into intervals Ii = (xi−1 , xi ) of
length hi = xi − xi−1 .

a = x0 x1 x2 x3 xi−1 xi xi+1 xN −1 xN = b

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.4


Continuous Piecewise Linears
Define Vh as the space of all continuous piecewise
linear functions on I
Vh = {v ∈ C(I) : v|Ij ∈ P1 (Ij )}
Example: Piecewise linear continuous function

0.0 2.0 4.0 6.0 8.0

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.5


Nodal Basis
A basis for Vh is defined by

1, if i = j,
ϕi (xj ) =
0, if i 6= j.
Basis functions (hat functions) are locally supported
ϕi−1 (x) ϕi (x) ϕi+1 (x)

xi−2 xi−1 xi xi+1 xi+2

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.6


Function Construction
Scale and add basis functions together
2.0
9
ϕ (x)
4 1
1.0

x0 x1 x2 x3 x4 x5 x6 x7
Linear combination of basis functions
9 13
v(x) = (ϕ0 + ϕ9 ) + (ϕ1 + ϕ8 )
4 8
5
+ ϕ2 + ϕ7 + (ϕ4 + ϕ6 )
8

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.7


Function Construction, cnt
Resulting function v(x) continuous piecewise linear
2.0

1.0

x0 x1 x2 x3 x4 x5 x6 x7
Every function v ∈ Vh can be written:
N
X
v(x) = v(xi )ϕi (x)
i=0

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.8


Generalizing to 2 Dimensions
Given a domain Ω ⊂ R2 we construct partition into
triangles, viz.
2.5

1.5

0.5

−0.5

−1

−1.5

−2

−2.5
−1 0 1 2 3 4 5

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.9


Triangulations
Basic data structures of a triangulation

1. A set of nodes P = {pi } (the triangle vertices)


Node i defined by its coordinates pi = (xi , yi )
MESH dimension 2 ElemType Triangle Nnode 3

Coordinates
0.000000 0.000000
0.250000 0.000000
0.250000 0.250000
0.500000 0.250000
0.500000 0.500000

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.10


Triangulations, cnt
2. A set of elements K = {Ki } (triangles)
Triangle corner indices stored (connectivity)
Elements
1 2 3
1 3 4
4 3 5
4 5 6
7 9 8

Local mesh size defined by hK = diam(K).


Smallest angle of K denoted αK . Assume αK ≥ α0 > 0 for some constant α0 .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.11


Linear functions on a triangle
Let
P1 (K) = {v(x1 , x2 ) = a0 + a1 x1 + a2 x2 }
be the space of linear functions on triangle K.

Using nodal basis defined by



1, if j = i,
λi (pj ) =
0, if j 6= i,
any function v(x1 , x2 ) ∈ P1 (K) can be written
3
X
v(x1 , x2 ) = v(pi )λi (x1 , x2 )
i=1
Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.12
Linear functions, cnt
Example: If p1 = (0, 0), p2 = (1, 0) and p3 = (0, 1)
then
λ1 = 1 − x 1 − x2 , λ2 = x1 , λ3 = x2 .
Function v = x1 + 3x2 is linear combination of bases
3

2.5 v = λ2 + 3λ3
2

1.5

PSfrag replacements 1

0.5

0
1 1
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2

x2 0 0
x1

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.13


Piecewise Continuous Linear
Functions on a Triangulation
On a given triangulation let
Vh = {v ∈ C(Ω) : v(x)|K∈K ∈ P1 (K)}
be the space of piecewise linear continous functions.

Defining a set of basis functions for Vh by



1, if j = i,
ϕi (pj ) =
0, if j 6= i,
any v ∈ Vh can be expressed as:
N
X
v(x) = v(xi )ϕi (x)
i=0
Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.14
Basis Function
A basis function of Vh (tent function)

0.8 ϕi (x1 , x2 )
0.6

0.4

PSfrag replacements 0.2

0
1
0.8 1
0.6 0.8
0.4 0.6
0.4
0.2
0.2
x2 0 0
x1

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.15


Functions on a Triangulation
Example: Continuous piecewise linear function on a
triangulation.

v
0

−2

PSfrag replacements −4

−6

−8
3
2
4
1
3
0 2
−1 1
−2 0
x2 −3 −1
x1

At nodes pj function v(x1 , x2 ) = x1 x2 .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.16


Bilinear Elements
Triangulation can also be a quadrilateral mesh.

Let B1 (K) be the space of bilinear functions, i.e.


B1 (K) = {v(x) = a0 + a1 x1 + a2 x2 + a3 x1 x2 },
on a quadrilateral element K.

Basis defined by

1, if j = i,
λi (pj ) =
0, if j 6= i.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.17


Bilinear Elements, cnt
On the reference element K = [−1, 1] × [−1, 1]:
λ1 = 14 (1 + x1 )(1 + x2 )
λ2 = 14 (1 − x1 )(1 + x2 )
λ3 = 14 (1 + x1 )(1 − x2 )
λ4 = 14 (1 − x1 )(1 − x2 )

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.18


Other Elements
• Discontinuous elements (piecewise constants)
• Higher order polynomials (quadratics, cubics)
• ∇× conforming elements (electromagnetics)
• Beam-plate-shell elements (solid mechanics)

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.19


Function approximations
Given a function f , find approximation to f in Vh .

Possible approximation methods:


• Interpolation - minimize error pointwise

• Projection - minimize error norm over subspace.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.20


Interpolation
Defined by interpolation operator π
π : C(Ω) → Vh ,
such that the interpolant πv of v(x) satisfies
N
X
πv(x) = v(xi )ϕi (x)
i=0

where {xi }N
0 is a set of nodes and {ϕ N
i 1 a basis of Vh .
}

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.21


Interpolation Error Estimate
Interpolation error satisfies
kv − πvkt ≤ Chs−tkvks ,
where h is meshsize and C a constant.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.22


L2-projection
Given a function f we seek its projection P f onto Vh .

Error e = f − P f should be orthogonal to all v ∈ Vh ,


(f − P f, v) = 0,
Z
for all v ∈ Vh . Here (v, w) = vw dx.

Find projection P f ∈ Vh to f such that
(f, v) = (P f, v)
for all v ∈ Vh .

Question: How can we compute P f ?


Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.23
L2-projection, cnt
Note that (f, v) = (P f, v) is equivalent to
(f, ϕi ) = (P f, ϕi )
for all ϕi , i = 1, 2, . . . , N .

Recall also that


N
X
P f (x) = ξj ϕj (x)
j=1

with unknown coefficients ξj .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.24


L2-projection, cnt
We obtain
N
X
bi = (f, ϕi ) = ξj (ϕj , ϕi )
j=1
N
X
= mij ξj , i = 1, 2, . . . , N,
j=1

which is just a linear system of equations:


Mξ = b

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.25


L2-projection, cnt
Example: L2 -approximation of x sin 3πx
1.5

0.5

−0.5

PSfrag replacements
−1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
x

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.26


Basic Error Estimates
Projection P f is best approximation to f over Vh .
kf − P f k ≤ kf − vk,
for all v ∈ Vh .

Proof:
kf − P f k2 = (f − P f, f − P f )
≤ (f − P f, f − v) + (f − P f, v − P f )
| {z }
0 orthogonality
≤ kf − P f kkf − vk
where kuk2 = (u, u).

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.27


Basic Error Estimates, cnt
Choose v = πf to get error estimate
kf − P f k ≤ kf − πf k ≤ khs f ks .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.28


Model Problem (Poisson)
Find u such that
−∆u = f, in Ω,
u = 0, on ∂Ω,
where f is a given function, and
∂ 2u ∂ 2u
∆u = 2 + 2 .
∂x ∂y

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.29


Variational statement
Let H01 be the Hilbert space defined by
H01 (Ω) = {v : kvk2 + k∇vk2 < ∞, v |∂Ω = 0}.
Multiply −∆u = f by function v ∈ H01 and use that
Z Z Z Z
fv = −∆uv = ∇u · ∇v − ∂n uv,
Ω Ω Ω ∂Ω
i.e. integration by parts.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.30


Variational statement
Using that v = 0 on ∂Ω, we get variational form.

Variational Statement: Find u ∈ H01 such that


Z Z
fv = ∇u · ∇v,
Ω Ω

for all v ∈ H01 .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.31


Finite Elements
Finite elements are obtained by replacing H01 by Vh .

Finite Element Method: Find U ∈ Vh such that


Z Z
fv = ∇U · ∇v,
Ω Ω
for all v ∈ Vh .

Question: How can we compute U ?

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.32


Finite Elements, cnt
First note that the problem is equivalent to
(∇U, ∇ϕi ) = (f, ϕi ) i = 1, . . . , N,
and that
N
X
U= ξj ϕj (x)
j=1

with unknown coefficients ξj .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.33


Finite Elements, cnt
This gives the problem
N
X
bi = (f, ϕi ) = ξj (∇ϕj , ∇ϕi )
j=1
N
X
= aij ξj , i = 1, 2, . . . , N,
j=1

i.e. a linear system of equations


b = Aξ

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.34


Finite Elements, cnt
Example: Solution of Poisson problem on
Ω = [0, 1] × [0, 1].

0.07

0.06

0.05

U
0.04

0.03

PSfrag replacements 0.02

0.01

0
1
0.8 1
0.6 0.8
0.4 0.6
0.4
0.2
0.2
x2 0 0
x1

Here f = 1 with boundary condition u = 0 on ∂Ω.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.35


Galerkin Orthogonality
Note that we have
Z Z
∇u · ∇v = f v,
ZΩ ZΩ
∇U · ∇v = f v,
Ω Ω
so
Z
∇(u − U ) · ∇v = 0,

for all v ∈ Vh . Error e = u − U is orthogonal to Vh .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.36


Energy Error Estimate
Mechanical analogy: Energy norm defined by
Z
kuk2E = k∇uk2 = |∇u|2 .

Convienient measure of error e = u − U .

Basic error estimate


k∇(u − U )k ≤ k∇(u − v)k,
for all v ∈ Vh .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.37


Energy Error Estimate, cnt
Proof:
Z
k∇(u − U )k2 = ∇(u − U ) · ∇(u − U )
ZΩ
= ∇(u − U ) · ∇(u − v + v − U )
ZΩ
= ∇(u − U ) · ∇(u − v)

≤ k∇(u − U )k k∇(u − v)k,
thus
k∇(u − U )k ≤ k∇(u − v)k.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.38


L2-Error Estimate
Based on dual problem
−∆φ = e, in Ω,
φ = 0, on ∂Ω.
Dual solution φ gives error estimate
k∇ek2 = (∇e, ∇e)
= (∇e, ∇(φ − πφ))
≤ k∇ekk∇(φ − πφ)k
≤ Chk∇ek
≤ Ch2 |u|2 .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.39


Robin and Neumann BC
Consider problem of finding u such that
−∆u = f, in Ω,
u = 0, on Γ1 ,
∂n u + au = g, on Γ2 ,
where f , a and g are given data and Γ1 ∪ Γ2 = ∂Ω.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.40


Robin and Neumann BC, cnt
Integration by parts gives variational statement
Z Z
f v = − ∆uv
Ω Z Ω Z
= ∇u · ∇v − ∂n uv
ZΩ ZΓ2
= ∇u · ∇v − (g − au)v.
Ω Γ2

Find u such that


Z Z Z Z
∇u · ∇v + auv = fv + gv.
Ω Γ2 Ω Γ2

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.41


Robin and Neumann BC, cnt
Example: Solution of Poisson problem on
Ω = [0, 1] × [0, 1].

0.5

0.4

0.3

U 0.2

PSfrag replacements 0.1

0
1
0.8 1
0.6 0.8
0.4 0.6
0.4
0.2
0.2
x2 0 0
x1

Here f = 1 with boundary conditions u = 0 on Γ1 ,


the x2 axis, and ∂n u = 0 on Γ2 , the rest of ∂Ω.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.42


Abstract Setting
Let V be a Hilbert space with norm k · kV .

Consider problem of finding u such that


a(u, v) = l(v)
for all v ∈ V , where a(·, ·) is bilinear form satisfying
• mkvk
V ≤ a(v, v) (coercivity)
• a(v, w) ≤ M kvk kwk
V V (continuity)
and l(v) linear functional satisfying
• |l(v)| ≤ Ckvk .
V

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.43


Abstract Setting, cnt
Example: Poisson model problem
Z Z
a(u, v) = ∇u · ∇v, l(v) = f v.
Ω Ω
Let Vh ⊂ V be a finite dimensional subspace of V .

FEM: Find u ∈ Vh such that


a(u, v) = l(v)
for all v ∈ Vh .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.44


Galerkin Orthogonality
Using abstract notations a(·, ·) and l(·) yields
a(u, v) = l(v) v ∈ V,
a(U, v) = l(v) v ∈ Vh ,
so
a(u − U, v) = 0,
for all v ∈ Vh .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.45


Equivalent Minimization
Problem of finding u such that
a(u, v) = l(v)
and minimization problem
1
min F (v) = min a(v, v) − l(v)
v∈Vh v∈Vh 2

have the same solution (Lax Milgram).

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.46


Error Estimate
Error depending on constants m and M of a(·, ·)
M
ku − U kV ≤ ku − vkV for all v ∈ Vh
m
Proof:
mku − U k2 ≤ a(u − U, u − U )
= a(u − U, u − v) + a(u − U, v − U )
| {z }
0, v−U ∈Vh
≤ M ku − U kku − vk

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.47


Time Dependent Problems
Ordinary Differential Equations

Find u : [0, T ] → Rn such that


u̇ + Au = f, 0 < t ≤ T,
u(0) = u0 .
Here A = A(t) ∈ Rn×n and f (t) ∈ Rn given function.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.48


Time Dependent Problems, cnt
Partition 0 ≤ t ≤ T into time intervals
0 = t0 < t1 < t2 < . . . < t N ,
of length kN = tN − tN −1 .

As before define a function space on the partition.

Vqc - space of continuous piecewise polynomials of


degree q.
Vqd - space of discontinuous piecewise polynomials of
degree q.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.49


Galerkin Method
d
Multiply by test function v ∈ Vq−1 and integrate to get
Z T Z T Z T
fv = u̇v + Auv,
0 0 0
d
for all v ∈ Vq−1 .

Continuous piecewise linear solution approximation.

cG(1): Find U ∈ V1c such that


Z T Z T Z T
fv = u̇v + Auv,
0 0 0

for all v ∈ V0d .


Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.50
Galerkin Method, cnt
Solution basis functions on IN = [tN −1 , tN ]
tN − t t − tN −1
ψN −1 (t) = , ψN (t) = .
kN kN
So U = UN ψN (t) + UN −1 ψN −1 (t) on IN .

Evaluate weak form on IN , i.e.


Z Z Z
fv = U̇ v + AU v,
IN IN IN

to get iteration scheme.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.51


Galerkin Method, cnt
Example: Assume A(t) = 1 and f = 0.
Z Z
0= U̇ v + Uv
Z IN IN
Z
UN − UN −1
= v+ (UN ψN + UN −1 ψN −1 ) v
IN kN IN
kN kN
= UN − UN −1 + UN + UN −1 ,
2 2
since v = 1. Crank-Nicholson iteration form
   
kN kN
1+ UN = 1 − UN −1 ,
2 2

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.52


Heat equation
Combination of time and space discretization.

Consider the Heat Equation


u̇ − ∆u = f, in Ω × [0, T ],
u(0, x) = u0 , on Ω,
u(t, .) = 0, on ∂Ω.
Multiplying by function v ∈ W with
O
2 1
W = L ([0, T ]) H (Ω)
and integrating over Ω × [0, T ] yields (next slide)

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.53


Heat Equation, cnt
Z T Z T
(u̇, v) − (∆u, v) dt = (f, v) dt.
0 0
Integration by parts and BC gives variational form.

Find u ∈ W such that


Z T Z T
(u̇, v) + a(u, v) dt = (f, v) dt,
0 0
u(0, x) = u0 ,
for every v ∈ W.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.54


Finite Element Approximation
• Let V p ⊂ H 1 (Ω) denote the space of piecewise
continuous functions of order p.

Standard nodal basis of V 1 .


ϕj−1 (x) ϕj (x) ϕj+1 (x)

sj−2 sj−1 sj sj+1 sj+2

• On each space-time slab SN = IN × Ω, define


q
X
WNq = {w : w = tj vj (s), vj ∈ V p , (t, s) ∈ SN }.
j=0
Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.55
Finite Element, cnt

tN
tN −1 SN

s0 s1 sj sm
Figure: Space-time discretization.

• Let W q ⊂ W denote the space of functions on


q
[0, T ] × Ω such that v |SN ∈ WN for every N .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.56


Finite Element Problem
FEM: Find U ∈ W q such that
Z Z
(U̇ , v) + a(U, v) dt = (f, v) dt,
In In
U + (tN ) − U − (tN ) = 0,
U + (t0 ) = u0 ,
q−1
for all v ∈ WN . Here U ± (tN ) = lim→0 U (tN ± ).

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.57


Matrix Problem
Example: Assume q = 1.

Looking only at interval IN iteration form is derived


kN
M (UN − UN −1 ) + S(UN + UN −1 ) = FN ,
2
where matrix and vector entries are given by
Z Z
Sij = ∇ϕi · ∇ϕj dx, Mij = ϕi ϕj dx,
Ω Z Z Ω

FN,j = f ϕj dxdt.
IN Ω

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.58


Wave Equation
Extend to second order equations in time.

Consider for simplicity 1D Wave Equation.

Seek u such that


ü − u00 = 0, 0 ≤ x ≤ 1, t > 0
u = 0, u0 = 0, t > 0
u(x, 0) = u0 , u̇(x, 0) = v0 ,
where g, u0 and v0 are given indata.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.59


Wave Equation, cnt
Substitute u̇ = v and write as a system

u̇ − v = 0,
v̇ − u00 = 0.
Make the cG(1)cG(1) ansatz
U (x, t) = UN −1 (x)ψN −1 (t) + UN (x)ψN (t)
V (x, t) = VN −1 (x)ψN −1 (t) + VN (x)ψN (t)
m
X
where UN (x) = ξN,J ϕJ (x) etc.
J=1

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.60


Wave Equation, cnt
Note that u̇ − v = 0 implies
Z Z 1 Z Z 1
u̇η dxdt − vη dxdt = 0,
In 0 In 0

for all η(x, t).

Also,
Z Z 1 Z Z 1
v̇η dxdt + u0 η 0 dxdt = 0,
In 0 In 0

for all η(x, t) such that η(0, t) = 0.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.61


Wave Equation, cnt
Find U (x, t) and V (x, t) such that
Z Z 1
UN − UN −1
ϕj dxdt
IN 0 kN
Z Z 1
− (VN −1 ψN −1 + VN ψN ) ϕj dxdt = 0,
IN 0

and
Z Z 1
VN − VN −1
ϕj dxdt
IN 0 kN
Z Z 1
+ (UN0 −1 ψN −1 + UN0 ψN )ϕ0j dxdt = 0.
IN 0

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.62


Wave Equation, cnt
Previous problem reduces to
Z 1 Z 1
kN
UN ϕj z dx − VN ϕj dx
0 2 0
Z 1 Z 1
kN
= UN −1 ϕj dx + VN −1 ϕj dx,
0 2 0
and
Z 1 Z 1
kN
VN ϕj dx + UN0 ϕ0j dx
0 2 0
Z 1 Z 1
kN
= VN −1 ϕj dx − UN0 −1 ϕ0j dx.
0 2 0

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.63


Wave Equation, cnt
Vectors UN and VN are determined by

M UN − k2N M VN = M UN −1 + k2N M VN −1
kN kN ,
2 SUN + M VN = M VN −1 − 2 SUN −1
where matrix elements are given by
Z 1 Z 1
Sij = ϕ0i ϕ0j dx, Mij = ϕi ϕj dx.
0 0
Obtains iteration scheme
 kN
   kN
 
M − 2 M UN M 2 M UN −1
kN = kN .
2 S M V N − 2 S M VN −1

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.64


Double Slit Diffraction 1
Example: Simulation showing a diffracting wave

Figure: Light waves encounter a double slit.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.65


Double Slit Diffraction 2

Figure: Slit causes diffraction of waves.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.66


Double Slit Diffraction 3

Figure: Superposition of waves give diffraction pattern.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.67


Stabilized Methods
Consider the abstract problem
Lu = f, in Ω, u = 0, on ∂Ω.
Variational statement reads find u ∈ V such that
a(u, v) = (f, v)
for all v ∈ V . Here a(u, v) = (Lu, v) = (u, L∗ , v).

Standard Galerkin: Find u ∈ Vh such that


a(u, v) = (f, v)
for all v ∈ Vh .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.68


Stabilized Methods, cnt
Stabilized Galerkin: Find u ∈ Vh such that
a(u, v) + (τ (Lu − f ), Lv)K = (f, v)
for all v ∈ Vh . Here L is a stabilizing operator, e.g.
• L - (GLS).

• L
adv - (SUPG).
• −L∗ .

Parameter τ determines size of stabilization. Further,


X
(v, w)K = (v, w)K .
K∈K

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.69


Stabilized Methods, cnt
Example: Convection-Diffusion Problem
β · ∇u − ∆u = f, in Ω,
u = 0, on ∂Ω.
Galerkin Least Squares method

GLS: Find u ∈ Vh such that


(f, v) = (β · ∇u, v) − (∇u, ∇v)
+ (τ (β · ∇u − ∆u − f ), (β · ∇v − ∆v))K .
for all v ∈ Vh .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.70


Stabilized Methods, cnt
Streamline Upwind Petrov Galerkin method

SUPG: Find u ∈ Vh such that


(f, v) = (β · ∇u, v) − (∇u, ∇v)
+ (τ (β · ∇u − ∆u − f ), (β∇ · v))K
for all v ∈ Vh .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.71


Mixed Methods
Consider Stokes problem
−∆u + ∇p = f, in Ω,
∇ · u = 0, in Ω,
u = 0, on ∂Ω.
Here u is velocity, p pressure and f given data.

Note that pressure is not unique and that we may add


Z
p = 0.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.72


Mixed Methods, cnt
We may seek u ∈ V = H01 and p ∈ Q = L2 such that
(∇u, ∇v) − (p, ∇ · u) = (f, v)
(q, ∇ · u) = 0,
for all v ∈ V and q ∈ Q.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.73


Mixed Methods, cnt
Introduce subspaces Vh ⊂ V and Qh ⊂ Q.

Mixed Galerkin: Find U ∈ Vh , P ∈ Qh such that


(∇U, ∇v) − (P, ∇ · U ) = (f, v)
(q, ∇ · U ) = 0,
for all v ∈ Vh and q ∈ Qh .

Not all spaces (Vh , Qh ) give stable method.

Combination Vh = Qh = P1 is instable, for instance.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.74


Mixed Methods, cnt
The Babuska-Brezzi condition
(q, ∇ · u)
sup ≥ kqk,
v∈Vh kvk1
gurarantees that the pair (V, Q) is stable.

Can then prove the estimate


ku − U k1 + kp − P k ≤ C(ku − vk1 + kp − qk),
for all v ∈ Vh and q ∈ Qh .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.75


dG Methods - A Model Problem
Problem: Find u : Ω ⊂ Rd → R such that
−∆u = f, in Ω,
u = 0, on Γ = ∂Ω.
Exist unique weak solution u ∈ H01 if f ∈ H −1 .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.76


Discontinuous spaces
Let V be the space of
discontinuous piecewise polynomials
of degree p defined on a partition {K} = K of Ω.
M
V= PpK (K).
K∈K

May replace PpK (K) by a finite dimensional function


space VK on K.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.77


Averages and jumps
For all v ∈ V we define
v+ + v−
hvi = ,
2
PSfrag replacements
[v] = v − v − ,
+ n
u+ u−
where
v ± (x) = lim+ v(x − nE s).
s→0

and n is a fixed unit normal.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.78


Derivation of a dG method
Multiplying
−∆u = f,
by v ∈ V and integrating by parts yields
X
(∇u, ∇v)K − (nK · ∇u, v)∂K = (f, v).
K

Since [n · ∇u] = 0, this may be written


X X
(∇u, ∇v)K − (nE · ∇u, [v])E = (f, v).
K E

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.79


The dG method
Find U ∈ V such that
a(U, v) = (f, v) for all v ∈ V
Here
X X
a(v, w) = (∇v, ∇w)K − (hn · ∇vi, [w])E
K E
X X
+α ([v], hn · ∇wi)E + β (h−1
E [v], [w])E ,
E E

with α and β real parameters.

Other terms like ([n · ∇v], [n · ∇w])E are also possible.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.80


Conservation
Continuous case: For ω ⊂ Ω we have
Z Z
f+ n · ∇u = 0,
ω ∂ω
Discrete case: For each element K we have
Z Z
f+ Σn (U ) = 0,
K ∂K

with the numerical flux Σn (U ) defined by


β
Σn (U ) = hn · ∇U i − [U ].
hE

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.81


Remarks on the dG method
Method is consistent for all values of α and β.

Special cases:
• Nitsche’s method: α = −1, β large.

• Nonsymmetric without penalty a : α = 1, β = 0.

• Stabilized nonsymmetric: α = −1, β > 0.

a Babuska, Oden, and Bauman

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.82


Effect of β
Example:
Skew−Symmetric Method Stabilized Skew−Symmetric Method Stabilized Skew−Symmetric Method
0.25 0.25 0.25
Φ Exact Φ Exact Φ Exact
α=1 α=1 α=1
0.2 0.2 0.2

k =2 k =2 k =2
0.15 τ =0 0.15 τ =1/h 0.15 τ =10/h
x =0.69 x =0.69 x =0.69
0 0 0
0.1 0.1 0.1

0.05 0.05 0.05

0 0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x x
Figure: Quadratic dG, with α = 1 and β = 0, 1, 10. (τ = β/h)

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.83


Weak Dirichlet conditions
Weak statement of u = gD on ∂Ω:
(∇u, ∇v)Ω − (n · ∇u, v)∂Ω + µ(u, v)∂Ω
= µ(gD , v)∂Ω + (f, v)Ω .
• Nitsche’s method based on this form is consistent
(µ = β/h)
• Stiff springs obtained by neglecting
(n · ∇u, v)∂Ω ,
is not consistent. Corresponds to
u = gD ≈ u + µ−1 n · ∇u = gD .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.84


dG versus cG: Advantages
• Very flexible framework for adaptivity and
construction of approximation spaces.
• Not sensitive to the use of triangles, bricks or other
types of elements.
• Easy implementation of hp-spaces, hanging nodes
and nonmatching polynomial orders.
• Special basis functions not required. Element basis
functions can be xα y β with 0 ≤ α + β ≤ p.
• Can be used to glue together solutions on
nonmatching grids.
• Elementwise conservation property.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.85


dG versus cG: Disadvantages
• Lots of more degrees of freedom.
• Efficient iterative solvers need to be developed.
• Complicated to implement compared to basic cG.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.86


dG versus cG: Number of dof
Number of unknowns for the dG method as a multiple of the number of unknowns for
the cG method for various elements and orders of polynomials.
For p = 0 normalization is with respect to the unknowns of the cG with p = 1.

p Quad Tri Hex Tet


0 1 2 1 5
1 4 6 8 20
2 2.25 3 3.38 7.14
3 1.78 2.22 2.37 4.35
∞ 1 1 1 1

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.87


Classical results
Energy norm: Define
X X −1/2
|||v|||2 = k∇vk2K + khE [v]k2E
K E
X 1/2
+ khE hn · ∇vik2E .
E

Coercivity: If β > 0 large there is m > 0 such that


m|||v|||2 ≤ a(v, v) ∀v ∈ V.
Error estimate: If β > 0 sufficiently large we have
|||u − U ||| ≤ Chp kukH p+1 .

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.88


Systems - Linear Elasticity
Elastic Problem: Find the symmetric stress tensor
σij , and displacement vector ui : Ω → R3 such that
∂σij
− = fi , in Ω,
∂xj
ui = 0, on Γ1 ,
σij nj = gi , on Γ2 .
Here ni is normal to ∂Ω = Γ1 ∪ Γ2 and fi and gi are
given loads.
∂uk
σij = Cijkl ,
∂xl
where Cijkl is tensor of elastic coefficients.
Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.89
Linear Elasticity,cnt
Internal work a(u, v) and external load l(v) given by
Z
∂ui ∂vk
a(u, v) = Cijkl dx,
Ω ∂xj ∂xl
Z Z
l(v) = fi vi dx + gi vi ds.
Ω Γ2

Variational Form: Find u such that


a(ρ, u, v) = l(v),
for all u, v ∈ V = {v ∈ H 1 : v = 0 on Γ1 }.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.90


Linear Elasticity,cnt
Example: Stress caused by volume load.

Figure: von Mises stress contours in a cube.


Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.91
Linear Elasticity, cnt
Example: Stress in a hoistfitting due to point load.

Figure: von Mises stress contours in a hoistfitting.


Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.92
Navier Stokes Equations
Motion of incompressible fluids governed by
∂u 1
+ u · ∇u = ν∆u − ∇p,
∂t ρ
∇ · u = f,
where u(x, t) is velocity and p(x, t) pressure of fluid.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.93


Navier Stokes, cnt
Example: Dual solution of Navier Stokes equations

Figure: Streamlines around a solid body.

Mats G Larson – Fraunhofer Chalmers Centre for Industrial Mathematics – p.94

Potrebbero piacerti anche