Uploaded by Sebastian Albinsson

fem-derivation

advertisement
SIMPLE FEM-DERIVATION
We want to derivae the FEM-formulation for the wave equation in system form (starting indexing
from 0 to correspond with DOLFIN):
(1)
u̇0 − u1 = 0
(2)
u̇1 − u000 = 0
To make the derivation easier, we first apply time-stepping (Trapezoid):
1
1
− kun1 = 0
un+1
− un0 − kun+1
1
0
2
2
1 n+1 00 1 n 00
n+1
n
− ku0 = 0
u1 − u1 − ku0
2
2
(3)
(4)
We define u as a vector u =
u0
u1
and define the equation/residual R(u) to be solved by the
FEM:
1
1
− kun1 = 0
R0 (u) = un+1
− un0 − kun+1
1
0
2
2
1 n+1 00 1 n 00
n+1
n
R1 (u) = u1 − u1 − ku0
− ku0 = 0
2
2
(5)
(6)
with R(u) =
R0 (u)
R1 (u)
.
We define a piecewise
linear basis function φ0 and φ1 for each equation and also put them in a
φ0
vector φ =
.
φ1
We then recall the finite element method as requiring that:
Rb
a
R(u) · φdx = 0
for the basis functions φ.
We can now just expand our definitions to see the details of the FEM formulation:
1
SIMPLE FEM-DERIVATION
2
Z
b
R(u) · φdx = 0 ⇒
(7)
a
Z
b
R0 (u)φ0 + R1 (u)φ1 dx = 0 ⇒
(8)
a
Z
(9)
a
b
1
1
1
1
00
(un+1
− un0 − kun+1
− kun1 )φ0 + (un+1
− kun0 00 )φ1 dx = 0
− un1 − kun+1
0
1
0
1
2
2
2
2
What is left to do is apply integration by parts on the terms with second derivatives, and apply
the boundary conditions by using the κ formulation. We also move all the terms with a n + 1
superscript (the unknowns) to the left hand side and denote it a, and move the rest of the terms to
the right hand side and denote it L.
You should now be able to see a one-to-one correspondence with your derived formulation and
the example formulation in wave1D.py.
A similar derivation with small modifications apply to conv1D.py.
Download