MA557/MA578/CS557 Lecture 22
description
Transcript of MA557/MA578/CS557 Lecture 22
2
Interpolation on the Triangle
• Recall we are considering a two-dimensional domain.
• We assume that a triangulation of the domain is given.
• In each triangle we are going to create a polynomial approximation of the solution to a PDE.
• We discussed briefly an orthogonal basis for the triangle (which you are currently verifying is indeed actually an orthogonal set of functions).
• We construct a generalized Vandermonde basis using this basis and a set of nodes.
3
Reference Triangle
• The following will be our basic triangles:
• All straight sided triangles are the image of this triangle under the map:
s
r
(-1,-1) (1,-1)
(-1,1)
1 2 3
1 2 3
1 1
2 2 2x x x
y y y
v v vx r s r s
v v vy
4
Reference Triangle
• The following will be our basic triangles:
• All straight sided triangles are the image of this triangle under the map:
s
r
(-1,-1) (1,-1)
(-1,1)
1 2 3
1 2 3
1 1
2 2 2x x x
y y y
v v vx r s r s
v v vy
2 2,x yv v 1 1,x yv v
3 3,x yv v
5
• Given a set of nodes lying in the triangle we use V to construct an interpolating polynomial for a function who’s values we know at the nodes:
• The interpolation condition yields:
0 0
ˆ, ,i p j p i
ij iji j
f r s r s f
0 0
0 0
1
ˆ, ,
ˆ
ˆ
1 2
2
i p j p i
n n n nij iji j
i p j p i
n ij iji j
m M
nm mm
f r s r s f
f
f
p pM
V
V where we have chosen an ordering of the modes
6
Differentiation
• Suppose we wish to find the derivative of a p’th order polynomial
• First we note that the approximation becomes equality:
• And interpolation allows us to find the PKDO coefficients:
• So differentiation requires us to compute:
for a triangle pf P T T
0 0
ˆ, ,i p j p i
ij iji j
f r s r s f
1
ˆ, m M
n n nm mm
f r s f
V
0 0
0 0
ˆ, ,
ˆ, ,
i p j p iij
iji j
i p j p iij
iji j
fr s r s f
r r
fr s r s f
s s
7
Differentiation cont
• So we need to be able to compute:
• Recall the definition of the basis functions:
• R-derivative:
and ,ij ij
r sr s
0,0 2 1,02(1 ) 1, 1
(1 ) 2
nn
n mnm
r sr s P P s
s
0,0
2 1,02 2(1 ) 1, 1
1 (1 ) 2
nnm nn
m
dP r sr s P s
r s dx s
8
Quick Jacobi Polynomial Identity
• We will make extensive use of the following:
,
1, 11
1
2n
n
dP nx P x
dx
9
r-Derivative
• Ok we need to calculate:
• We can compute these using the definition of the Jacobi polynomials.
• Watch out for s=1 (top vertex) – the r-derivative of all the basis is functions is zero at r=1,s=-1
0,0
2 1,02 2(1 ) 1, 1
1 (1 ) 2
nnm nn
m
dP r sr s P s
r s dx s
1,1 2 1,01
,0
2 1 2(1 ) 1, 1 1
1 2 (1 ) 2
0 when 0 (since P 1)
nnm n
n m
n r sr s P P s n
r s s
n x
10
s-Derivative
2 1,0
0,0 21
0,0
2
2
1,
10
,
0
,0
0
1,
2
2(1 )1
(1 )
2(1 ) 11
(1 )
2 1 2(1 )1
(1
2 2
)
1
2
1
nnm
n
nm
nn
nn
mn
n
m
dPs
dx
sr s P s
r d
s
rP P s
s
r sP
n s
P
s
r
dx ss
We use the chain and product rule to obtain:
11
s-Derivative
1,11
2 1
21
,0
0,0 2 1,0
0,0
2
1
1,
2
2(1 )1
(1 )
2(1 ) 11
(1
2 2
2
2 1
1
2 2
1 2(1 )
) 2
12 (1 )1
nnm
nm
nm
nn
n
n
m
n
n
sr
r n rP
sss P s
s
rP P s
s
r s
n s
nPP
s
m
2,1 s
From which:
12
Special Cases
0 1,0,m
mr s P ss s
Don’t worry about all those denominators having (1-s)since the functions are just polynomials and not singular functions…
13
Recap
1,1 2 1,012
10,0 2 1,0
0,0 2 2,11
2 1 2(1 ) 1, 1
2 (1 ) 21
2(1 ) 11
(1 ) 2 2
2(1 ) 1 2 21
(1 ) 2 2
nnm n
n m
nn
n m
nn
n m
n r sr s P P s
s ss
r n sP P s
s
r s m nP P
s
s
1,1 2 1,01
,0
2 1 2(1 ) 1, 1 1
1 2 (1 ) 2
0 when 0 (since P 1)
nnm n
n m
n r sr s P P s n
r s s
n x
14
Derivative matrices
• Given data at M=(p+1)(p+2)/2 points we can directly r and s derivatives with:
1
1
1
1
ˆ ,
ˆˆ ˆ, where ,
ˆˆ ˆ, where ,
m M
m j jmjm
m Mr r m
n n nm m nm n nm
m Ms s m
n n nm m nm n nm
f f r s
fr s f r s
r r
fr s f r s
s s
V
D D
D D
15
One-Stage Differentiation
• Given a vector of values of f at a set of nodes we can obtain a vector of the r and s derivatives at the nodes by:
1
1
ˆ where
ˆ where
r r r
s s s
r
s
fD f D D V
fD f D D V
16
Matlab Scripts
• After class on Friday I will post code which computes the derivative matrices Dr and Ds for an arbitrary set of M nodes.
17
Inner Product Matrices
• Recall we need to compute:
• It is not obvious how to do this given the value of f and g at a set of M points.
• Same old trick – construct the PKDO coefficients and use the orthogonality relationship..
1
1 1
,
,, ,
,
TT
s
f g fgdV
x yf r s g r s drds
r s
18
Inner-Product
1
1 1
1
1 11 1
1
1 11 1
1
1 1 1
,, , ,
,
, ˆ ˆ, ,,
, ˆ ˆ, ,,
, ˆ ˆ , ,,
s
T
s m M n M
m m n nm n
s n M m M
m m n nn m
sm M
m n m nm
x yf g f r s g r s drds
r s
x yf r s g r s drds
r s
x yf r s g r s drds
r s
x yf g r s r s drds
r s
1
ij1 1
1
, 2 2ˆ ˆ where C, 2 1 2 2 2
, ˆ ˆ,
n M
n
n M m M
m n nm nn m
n M
n n nn
x yf g C
r s i i j
x yf g C
r s
Since the r,s->x,y is linear
19
Nodal Mass Matrix
• Suppose we know the value of f and g at M points then we can compute the PKDO coefficients using the generalized Vandermonde matrix.
• We can then integrate by the previous operations (last slide).
• All these operations can be concatenated into one mass matrix.
20
Mass-Matrix
1
, ˆ ˆ,,
, where is a diagonal matrix
,
,
,
, where
,
n M
n n nTn
t
tt
tt
x yf g f g C
r s
x y
r s
x y
r s
x y
r s
1 1
1 1
1 1
V f C V g C
f V C V g
f Mg M V C V
21
Nodal Mass Matrix
• Setting
• Where:
• Then:
1 1
km1 1
,
,, ,
,
,
,
,
,
tn m n mT
j Mk M
n j j jk m k kk j
j Mk M
nj jkk j
nm
h h
x yh r s h r s
r s
x y
r s
x y
r s
h Mh
M
M
M
,
,
n
m
f h r s
g h r s
1 2, 1 , , where
2n m m nm
p ph r s n m M M
22
DG Matrices
• Recall we need to compute:
• We use the coordinate change, chain rule, linearity of the map T->That (reference triangle) and finally the identities we just found:
,T
gfx
ˆ ˆ
ˆ ˆ
, , ,
, ,, ,
, ,
, ,, ,
, ,
, ,
, ,
T T T
T T
T T
t r t s
g r g s gf f fx x r x s
x y x yr g s gf f
r s x r r s x s
x y x yr g s gf f
r s x r r s x s
x y x yr s
r s x r s x
f MD g f MD g
23
Summary
Set: where hn is the n’th Lagrange interpolant defined as the p’th order polynomial in r,s for which:
, ,,
, ,
, ,,
, ,
r smn nm nm
T
r smn nm nm
T
x y x yh r sh
x r s x r s x
x y x yh r sh
y r s y r s y
MD MD
MD MD
, , nr s h r s
1 2, 1 , , where
2n m m nm
p ph r s n m M M
24
Progress With The DG Scheme For Advection
• The DG scheme now looks like:
• Where we set: and we can now compute everything in the first three inner-product.
• Next time we will discuss how to compute everything in the surface inner-product.
1 1 1
Find , 1,..., such that:
.....
, 02
where ,
, , ,m M m M m M
m m mn m n m n mT
m m mT T
m
n
T
dC h hh h u h C v h C
dt
C t m M
h C
C C
y
C
x
u n
, , nr s h r s
25
Summary of Matrices
, ,,
, ,
, ,,
, ,
,,
,
r smn nm nm
T
r smn nm nm
T
n m T
x y x yh r sh
x r s x r s x
x y x yh r sh
y r s y r s y
x yh h
r s
MD MD
MD MD
M
Recall the factors: are constantover a straightsided triangle.
,, , , ,
,
x yr r s s
x y x y r s
26
Next Lecture
• We will use a better set of nodes (improve the condition number of the Vandermonde matrix).
• Time permitting we will prove consistency.