Professional Documents
Culture Documents
Lu = f
u=g
0
n u = g1
n u + u = g
2
in
on 0
on 1
on 2
2
x x1
2 (x) =
x2 x1
Basis functions
x2
'1
'2
2
d
dx
i, j = 1, 2
1 (x) + 2 (x) = 1,
1
x2 x
1
x1
i = 1, 2
i (xj ) = ij ,
d1
dx
x e
x1
x2
u2
constant derivatives
1 |e = 1 ,
u1
2 |e = 2
x e
e
x1
x2
x1 +x2
2
barycentric coordinates
e
x2 = {0, 1}
= { 21 , 21 }
Basis functions
2
endpoints
midpoint
x1
x2
'1
'12
1 , 2 , 12 P2 (e)
e
x12
x1
x2
u2
u1
Shape function uh |e
uh (x) = u1 1 (x) + u2 2 (x) + u12 12 (x)
'2
u12
e
x1
x12
x2
1
barycentric coordinates
x1 = {1, 0},
x12 =
2x1 +x2
3
= { 32 , 13 }
x2 = {0, 1},
x21 =
x1 +2x2
3
= { 31 , 23 }
Basis functions
e
x1
x2
1 , 2 , 12 , 21 P3 (e)
2
u2
u12
u1
u21
e
x1
x12 x21 x2
i (xj ) = ij ,
i, j = 1, 2, 3
x1
Polynomial fitting: i (x) = ci1 + ci2 x + ci3 y
(x
)
=
c
+
c
x
+
c
y
=
i
1
i1
i2
1
i3
1
i1
c
1
x
y
i1
1
1
1 x2 y2 ci2 =
i (x2 ) = ci1 + ci2 x2 + ci3 y2 = i2
ci3
1 x3 y3
i (x3 ) = ci1 + ci2 x3 + ci3 y3 = i3
{z
}
|
x2
i1
i2
i3
We have 3 systems of 3 equations for 9 unknowns. They can be solved for the
unknown coefficients cij by resorting to Cramers rule.
det A = x2 y3 + x1 y2 + x3 y1 x2 y1 x3 y2 x1 y3
Area of the triangle
|e| = 12 | det A|
i = 1, 2, 3
3
S
ei
e=
xi ,
x3
e
e2 e1
i=1
1 x y
A1 = 1 x2 y2 ,
1 x3 y3
1
2 | det Ai (x)|
|ei (x)| =
1 x1 y1
A2 = 1 x y ,
1 x3 y3
i (x) =
|ei (x)|
|e|
x1
x e
x2
1 x1 y1
A3 = 1 x2 y2
1 x y
det Ai (x)
= det A ,
e3
i = 1, 2, 3
i (xj ) = ij
e1
e
x2
x2 = {0, 1, 0},
1 = 1 ,
midpoint-oriented
12 = 1 23 ,
2. Quadratic elements
3 = 3 (23 1),
x1
x12
x2
2 = 2 ,
3 = 3
(standard)
13 = 1 22 ,
23 = 1 21
uh (x) = c1 + c2 x + c3 y + c4 x2 + c5 xy + c6 y 2 P2 (e)
2 = 2 (22 1),
x23 = {0, 21 , 21 }
x123 x23
uh (x) = c1 + c2 x + c3 y P1 (e)
vertex-oriented
1 = 1 (21 1),
x13
x3 = {0, 0, 1}
x13 = { 12 , 0, 12 },
1. Linear elements
x3
x123 = { 13 , 31 , 31 }
12 = 41 2
13 = 41 3
23 = 42 3
ij = 4i j 121 2 3
123 = 271 2 3 ,
i, j = 1, 2, 3
i P1 (e) : i (xj ) = ij ,
Polynomial fitting:
1
1
1
1
x1
x2
x3
x4
y1
y2
y3
y4
x124
i, j = 1, . . . , 4
x134
x234
x3
x123
x1
i1
ci1
z1
z2
ci2 = i2
z3 ci3 i3
i4
ci4
z4
1. Linear elements
x2
Barycentric splitting
e=
4
S
ei
i=1
i (x) =
|ei (x)|
,
|e|
i = 1, . . . , 4
uh (x) = c1 + c2 x + c3 y + c4 z P1 (e)
vertex-oriented
1 = 1 ,
2 = 2 ,
face-oriented
123 = 1 34 ,
134 = 1 32 ,
3 = 3 ,
124 = 1 33
234 = 1 31
4 = 4
(standard)
xijk =
xi +xj +xk
3
n=1
x^ 3
0
e^
x^1
x^2 x^1
x^ 3
x^ 3 x^14
01 0
y^
Fe
e
x1
Fe
x1
x3Fe
x1
x2 e
e
x2 x x1
Fe y
x2 x1
Linear mapping in Rn
z^
x^ 4
1 1
0
e^
x^
Fey z
e
y^
x3
x1
x2x2
Fe : y e e
x3
x1
xx
x
y
e^
x^ 2 x^
x^x^2 1 x^
y^ Fe 3
Fe x 4 z
x3
x1
01
x^ 2 x^x2^ x^x^ 1
1
x^ 3
x2
xx2 x
e^ e^
n=3
n=3
z^
x^ 4
x^x^21 x^x^1
n=
2 3
n=
n=2
y^ z^
x^ 3
Fe
Fe
x4 z
e
x2
x4
x3
x1
x3
x2
e = Fe (
e)
x = Fe (
x) =
n+1
X
xi i (
x),
x e
i=1
Be Rnn ,
be Rn
n=3
Be = x2 x1 ,
x2 x1
Be =
y2 y1
x2 x1
Be = y2 y1
z2 z1
be = x1
x3 x1
,
y3 y1
be =
x3 x1 x4 x1
y3 y1 y4 y1 ,
z3 z1 z4 z1
x1
y1
x1
be = y1
z1
+ be
Fe (
x) = Be x
xi = Fe (
xi )
x e
i (x) = i (
x),
x = Fe (
x)
i (x) = i (
x),
i = Ji
Chain rule
x e,
e
x
=
=
1
det J
1
det J
h
h
i y
x
y
i x
y x
i y
y x
i x
x
y
J =
x
x
x
y
y
x
y
y
must be nonsingular
for Fe to be invertible
i xi ,
x
3
P
i=1
ij xij ,
x
xi
i (
x) +
P
ij
123 x123
x
xij
ij (
x) + x123
123 (
x)
y^
Fe
e^
1
2
1
2
x^
1 (t) = 1 t,
y^
2 (t) = t,
t [0, 1]
1 (
x) = 1 (
x)1 (
y ),
3 (
x) = 2 (
x)2 (
y)
2 (
x) = 2 (
x)1 (
y ),
4 (
x) = 1 (
x)2 (
y)
y
x^ 4
x^ 1
x^ 3
e^
x^ 2
1
Fe
x1
x^
x3
x4
x2
The space Q1 (
e) spanned by i consists of functions which are P1 for each variable
In general
Qk (
e) = span{xk11 xk22 . . . xknn },
Isoparametric mapping
x = Fe (
x) =
4
P
i=1
0 ki k,
xi i (
x),
i = 1, . . . , n
1 (
Q
e) = span{1, x
, y, x
2 y2 }
2
x = Fe (
x) =
i xi
4
x
bilinear mapping
1
|Si |
Si
1
x
uh (x) =
= [1 , 2 , 3 , 4 ]T ,
c = [c1 , c2 , c3 , c4 ]T ,
= [1, x
, y, x
2 y2 ]T ,
T c = T A1 u = T u
x4
x2
e
x1
uj j (
x) =
u = [u1 , u2 , u3 , u4 ]T ,
Ac = u
uh (x(s)) ds uh (xi )
4
P
Fe
2
x
j=1
Coefficients:
x3
i=1
Degrees of freedom: ui =
3
x
uh (x) = c1 + c2 x
+ c3 y + c4 (
x y )
4
P
4
P
j=1
ui =
cj j (
x), x e
P
aij cj
R
x)ds
aij = |S1i | Si j (
T = T A1
aij j (
xi ),
ui uh (xi )
a
Q
1
1
1
1 2 0
3
2
1 1 1
2
3
A=
1 1 1 2
2
3
1 0 12 31
1 (
x) =
3
4
+ 23 x
52 y 32 (
x2 y2 )
2 (
x) = 41 12 x
+ 32 y + 23 (
x2 y2 )
12 y 23 (
x2 y2 )
3 (
x) = 41 + 32 x
4 (
x) =
3
4
25 x
+ 32 y + 32 (
x2 y2 )
b
Q
1
1
1
1 2 0
4
3
1 1 1
2
4
A=
1 1 1 3
2
4
1 0 12 41
1 (
x) =
3
4
+x
2
y (
x2 y2 )
2 (
x) = 41 + y + (
x2 y2 )
(
x2 y2 )
3 (
x) = 41 + x
4 (
x) =
3
4
2
x + y + (
x2 y2 )
t [0, 1]
4 (
x) = 1 (
x)2 (
y ),
7 (
x) = 3 (
x)2 (
y)
2 (
x) = 2 (
x)1 (
y ),
5 (
x) = 3 (
x)1 (
y ),
8 (
x) = 1 (
x)3 (
y)
3 (
x) = 2 (
x)2 (
y ),
6 (
x) = 2 (
x)3 (
y ),
9 (
x) = 3 (
x)3 (
y)
x e
x7
x4
x8
x1
0
x3
x9
x6
Fe1
y^
1
x5 x2
e^
Fe2
x^ 4 x^ 7 x^ 3
x^ 8 x^ x^ 6
9
x^ 1 x^ 5 x^ 2
1
x^
x7 x3
x6
x8 x9
x2
x1 x5
x4
x = Fe (
x) =
9
P
xi i (
x)
i=1
e = Fe (
e) is curved
1 (t) = 1 t,
2 (t) = t,
t [0, 1]
5 (
x) = 1 (
x)1 (
y )2 (
z)
2 (
x) = 2 (
x)1 (
y )1 (
z ),
6 (
x) = 2 (
x)1 (
y )2 (
z)
3 (
x) = 2 (
x)2 (
y )1 (
z ),
7 (
x) = 2 (
x)2 (
y )2 (
z)
4 (
x) = 1 (
x)2 (
y )1 (
z ),
8 (
x) = 1 (
x)2 (
y )2 (
z)
x^ 4
x^ 8
x^ 5
y^
x^ 1
0
1
e^
x^ 3
Fe
x^ 7
x^ 6
x5
x^ 2
1
x8
x^
x4
x1
x e
x3
x7
x2
Isoparametric mapping
x6
x = Fe (
x) =
8
P
xi i (
x)
i=1
d2 u = f in (0, 1)
dx2
u(0) = 0, du (1) = 0
'k
ek
dx
Galerkin discretization:
'k
xk
uh =
N
P
u j j
xk
j=1
N
X
u0 = 0,
uj
j=1
di dj
dx =
dx dx
f i dx,
Au = F,
N
X
j=1
uj
z
N Z
X
k=1
ek
ek = [xk1 , xk ]
Fik
}|
{
z }| {
N Z
X
di dj
f i dx,
dx =
dx dx
k=1 ek
{z
} |
{z
}
aij
i = 1, . . . , N
Fi
i = 1, . . . , N
N
P
k=1
N
P
k=1
akij =
Fik =
R1
di dj
0 dx dx
R1
0
f i dx
dx
R dk1 dk
dk1 dk1
f k1 dx
dx
dx dx
dx
dx dx
ek
ek
k
k
ek
a =
,
f
=
R
R dk dk
R dk dk1
f k dx
dx
ek
dx dx
ek dx dx
ek dx
Coefficients of the global system Au = F
ak1 k1 ak1 k
A=
ak k1
ak k
Fk1
F =
Fk
3 elements,
xk x
xk xk1
xxk1
xk xk1
x = 31 ,
kxx
x ,
x(k1)x
,
x
x ek = [xk1 , xk ]
Hence,
dk1
dx
dk
dx
f 1
'0
'1
1
= x
ak =
1
x
1
x
e1
x0
1 1
1
1
e2
x1
'3
'2
fk =
e3
x3
x2
x
2
1
1
1 1 0 0
0 0 0 0
0 0 0 0
0 0
1 0 0
1 1 0
1 1
1 0 0
1 0
A = x
0 0 0 0 + x
0 1 1 0 + x
0 0 1 1
0 0 1 1
0 0 0 0
0 0 0 0
1 1 0 0
1
0
0
1
2 1 0
1 x 1 x 0 x 2
1 1
A = x
0 1 2 1 , F = x
2 0 + 2 1 + 2 1 = 2 2
0 0 1 1
1
0
0
1
1
2
1
0
u
1
u1 = 25 (x)2 , u2 = 4(x)2
1
1 2 1 u2 = 1
2
(x)
1
u3 = 92 (x)2 ,
x = 31
0 1 1
u3
2
a0j := 0,
j = 1, 2, 3,
F0 := g0
F0 := F0 + g0
symmetry is preserved
Galerkin FEM:
uj
k=1
j=1/2
ek = [xk1 , xk ],
ek
di dj
dx dx
dx =
N R
P
k=1
x = {1 (x), 2 (x)}
k1 = 1 (21 1),
k = 2 (22 1),
k1/2 = 41 2 ,
N R
P
ek
'k
dk1
41 1
=
dx
x
dk1/2
2 1
= 4x
dx
dk
1 2
dx = 4 x
i = 1, . . . , N
f i dx,
1
1=2
'k
1=2
xk
'k
ek
xk
xk
ak =
dk1 dk1
dx
dx
dx
ek
6 R dk1/2 dk1
6
dx
dx
dx
4 ek
R dk dk1
dx
dx
ek dx
2 R
dk1 dk1/2
dx
dx
dx
ek
R dk1/2 dk1/2
dx
dx
dx
ek
R dk dk1/2
dx
dx
ek dx
dx
k1
R ek
k
f = ekR f k1/2 dx =
f k dx
ek
x
6
1
4
1
3
dk1 dk
dx
dx
dx
ek
7
R dk1/2 dk
dx 7
dx
dx
5
ek
R dk dk
dx
ek dx dx
R
1
3x
3
7 8 1
4 8 16 8 5
1 8 7
f (x) dx =
f(
x)| det J| d
x
i = Ji
x e
i
i = J 1
For instance, the entries of the element stiffness matrix are given by
Z
Z
j )| det J| d
i ) (J 1
x
aij = i j dx = (J 1
e
Numerical integration
g(
x) d
x
n
P
w
i g(
xi ),
g(
x) = f(
x)| det J|
i=0
g(
x) d
x
e
g
(
x1 )+
g (
x2 )
,
2
x
1 =
1
2
1
6
3,
x
2 =
1
2
1
6
3,
e = [0, 1]
exact for g P3 (
e) as compared to P1 (
e) for the trapezoidal rule
(inconvenient access)
A(NNZ)
IROW(NNZ)
ICOL(NNZ)
2. Compact storage
(convenient access)
A(NNZ)
ILD(N+1)
ICOL(NNZ)
Example
1
2
A=
0
7
2
4
3
0
0
3
6
5
7
0
5
8
A = (1, 2, 7, 4, 2, 3, 6, 3, 5, 8, 7, 5)
ICOL = (1, 2, 4, 2, 1, 3, 3, 2, 4, 4, 1, 3)
IROW = (1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4)
NNZ = 12, ILD = (1, 4, 7, 10, 13)