Finite Element Methods Part I

advertisement
Pierson Guthrey
pguthrey@iastate.edu
Part I
Finite Element Methods
Notation. Let the default norm be the L2 (a, b) norm. We define the weighted a-norm and the Energy norm
as such.
kψk = kψkL2 (a,b)
√ kψka = aψ L2 (a,b) =
ˆ
b
a(x)(ψ(x))2 dx
a
kψkE = kk
1
Introduction
Consider the BVP
(
0
− (a(x)u0 ) = f (x) x ∈ (0, 1)
, 0 < amin < a(x) < amax < ∞,
u(0) = u(1) = 0
(BVP1)
Notice BVP1 is self adjoint with 0 ∈
/ σp (L). This has a solution as long as f is continuous and a ∈ C 1 .
We reformulate this as the variational problem
ˆ
ˆ
1
1
au0 v 0 dx =
0
f vdx, v ∈ H01
(VAR1)
0
which has a unique solution.
2
New Notes
....
Note that for ψ st −(aψ 0 )0 = ξ, ψ(0) = ψ(1) = 0,
Sa = max
ξ6=0
kψ 00 ka
≤ C(a)
ξ
So
kaψ 00 k ≤ kf k + ka0 ψ 0 k ≤ kf k + ka0 k∞ kψ 0 k
2.1
An a posteriori error estimate
Let e = u − U , then
ˆ
2
kekE
Subtract from this
ˆ
1
=
ˆ
1
0 0
0
ae u −
ae e dx =
0
0
ˆ
ˆ
1
aU 0 v 0 dx = 0
0
1
ˆ
1
1
ae0 U 0 dx
f edx −
0
f vdx −
0
0
ae U dx =
0
1
ˆ
1
0 0
0
2.1
Pierson Guthrey
pguthrey@iastate.edu
An a posteriori error estimate
So we have
ˆ
2
kekE
=
0
0
M
+1 ˆ xj
X
j=1
(f (e − Pn e) − aU 0 (e − Pn e)0 ) dx
xj−1
M
+1 ˆ xj
X
j=1
1
aU 0 (e − Pn e)0 dx
f (e − Pn e)dx −
=
=
ˆ
1
(f + (aU 0 )0 ) (e − Pn e) dx
xj−1
M
+1
X
x
[−aU 0 (e − Pn e)]xjj−1
j=1
Since (e − Pn e)|xj = 0 for all j = 0, 1, ..., M + 1
2
kekE
=
M
+1 ˆ xj
X
j=1
where R(U ) = f + (aU 0 )0 .
Cauchy,:
ˆ
R(U ) (e − Pn e) dx =
xj−1
1
R(U ) (e − Pn e) dx
0
2
kekE ≤ khR(u)ka−1 h−1 (e − Pn e)a
Note that h−1 (e − Pn e)a ≤ CkEka .
Theorem: Error Estimate There exists a constant C depending only on a(x) such that the cG(1) FEM
approximation U satisfies
ku − U kE = k(u − U )0 ka ≤ C(a)khR(U )ka−1
Adaptive Mesh Refinement Steps
1. Compute the approximate FEM solution on a uniform coarse mesh.
2. Calculate the error on each element Kj
ˆ
xj
Ej2 = (xj − xj−1 )2
xj−1
If Ej2 ≤
If
Ej2
>
2
c2 (M +1) ,
2
c2 (M +1) ,
1
R2 (U )dx
a(x)
move onto next element.
subdivide the element into 2 or more elements, then move onto the next element.
3. Recalculate solution on the new mesh.
4. Repeat 2-3 until no subdivision is required.
Note that the constant c is unknown. The more accurately we know this c, the better our estimate will be and
therefore the more efficient our code will be. Estimates for c can be given by calibration based on known
solutions.
2.1.1 L2 norm a-posteriori error estimate
ku − U k ≤ Cs CI h2 R(U )
where
−1
h (φ − Pn φ) ≤ CI kφ00 k
2
Pierson Guthrey
pguthrey@iastate.edu
and
kψ 00 k
,
ξ
Cs = max
ξ6=0
−(aψ 0 )0 = ξ
Proof. We have the dual problem −(aψ 0 )0 = e, φ(0) = φ(1) = 0, so
ˆ 1
ˆ 1
2
kek = −
e(aψ 0 )0 dx =
(u − U )(aφ0 )0 dx
ˆ
0
1
a(u − U )0 φ0 dx − [(u − U )aφ0 ]0
=
0
ˆ
0
1
ˆ
1
au0 φ0 dx −
=
0
ˆ
ˆ
1
0
ˆ
0
1
0
1
ˆ
0
M
+1 ˆ xj
X
ˆ
1
ˆ
1
f vdx −
0
1
aU 0 v 0 dx , v = Pn φ
0
aU 0 (φ − Pn φ)0 dx
f (φ − Pn φ) −
=
=
aU 0 φ0 dx
aU 0 φ0 dx −
f φdx −
=
1
0
R(U )(φ − Pn φ)dx
xj−1
i=0
ˆ 1
=
R(U )(φ − Pn φ)dx
02
≤h R(U ) h−2 (φ − Pn φ)
≤h2 R(U ) CI kφ00 k
≤h2 R(U ) CI CS kek
kek ≤h2 R(U ) CI CS
Using this, we modify step 2 of the adaptive mesh refinement
ˆ xj
2
4
Ej = (xj − xj−1 )
R2 (U (x))dx
xj−1
and let c = CI Cs in step 2.
3
cG(2) Method
Consider our favorite BVP/VAR
ˆ
−(au0 )0 = f, u(0) = u(1) = 0 ⇐⇒
au0 v 0 dx =
0
Now we use the approximate
Vh2
ˆ
1
1
f vdx, ∀ v ∈ V = H01
0
:
Vh2 = v ∈ V : v|kj = aj + bj x + cj x2
We seek a basis {φn } such that Vh2 = span {φn }.
Given a mesh Th = {hi }M +1 so that xj = x0 +
j
P
hi , we introduce a submesh that divides the mesh Th
i=1
into subintervals of size 12 . We then consider the Lagrange polynomials
(1, 0, 0) := p1 (xj−1 ) = 1, p1 (xj− 21 )1 = p(xj ) = 0
3
Pierson Guthrey
pguthrey@iastate.edu
(0, 1, 0) := p2 (xj− 21 ) = 1, p2 (xj− 21 )1 = p2 (xj ) = 0
(0, 0, 1) := p3 (xj ) = 1, p3 (xj− 21 )1 = p3 (xj−1 ) = 0
φi (x) =
 2(x−x 1 )(x−xi+1 )
i+
2


(xi+1 −xi )2

xi ≤ x ≤ xi+1
2(x−xi− 1 )(x−xi−1 )
xi−1 ≤ x ≤ xi
2



(xi −xi−1 )2
otherwise
0
( 4(x
i −x)(x−xi−1 )
(xi −xi−1 )2
φi− 21 (x) =
xi−1 ≤ x ≤ xi
0
otherwise
n
o
Vh2 = span φ 21 , φ1 , φ 32 , φ2 , ..., φM , φM + 12
2M
+1
X
U (x) =
ξ j φ j (x)
2
2
j=1
So for the same mesh Th , the cG(2) has roughly twice the amount of unknowns as cG(1) method.
For any function v ∈ V ,
(Ph v)x) =
2M
+1
X
v(x j )φ j (x)
2
2
j=1
cG(2) variational problem
2M
+1
X
ˆ
1
0
ξj
2
j=1
ˆ
1
0
a(x)φ j (x)φ 2i (x)dx =
2
0
f (x)φ 2i (x)dx
for i = 1, 2, ..., 2M + 1.
3.0.2
Example
Consider a ≡ 1 and hj = h, j = 1, ..., M + 1.
Stiffness matrix
If i is odd, i = 1, 3, ..., 2M + 1,
ˆ
x i+1
2
aii =
(φ0i (x))2 dx =
2
x i−1
16
3h
2
ˆ
x i+1
φ0i (x)φ0i−1 (x)dx =
2
ai−1,i = ai,i−1 =
2
x i−1
2
−8
3h
2
If i even, i = 2, 4, ..., 2M ,
ˆ
x i+1
2
aii =
(φ0i (x))2 dx =
2
x i−1
14
3h
2
ˆ
x i+1
φ0i (x)φ0i−1 (x)dx =
2
ai−1,i = ai,i−1 =
2
x i−1
ˆ
ai−2,i = ai,i−2 =
2
−8
3h
2
xi
φ0i (x)φ0i−2 (x)dx =
2
x i−1
2
4
2
2
1
3h
Pierson Guthrey
pguthrey@iastate.edu
You can check this because summing the rows gives a zero vector.
f = Ph f =
2M
+1
X
2M
+1
X
f (x j )φ j (x) =
2
2
2
j=1
2M
X
f (x j )φ j (x) +
f (x j )φ j (x)
2
2
2
j=2,even
j=1,odd
Odd pieces: For odd i,
fi =
2M
+1
X
ˆ
2
f (x j )
2
x i−1
j=1,odd
ˆ
x i+1
2
2
x i+1
2
φ j (x)φ 2i (x) =f (x i−1 )
φ i−1 (x)φ 2i (x)dx
2
x i−1
ˆ
2
2
x i+1
(φ 2i (x))2 dx
2
+ f (x 2i )
x i−1
ˆ 2x i+1
2
+ f (x i+1 )
2
x i−1
φ i+1 (x)φ 2i (x)dx
2
2
so
fi =
h f (x i−1 ) + 8f (x 2i ) + f (x i+1 )
2
2
15
Even pieces: For even i,
fi =
h −f (x i−2 ) + 2f (x i−1 ) + 8f (x 2i ) + 2f (x i+1 ) − f (x i+2 )
2
2
2
2
30
This produces a matrix problem Au = f , where A is SPD.
3.0.3
Error Analysis
Energy norm error
ku − U kE ≤ ku − vkE , ∀ v ∈ Vh2
Take v = Ph u, then
ku − U kE ≤ ku − Ph ukE ≤ ch2 ku000 k
L2 norm error:
4
ku − U kL2 ≤ ch3 ku000 k
Beam Equation
(
u(4) = f
0<x<1
(BEAM BVP)
u(0) = u(1) = u0 (0) = u0 (1) = 0
u and u0 are specified at the boundary, thus are essential boundary conditions. v and v 0 will be strongly
enforce. So let
V = v ∈ H 2 : v(0) = v(1) = v 0 (0) = v 0 (1) = 0
So we have our Variational Problem
ˆ 1
ˆ
0000
vu dx =
0
0
ˆ
1
ˆ
1
00 00
vf dx ⇐⇒
0
1
f vdx(BEAM VAR)
u v dx =
0
Recasting this as an energy minimization, we define the functional
ˆ
ˆ 1
1 1 00 2
F [w] =
(w ) dx −
f wdx
2 0
0
5
4.1
Pierson Guthrey
pguthrey@iastate.edu
cG(3) Method
So we seek u ∈ V such that
F [u] ≤ F [v] ,
∀ v ∈ V (BEAM MIN)
Assume w = u + v, v ∈ V .
F [w] = F [u + v] = F [u] +
1
2
ˆ
ˆ
1
u00 v 00 dx −
(v 00 )2 dx +
´1
0
1
f vdx = F [u] +
0
0
0
So minimum energy is achieved with
4.1
ˆ
1
1
2
ˆ
1
(v 00 )2 dx ≥ F [u]
0
(v 00 )2 dx = 0 which with the boundary conditions implies v(x) = 0.
cG(3) Method
The regularity condition of our V for our Beam Variational problem is continuously differentiable functions.
Thus we need cubics in order to match the values and derivatives of neighboring solutions (4 conditions
implies 4 coefficients).
Vh3 = v ∈ V : v|kj = aj + bj x + cj x2 + dj x3
So our first basis function is (recall hj = xj − xj−1 )

−2
−3
2
3

3hj (x − xj−1 ) − 2hj (x − xj−1 )
(1)
−3
2
3
φj (x) = 3h−2
j+1 (x − xj+1 ) + 2hj+1 (x − xj+1 )


0
And we note

−2
−3
2

6hj (x − xj−1 ) − 6hj (x − xj−1 )
(1)
0
−2
−3
(φj (x)) = 6hj+1 (x − xj−1 ) + 6hj+1 (x − xj+1 )2


0
xj−1 ≤ x ≤ xj
xj ≤ x ≤ xj+1
otherwise
xj−1 ≤ x ≤ xj
xj ≤ x ≤ xj+1
otherwise
Note that
(1)
(1)
• φj (x) ∈ C 1 [0, 1], φj (x) ∈
/ C 2 [0, 1]
(1)
(1)
• φj (xk ) = δjk , (φj )0 (xk ) = 0
Our second basis function is

−1
−2
2
3

−hj (x − xj−1 ) + hj (x − xj−1 )
(2)
−2
−1
2
3
φj (x) = hj+1 (x − xj+1 ) + hj+1 (x − xj+1 )


0
And we note

−1
−2
2

−2hj (x − xj−1 ) + 3hj (x − xj−1 )
(2)
−2
2
(φj (x))0 = 2h−1
j+1 (x − xj+1 ) + 3hj+1 (x − xj+1 )


0
Note that
(2)
(2)
• φj (x) ∈ C 1 [0, 1], φj (x) ∈
/ C 2 [0, 1]
(2)
(2)
• φj (xk ) = 0, (φj )0 (xk ) = δkj
6
xj−1 ≤ x ≤ xj
xj ≤ x ≤ xj+1
otherwise
xj−1 ≤ x ≤ xj
xj ≤ x ≤ xj+1
otherwise
Download