Professional Documents
Culture Documents
1 2
1 λi ∈ P1 (e), i = 1, 2
2 λi (xj ) = δij , i, j = 1, 2
e
3 λ1 (x) + λ2 (x) = 1, x∈e
x1 x2
P1 elements in 1D
u2
'1 '2
u1
e e
x1 x2 x1 x2
P2 elements in 1D
x1 7→ {1, 0}, x2 →
7 {0, 1}
x1 + x2 1 1
x12 = 7→ ,
2 2 2
u2
'1 '12 '2
u1
u12
e
e
x1 x12 x2
x1 x12 x2
P3 elements in 1D
u12
u21
uh (x) = u1 ϕ1 (x) + u2 ϕ2 (x) u1
x1 x12 x21 x2
Barycentric coordinates in 2D
x3
1 λi ∈ P1 (e), i = 1, 2, 3
e
2 λi (xj ) = δij , i, j = 1, 2, 3
x
3
P
3 λi (x) = 1 ∀x ∈ e
i=1 x1 x2
Barycentric coordinates in 2D
x3
Barycentric splitting e
3
[ 1 e2 e1
e= ei , |ei (x)| = | det Ai (x)| e3
i=1
2
x1 x2
1 x y 1 x1 y1 1 x1 y1
! ! !
A1 = 1 x2 y2 , A2 = 1 x y , A3 = 1 x2 y2
1 x3 y3 1 x3 y3 1 x y
It follows that
λ1 (x) + λ2 (x) + λ3 (x) ≡ 1
Vertices
x1 7→ {1, 0, 0}, x2 7→ {0, 1, 0}, x3 7→ {0, 0, 1}
Edge midpoints
1 1 1 1 1 1
x12 7→ , ,0 , x13 7→ , 0, , x23 7→ 0, ,
2 2 2 2 2 2
x3
Centroid
1 1 1
x13 x123 x23
x123 7→ , ,
3 3 3
x1 x12 x2
P1 elements in 2D
Standard P2 basis
ϕi = λi (2λi − 1), i = 1, 2, 3
ϕij = 4λi λj , i, j = 1, 2, 3
Extended P2 basis
ϕi = λi (2λi − 1) + 3λ1 λ2 λ3 , i = 1, 2, 3
ϕij = 4λi λj − 12λ1 λ2 λ3 , i, j = 1, 2, 3
ϕ123 = 27λ1 λ2 λ3
Barycentric coordinates in 3D
1 λi ∈ P1 (e), i = 1, 2, 3, 4
2 λi (xj ) = δij , i, j = 1, 2, 3, 4
4
P
3 λi (x) = 1 ∀x ∈ e
i=1
Barycentric coordinates in 3D
Barycentric splitting
4
[ 1
e= ei , |ei (x)| = | det Ai (x)|
i=1
2
Volume fractions
|ei (x)| | det Ai (x)|
λi (x) = = , i = 1, 2, 3, 4
|e| | det A|
4
X 4
X
|ei (x)| = |e| ⇒ λi (x) = 1, x∈e
i=1 i=1
Nodal points in 3D
Vertices
Barycenters x4
e
xi + xj xi + xj + xk x134
xij = , xijk = x234
2 3 x124
x3
x1 + x2 + x3 + x4 x123
x1234 = x1
4
x2
P1 elements in 3D
Fe (x̂) = Be x̂ + be
1D : Be = x2 − x1 , be = x1
x −x x −x x1
2D : Be = y 2 − y 1 y 3 − y 1 , be = y1
2 1 3 1
x2 − x1 x3 − x1 x4 − x1
! !
x1
3D : Be = y2 − y1 y3 − y1 y4 − y1 , be = y1
z2 − z1 z3 − z1 z4 − z1 z1
Affine transformation
Properties of Fe (x̂) = Be x̂ + be
ˆ ϕ̂i , where
The linear system J∇ϕi = ∇
T T
∂ϕi ∂ϕi ˆ ϕ̂i = ∂ ϕ̂i ∂ ϕ̂i
∇ϕi = , , ∇ ,
∂x ∂y ∂ x̂ ∂ ŷ
subparametric if p > q
isoparametric if p = q
superparametric if p < q
Desired properties
Extended P2 mapping
3
X X
x = Fe (x̂) = xi ϕ̂i (x̂) + xij ϕ̂ij (x̂) + x123 ϕ̂123 (x̂)
i=1 ij
y^ y
Fe e
1
e^
1
2
0 1
2
1 x^ 0 x
Bilinear elements
0 ≤ ki ≤ k, i = 1, . . . , n
4
X
x = Fe (x̂) = xi ϕ̂i (x̂), ϕi (x) = ϕ̂i (Fe−1 (x))
i=1
y^ y x3
x4
1
x^ 4 x^ 3 e
Fe
e^ x2
x^ 1 x^ 2 x1
0 1 x^ 0 x
Biquadratic elements
uh (x, y) = c1 + c2 x + c3 y + c4 xy + c5 x2 + c6 y 2
+ c7 x2 y + c8 xy 2 + c9 x2 y 2 , (x, y) ∈ e
ϕ̂1 (x̂) = θ1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
X N
X
FEM discretization uh = uj ϕj ∈ Vh , vh = vj ϕj ∈ Vh
j=1 j=1
Poisson equation in 1D
Element contributions
N
X N
X
aij = a(ϕj , ϕi ) = akij , bi = b(ϕi ) = bki
k=1 k=1
Z Z
∂ϕj ∂ϕi
akij = dx, bki = f ϕi dx
ek ∂x ∂x ek
∂ϕk−1 1 ∂ϕk 1 1 −1
=− =− ⇒ Ake =
∂x ∆xk ∂x ∆xk −1 1
0 ... 0 1 0 0 ... 0
Pk =
0 ... 0 0 1 0 ... 0
Example N = 3, ∆x = 31 , f ≡ 1
k 1 1 −1 ∆x 1
Ae = , bke =
∆x −1 1 2 1
e1 e2 e3
0 1
x0 x1 x2 x3
Poisson equation in 1D
1 −1 0 0 0 0 0 0
1 −1 + 1
1 0 0 0 1 −1 0
A =
∆x 0 0 0 0 ∆x 0 −1 1 0
0 0 0 0 0 0 0 0
0 0 0 0 1 −1 0 0
1
0 0 0 0 1 −1 2 −1 0
+ =
∆x 0 0 1 −1 ∆x 0 −1 2 −1
0 0 −1 1 0 0 −1 1
1 0 0 1
∆x
1 + ∆x
+ ∆x
1
= ∆x
0 2
b=
2 0 2 1 2 1 2 2
0 0 1 1
Poisson equation in 1D
u1 = 52 (∆x)2 , u2 = 4(∆x)2
u3 = 92 (∆x)2 , ∆x = 1
3
P2 discretization
Linear system i = 1, . . . , 2N
2N N Z N Z
X X ∂ϕi ∂ϕj X
uj dx = f ϕi dx
j=1 k=1 ek ∂x ∂x k=1ek
7 −8 1 N
1 X
= −8 16 −8 , A= PkT Ake Pk
3∆x
1 −8 7 k=1
Z f ϕ2k−2 N
X
bke = f ϕ2k−1 dx, be = Pk bke
ek f ϕ2k k=1
Dirichlet boundary conditions
Then the matrix and right-hand side of this extended system are
modified to take the boundary condition u0 = g into account