(dis)continuous Galerkin
nite element methods
Onno Bokhove and Jaap J.W. van der Vegt
Department of Applied Mathematics, University of Twente

6

6
6

5
.
8
5
.4
5.4
5.2
5
5
4.8
4.6
4.6 4.6 4
.4
4.4
4
.4
4.4
4.2
4.2
4.2
4.2
3.8
3
.8
3.4
3.43.4
3.4
3.2
3.2
3
3
2.8
2.8

2
.8
2.8

2
.8
2.6
2
.6
2.4
2.4
2.4

2
.4
2.4
2.2
2.2
2
.2
2
.2
2.2
2
2
2

2

2
1
.8
1
.8

1
.8
1.8

1
.8
1
.8

1
.8
1
.8
1
.6

1
.6
1.6

1
.6

1
.6
1.6

1
.6

1
.6
1.4
1.4
1
.4
1
.4 
1
.4
1
.4
1.4
1.4

1
.4
1
.4

1
.
4
1.4
1.2
1
.2

1
.2

1
1

0
.8
0.8
0
.6
0
.6
March 27, 2008
ii
Contents
1 Introduction 2
1.1 Convergence and stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Continuous and discontinuous Galerkin nite element methods . . . . . . . 4
1.4 Steps in the nite element discretization . . . . . . . . . . . . . . . . . . . . 5
1.5 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Finite element mesh 9
2.1 Mesh generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1 Mesh generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.2 Pseudo twodimensional meshes using Delaunay triangulation . . . . 9
2.2 Reference coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.1 One dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.2 Two dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 Continuous nite elements 13
3.1 Example: Poissons equation . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.1 Equation and boundary conditions . . . . . . . . . . . . . . . . . . . 13
3.1.2 Weak formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.3 Discretized weak formulation . . . . . . . . . . . . . . . . . . . . . . 14
3.1.4 Evaluation of integrals . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4 Space discontinuous Galerkin nite element methods 17
4.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.1.1 Linear advection and inviscid Burgers equation . . . . . . . . . . . . 18
4.1.2 Advectiondiusion and viscous Burgers equation . . . . . . . . . . 26
4.2 Onedimensional hyperbolic systems . . . . . . . . . . . . . . . . . . . . . . 31
4.2.1 System of equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2.2 Flow at rest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
i
Contents 1
5 Spacetime discontinuous Galerkin nite element methods 36
5.1 Spacetime methods for scalar conservation laws . . . . . . . . . . . . . . . 36
5.2 Spacetime discontinuous Galerkin nite element discretization . . . . . . . 41
5.3 Stabilization operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.4 Solution of algebraic equations for the DG expansion coecients . . . . . . 49
5.5 Stability analysis of the pseudotime integration method for the linear ad
vection equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6 Further reading 56
1
1
Figure title page: the twodimensional vorticity eld developed after the steadystate solution has been
perturbed suddenly by a steady oscillatory deformation of the upper channel boundary. See Bernsen et al.
(2004).
c O. Bokhove and J.J.W. van der Vegt, 2008.
Chapter 1
Introduction
In many areas of science solutions of partial dierential equations (PDEs) are required.
Analytical methods to solve PDEs are often complicated and exact solutions are not always
available, in which case numerical methods provide an established way to nd approximate
solutions to the PDEs. Numerical methods are approximate in that solutions of PDEs
(generally) depend on coordinates in a continuous way while numerical solutions depend
on a nite number of degrees of freedom. A numerical solution is obtained as solution of a
nite algebraic system of linear or nonlinear equations, which form a discretization of the
PDEs.
Three wellknown classes of discretization methods are nite dierence, nite volume and
nite element methods. Finite volume and nite element methods are especially well suited
for computations in complicated domains on (locally) irregular or unstructured meshes. A
mesh divides the domain of validity of a PDE into a nite number of elements. On each
such element, the discretization acccomplishes that each variable of the PDE is reduced to
depend on only a nite number of degrees of freedom per element. While nite element
methods appear to be more dicult to understand, they oer more exibility and superior
accuracy in domains with complex boundaries and boundary conditions. Furthermore, the
mathematical theory of nite element methods is welldeveloped.
1.1 Convergence and stability
The quality of a numerical method depends on its rate convergence, its accuracy and sta
bility. A discretization is convergent when for decreasing mesh size and time intervals the
numerical solution approaches the exact solution of the PDE.
The accuracy of a discretization concerns the rate of convergence as function of mesh
size. The truncation error consist of the discretization applied to the exact solution. The
remainder will be expressed as powers of the (spatial and temporal) mesh size. Briey,
consider the diusion equation u
t
= u
xx
on x [0, 1] for t > 0 with variable u = u(x, t) and
2
Chapter 1. Introduction 3
derivatives u
t
= u/t and u
xx
=
2
u/x
2
. An explicit nite dierence discretization is
U
n+1
j
U
n
j
t
U
n
j+1
2 U
n
j
+U
n
j1
x
2
= 0 (1.1.1)
with U
n
j
u(x
j
= j x, t = nt). The truncation error is the same discretization
T(x, t) =
u(j x, (n + 1) t) u(j x, nt)
t
2
(x, y) = f(x, y)
with unknown = (x, y), given function f = f(x, y), coordinates x, y R
2
with domain and Dirichlet and/or Neumann boundary conditions at the domain
boundary ;
(ii) the onedimensional hyperbolic linear advection and Burgers equations,
t
u +
x
u = 0 and
t
u +u
x
u = 0
with u = u(x, t); and
Chapter 1. Introduction 4
(iii) the onedimensional advectiondiusion and viscous Burgers equations
t
u +
x
u =
xx
u and
t
u +u
x
u =
xx
u
with u = u(x, t) and diusion coecient > 0. Here, our notation is as follows
2
=
2
/x
2
+
2
/y
2
,
t
= /t,
x
= /x,
xx
=
2
/x
2
.
In the latter two examples (ii) and (iii), the domain is x [0, L] with L > 0 and the
initial condition is u(x, 0) = u
0
(x). The boundary condition for the linear advection is
u(0, t) = u
b
(t), while for Burgers equation there are various choices to be discussed later.
For the advectiondiusion and viscous Burgers equations we limit ourselves to periodic
boundary conditions.
Poissons equation is the archetypical elliptic equation and emerges in many problems
such as inversion and electrostatics problems. Understanding the nite element discretiza
tion for Poissons equation further provides the tools for discretizing the Helmholtz equation,
2
k
2
= 0
for k
2
> 0 and real, although the solution of the continuous dierential and discretized
algebraic system now involves an eigenvalue problem for the eigenvalues k
2
. The linear
advection equation arises as the advective component of the advection diusion equation in
the limit 0, and the quadratic nonlinearity in Burgers equation is a paradigm for the
advective nonlinear terms arising in uid dynamics.
Note that the three examples coincide with the mathematical classication of PDEs:
Poissons equation and Helmholtz equation are elliptic equations, the linear advection and
Burgers equations are hyperbolic equations, and the advection diusion and the viscous
Burgers equations are parabolic equations.
1.3 Continuous and discontinuous Galerkin nite element
methods
Two nite element methods will be presented: (a) a secondorder continuous Galerkin
nite element method on triangular, quadrilateral or mixed meshes; and (b) a (space)
discontinuous Galerkin nite element method. Consider the triangular mesh in Fig. 1. In
the continuous nite element method considered, the function (x, y) will be approximated
by a piecewise linear function per element based on the nodal values of . Hence, the
discretization of denoted as
h
will be continuous.
Similarly, we can consider a piecewise linear discretization of a function u(x) in one
dimension, see Fig. 2a, in which the nodal values of u
h
(x) determine u
h
everywhere else.
Hence, this nite element discretization is based on function values at the nodes and is
continuous across elements. In contrast, in a discontinuous Galerkin nite element method
Chapter 1. Introduction 5
1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 1
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
x
y
(a) (b)
Figure 1.1: (a) This triangular mesh is generated as follows. Boundary points are placed,
here regularly, on the circular domain boundary. Subsequently, a specied number of points
are randomly placed within the unit circle and accepted when they are larger than a crit
ical distance, proportional to the distance between two boundary points, from all other
accepted points. Given these points, the Delaunay triangulation is used to make a balanced
triangular mesh including the link between the node and element or assembly information.
A counterclockwise orientation is then enforced, after which a standard mesh le with
the necessary nodal and element information is made. (b) A quadrilateral mesh can be
made by placing a point in the middle of each triangle and dividing the triangle into three
quadrilaterals. The resulting quadrilateral mesh can then be rened further. The orienta
tion and node to element assembly of this division process is subsequently made. Courtesy
Erik Bernsen.
a piecewise linear discretization is found on each element and the limit or trace values
approaching the nodes from the element left or right of a node are not assumed to be
continuous, see Fig. 2b. Hence, this discretization is continuous in each element but discon
tinuous across elements. While more degrees of freedom are required in the discontinuous
discretization, it oers generally more exibility and more accuracy.
1.4 Steps in the nite element discretization
Both the continuous and discontinuous Galerkin nite element discretizations usually con
tain the following steps:
Chapter 1. Introduction 6
x
u(x)
k k+1
element element
x
u(x)
k k+1
element element
Figure 1.2: In a continuous Galerkin nite element method, the variable u = u(x) is ap
proximated globally in a (piecewise linear) continuous manner (top gure). In contrast, in a
discontinuous Galerkin nite element method, the variable u = u(x) is approximated glob
ally in a discontinuous manner and locally in each element in a (piecewise linear) continuous
way (bottom gure).
I. Derive weak formulation: Each equation is multiplied by its own arbitrary test function,
integrated over the domain of validity entirely or as a sum of integrals over all elements,
and integrated by parts to obtain the weak formulation.
II. Form discretized weak formulation/algebraic system: The variables are expanded in the
domain or in each element in a series in terms of a nite number of basis functions.
Each basis function has compact support over neighboring elements (for continuous
nite elements) or within each element (for discontinuous nite elements). This ex
pansion is then substituted into the weak formulation, and a test function is chosen
alternately to coincide with a basis function, to obtain the discretized weak formula
tion. The resulting system is a linear or nonlinear algebraic system.
III. Evaluate of integrals in local coordinate system: A local or reference coordinate system
is used to evaluate the integrals. In the continuous nite element discretization global
matrices and vectors are assembled in the assembly routine.
Chapter 1. Introduction 7
IV. Solve algebraic system: The resulting algebraic system is solved (iteratively) using
forward time stepping methods or linear algebra routines.
Steps I and II are often combined in discontinuous Galerkin methods. If in step III, we have
not discretized time, we choose a time discretization of the ordinary dierential equations
resulting after the spatial nite element discretization. If in step IV the algebraic system
is nonlinear, we choose an iterative solution method which essentially will solve a linear
system at each iteration step.
Compact support means that the test functions are only nonzero locally over one or a
few neighboring elements. In the continuous nite element method (we consider), the basis
functions are zero at the edge of their domain of inuence, while in the discontinuous case
the basis function is (generally) nonzero within an element including the element boundary
and zero elsewhere. The careful denition of function spaces for the test and basis functions
is common practice in nite element methods. This is often perceived to be complicated,
but we will see that all the function spaces make sense, also intuitively.
1.5 Outline
In chapter 2 we discuss the generation of nite element meshes and provide the reference co
ordinate systems for nite elements in one and two dimensions. A straightforward algorithm
is sketched for the generation of unstructured twodimensional triangular and quadrilateral
meshes.
As an introduction, we start in chapter 3 with the wellknown piecewise linear continuous
Galerkin nite element discretization of the Poisson equation in two dimensions. For more
literature we refer to Brenner and Scott (1994), Lucquin and Pirronneau (1998), and Morton
(1996).
Space discontinuous Galerkin nite element methods are considered in chapter 4. As
an introduction, we consider scalar hyperbolic and parabolic systems in one dimension in
section 4.1. We focus therein in particular on the linear advection (diusion) and (vis
cous) Burgers equations as illustrating examples in the denition and explanation of the
numerical ux.
Onedimensional systems of hyperbolic equations with additional geometric, source or
sink terms are considered in section 4.2. We develop the general discretization but focus on
the crosssectionally averaged shallow water equations with frictional terms to discuss a nu
merical ux. The choice of numerical ux is dierent for each hyperbolic system and depends
in general on the nature of the eigenvalues in the system. We refer to the work of Cockburn
and Shu (1989) and Cockburn et al. (1989) on space discontinuous Galerkin methods for
the onedimensional scalar hyperbolic equation and hyperbolic systems. Bokhove (2005)
combined the space discontinuous Galerkin method with EulerianLagrangian free bound
ary dynamics to simulate ooding and drying for the shallow water equation, including
breakup in multiple patches.
Chapter 1. Introduction 8
The space local discontinuous Galerkin (LDG) method is considered in section 4.1.2 for
the onedimensional advection diusion and the viscous Burgers equations. We refer to
Cockburn and Shu (1998) and Yan and Shu (2002) for the local discontinuous Galerkin
discretizations of (nonlinear) advection diusion and wave equations. The local discontin
uous Galerkin method applied to a onedimensional nonlinear advection diusion equation
arising in geology is combined with positivity preservation and Lagrangian free boundary
dynamics in Bokhove et al. (2005), where also a fractional basis function is used in the free
boundary element.
Finally, the spacetime discontinuous Galerkin method is considered in chapter 5 for
scalar conservation laws.
The presentation of the material is (largely) not new but based on our own work. We
have included a list for the interested reader in chapter 6. It is a pleasure to thank Vijaya
Ambati, Christiaan Klaij, Willem Ottevanger, Sander Rhebergen, Henk Sollie and Yan Xu
for proofreading these notes.
In the JMBC Burgers course 2008, the practical sessions concern exercise 1, especially
ac, in section 4.3. Jaap van der Vegt will present the material on space discontinuous
Galerkin methods in section 4.1 and spacetime discontinuous Galerkin methods in chapter
5.
Chapter 2
Finite element mesh
2.1 Mesh generation
2.1.1 Mesh generator
There are structured and unstructered meshes. Structured meshes, which do not need to
be regular, can be generated relatively straightforward, but threedimensional unstructered
meshes generally require a mesh generation package. There are several mesh generation
packages commercially available.
2.1.2 Pseudo twodimensional meshes using Delaunay triangulation
Threedimensional meshes, regular in one direction, and unstructured twodimensional
meshes can be made using the wellknown Delaunay triangulation. The mesh generation
algorithm is outlined in Fig. 1.1 and its caption. It can be used to generate triangular as
well as quadrilateral meshes. We note that the quadrilateral mesh displayed is formed from
a triangular base mesh and is rened further, see Fig. 1.1. For multipleconnected and non
convex domains, the algorithm requires some extensions to exclude triangles outside the
domain that can be generated erroneously in the Delaunay step. In addition, to generate
a balanaced quadrilateral mesh near curved boundaries the placement of the point in the
parent triangle or quadrilateral requires some care to avoid elements with angles that are
too small (see Bernsen et al., 2006). The advantage of the algorithm outlined in Fig. 1.1
lies in its simplicity. It is relatively easily implemented by a user without the need of a com
plicated mesh generation package. We implemented it in Matlab using Matlabs builtin
Delaunay triangulation.
In the end, the mesh le allows us to obtain the global node number i = Index(k, ) given
the element number k and the local node number . Each element has a local node number,
denitely (counterclockwise) oriented. For triangles = 0, 1, 2 and for quadrilaterals =
0, 1, . . . , 3. Discontinuous Galerkin element methods also require a list of the faces in the
9
Chapter 2. Finite element mesh 10
mesh and the element (number) to the left and right of this face.
2.2 Reference coordinates
2.2.1 One dimension
The onedimensional domain = x [a, b] (b > a; a, b R) is partitioned by points x
k
(t),
k = 1, , N
el
+ 1, into N
el
open elements K
k
= x[x (x
k
, x
k+1
). The result is a
tessellation
T
h
= K
k
[
N
el
_
k=1
K
k
=
and K
k
K
k
= if k ,= k
, 1 k, k
N
el
(2.2.1)
with
K
k
the closure of K
k
. For convenience, we will also use the notation x
k,L
:= x
k
and
x
k,R
:= x
k+1
below. We dene [K
k
[ = x
k,R
x
k,L
. We further introduce a reference element
K
k
=
and K
k
K
k
= if k ,= k
, 1 k, k
N
el
(2.2.2)
with
K
k
the closure of element K
k
. Each such element K
k
has N
k
n
= N
n
= 3 or 4 nodes,
which are numbered locally in a counterclockwise fashion from 0 to N
n
1. It is convenient
to introduce a reference element
K and dene the mapping F
K
: R
2
R
2
between the
reference element
K and element K
k
as follows
x = F
K
k
(
) =
N
k
n
1
=0
x
k,
) (2.2.3)
with reference coordinate
= (
1
,
2
)
T
and shape functions
( x) =
(F
K
k
(
). (2.2.4)
Triangles have N
n
= 3 nodes x
k,m
= x
m
, corresponding to nodes (0, 0)
T
, (1, 0)
T
, (0, 1)
T
in the reference element, an the shape functions are
0
(
) =
0
= 1
1
2
,
1
(
) =
1
,
2
(
) =
2
. (2.2.5)
Chapter 2. Finite element mesh 11
The three normal vectors for triangular elements are
n
0
=
1
[ x
1
x
0
[
(y
1
y
0
, x
0
x
1
)
T
, n
1
=
1
[ x
2
x
1
[
(y
2
y
1
, x
1
x
2
)
T
,
n
2
=
1
[ x
0
x
2
[
(y
0
y
2
, x
2
x
0
)
T
. (2.2.6)
The Jacobian J
3
= J of the transformation between x and
is
J
3
=
_
1
x
1
y
2
x
2
y
_
=
_
x
1
x
0
y
1
y
0
x
2
x
0
y
2
y
0
_
. (2.2.7)
We computed the inverse of the Jacobian using the following relations
x
x
=
x
1
x
+
x
2
x
= 1,
x
y
=
x
1
y
+
x
2
y
= 0,
y
x
=
y
1
x
+
y
2
x
= 0
y
y
=
y
1
y
+
y
2
y
= 1,
or, in matrix notation
_
1 0
0 1
_
=
_
x
1
x
2
y
1
y
2
__
2
x
1
y
2
x
2
y
_
= JJ
1
.
Hence, gradients in x transform as follows
_
x
V
y
V
_
=(J
T
)
1
_
1
V
2
V
_
=
1
det J
3
_
y
2
y
0
y
0
y
1
x
0
x
2
x
1
x
0
_ _
1
V
2
V
_
(2.2.8)
with determinant det J
3
and [J
3
[ = [ det J
3
[. Triangles have three faces or sides S
0
, . . . , S
2
spanned by node pairs ( x
0
, x
1
), . . . , ( x
2
, x
0
). The faces S
0
, . . . , S
2
correspond to
2
=
0,
1
+
2
= 1 and
1
= 0 in the reference element, respectively.
For quadrilaterals there are N
n
= 4 nodes x
k,m
= x
m
. In the reference element
(1, 1)
2
, and we start counterclockwise with = 0 at node (1, 1)
T
in the reference
element. Furthermore, the shape functions are
0
(
) =(1
1
) (1
2
)/4,
1
(
) = (1 +
1
) (1
2
)/4,
2
(
) =(1 +
1
) (1 +
2
)/4,
3
(
) = (1
1
) (1 +
2
)/4. (2.2.9)
The four normal vectors for quadrilateral elements are
n
0
=
1
[ x
1
x
0
[
(y
1
y
0
, x
0
x
1
)
T
, n
1
=
1
[ x
2
x
1
[
(y
2
y
1
, x
1
x
2
)
T
,
n
2
=
1
[ x
3
x
2
[
(y
3
y
2
, x
2
x
3
)
T
, n
3
=
1
[ x
0
x
3
[
(y
0
y
3
, x
3
x
0
)
T
. (2.2.10)
Chapter 2. Finite element mesh 12
The Jacobian J
4
= J of the transformation between x and
is
J
4
=J
4
(
) =
_
1
x
1
y
2
x
2
y
_
=
1
4
_
(1
2
) (x
1
x
0
) + (1 +
2
) (x
2
x
3
) (1
2
) (y
1
y
0
) + (1 +
2
) (y
2
y
3
)
(1
1
) (x
3
x
0
) + (1 +
1
) (x
2
x
1
) (1
1
) (y
3
y
0
) + (1 +
1
) (y
2
y
1
)
_
.
(2.2.11)
Hence, gradients in x transform as follows
_
x
V
y
V
_
=(J
T
)
1
_
1
V
2
V
_
=
1
det J
4
_
2
y
1
y
2
x
1
x
_ _
1
V
2
V
_
(2.2.12)
with the determinant det J
4
and [J
4
[ = [ det J
4
[. Quadrilaterals have four faces S
0
, . . . , S
3
spanned by node pairs ( x
0
, x
1
), . . . , ( x
3
, x
0
). The sides S
0
, . . . , S
3
correspond to
2
=
1,
1
= 1,
2
= 1, and
1
= 1 in the reference element, respectively.
Chapter 3
Continuous nite elements
3.1 Example: Poissons equation
3.1.1 Equation and boundary conditions
Consider Poissons equation on the domain R
2
= f in (3.1.1a)
= g at
D
(3.1.1b)
n = 0 at
N
(3.1.1c)
with =
2
, the boundary given as the union of Dirichlet and Neumann parts such
that =
D
N
, and outward normal n at . Given the functions f = f( x) on
and g( x) for x
D
, we wish to solve = ( x).
Poissons equation can be integrated over the domain to obtain, after integration by
parts and use of the boundary conditions,
D
n d =
_
f d (3.1.2)
with d a lign segment along the boundary. Note that in case =
N
equation (3.1.2)
reduces to the constraint
_
[v[
2
d < (3.1.3)
13
Chapter 3. Continuous nite elements 14
and the Hilbert space
H
1
g
() := v L
2
()
v
x
,
v
y
L
2
(), v[
D
= g (3.1.4)
with function v satisfying the Dirichlet boundary condition (3.1.1b).
Next, we multiply (3.1.1a) by an arbitrary test function v H
1
0
, integrate over , and
use Gauss law while using the boundary conditions (3.1.1b) and (3.1.1c) to obtain
v
2
d x =
_
v (v ) d x (3.1.5)
=
_
v d x
_
D
v n d
_
N
v n d (3.1.6)
=
_
v d x =
_
v f d x (3.1.7)
with n the outward normal at the boundary, and d an innitesimal line element along the
boundary. Note that we have chosen v H
1
0
to eliminate the boundary contribution at the
Dirichlet boundary, and this is allowed because is known at
D
.
The weak formulation for the Laplace equation thus becomes: Find a H
1
g
(), such
that for all v H
1
0
() the following relation is satised
KT
h
_
K
v d =
KT
h
_
v f d (3.1.8)
with T
h
the set of nonoverlapping triangular or quadrilateral elements K covering .
3.1.3 Discretized weak formulation
We approximate the unknown function by
h
dened as an expansion
( x)
h
( x) =
N
nodes
j=1
j
w
j
( x) (3.1.9)
in terms of global basis functions w
j
( x, with j = 1, . . . , N
nodes
the node number and N
nodes
the total number of nodes (not on
D
). Often w
j
( x) is chosen such that w
j
= 1 on node
j and zero beyond and on neighboring nodes. Thus w
j
has compact support. The test
function v is arbitrary as long as it belongs to H
1
0
(). We therefore take v = w
i
alternately
for all i = 1, . . . , N
nodes
to obtain N
nodes
algebraic equations for the N
nodes
unknowns. If
we take v = w
i
in (3.1.8), we obtain the algebraic system
KT
h
__
K
w
i
w
j
d
_
j
=
KT
h
_
K
f w
i
d, (3.1.10)
Chapter 3. Continuous nite elements 15
where we use the summation convention to sum over repeated indices. In matrix form, we
write (3.1.10) as follows
A
ij
j
= b
i
(3.1.11)
in which the global matrix components
A
ij
=
KT
h
_
K
w
i
w
j
d i, j 0, . . . , N
nodes
(3.1.12)
and the vector slots
b
i
=
KT
h
_
K
f w
i
d i 0, . . . , N
nodes
(3.1.13)
follow from (3.1.10). We desire to obtain the solution vector = (
1
, . . . ,
N
nodes
)
T
by
inversion of the linear equations (3.1.11). Note that since w
i
has compact support, the
evaluation of the integrals in A
ij
and b
i
only involves a limited number of neighboring
elements around node i.
3.1.4 Evaluation of integrals
The Galerkin basis functions w
i
(x, y) with global node number i are now dened on element
K
k
in a piecewise linear manner as:
w
(x, y) = w
(F
1
K
(x, y)) =
)
with the local element index on element K
k
for which w
=
_
K
d (3.1.14)
=
_
K
_
(J
T
)
1
_
2
__
_
(J
T
)
1
_
2
__
[det(J)[ d
=
_
K
_
2
_
T
J
1
(J
T
)
1
_
2
_
[det(J)[ d
(3.1.15)
=
_
K
f w
d (3.1.16)
=
_
K
f
_
x(
1
,
2
), y(
1
,
2
)
_
(
1
,
2
)[ det(J(
)[ d
(3.1.17)
Chapter 3. Continuous nite elements 16
for , = 0, . . . , N
k
n
1 on each reference element
K.
Note, the basis functions w
i
are only nonzero in the elements connected to the vertex
with index i and it is therefore more practical to transform the integrals over the element
K into integrals over the reference element
K The integrals in (3.1.15)(3.1.17) can be
computed with a Gauss quadrature rule as follows, on a square reference element
_
1
1
_
1
1
h(, )dd =
2
n=1
2
m=1
h(
m
,
n
)
for some function h(, ) with
1
,
1
= 1/
3 and
2
,
2
= 1/
3, and on a triangular
reference element
_
1
0
_
1
0
h(, )dd =
1
6
_
h(1/2, 0) +h(0, 1/2) +h(1/2, 1/2)
_
.
Given these elemental matrices and vectors we assemble the global matrix, A, and global
vector, b, in the following assembly algorithm:
set all components of A = 0 and b = 0 to zero: A
ij
= b
i
= 0
for all elements K
k
, k = 1, N
el
, do
. for = 1, N
k
n
do
. i = Index(k, )
. for = 1, N
k
n
do
. j = Index(k, )
. A
ij
= A
ij
+
A
. b
i
= b
i
+
The function Index(k, ) maps the local vertex or node numbered of element K to
the global node number. This index is derived or available from the generated mesh le.
Note that we only included the interior nodes and the nonDirichlet boundary nodes i, j.
The matrix A
ij
is symmetric. Ecient methods to solve (3.1.11) involve Choleski fac
torizations or conjugate gradients (seee, e.g., Lucquin and Pironneau, 1998; and, Van der
Vorst, 2003).
Chapter 4
Space discontinuous Galerkin nite
element methods
4.1 Examples
In this section, we consider the space discontinuous Galerkin nite element discretization
of the linear advection equation and the nonlinear inviscid Burgers equation as well as
the linear advection diusion and nonlinear viscous Burgers equation. The spatial nite
element discretization will result in a system of ordinary, coupled algebraic and ordinary
dierential equations in time. Subsequentlty, we use a standard RungeKutta method (Shu
and Osher, 1989) to discretize time.
The domain in one dimension is simply a rod of length L divided into N
el
irregular
intervals or elements, see Fig. 4.1. More formally, we dene a tessellation T
h
of N
el
elements
K
k
in the spatial ow domain = [x
1
= 0, x
N
el
+1
= L] with L > 0 and boundary :
T
h
= K
k
:
N
el
_
k=1
K
k
=
and K
k
K
k
= if k ,= k
, 1 k, k
N
el
, (4.1.1)
where
K
k
denotes the closure of K
k
, et cetera. Element K
k
runs from node x
k
to node x
k+1
and has length [K
k
[ = x
k+1
x
k
.
1
elements
nodes
x
k k+1
x x x x
1
N+1
k N
Figure 4.1: A sketch of the onedimensional nite element mesh with a denition of the
node and element numbering. We denote with N = N
el
the total number of elements.
17
Chapter 4. Space discontinuous Galerkin nite element methods 18
4.1.1 Linear advection and inviscid Burgers equation
Equations
We consider in particular the linear advection equation
t
u +a
x
u = 0 (4.1.2)
for a R and the inviscid Burgers equation
t
u +u
x
u = 0 (4.1.3)
with initial condition u
0
= u(x, 0). The boundary conditions for the linear advection equa
tion are either (i) periodic, or (ii) specied at the inow boundary:
u(0, t) = u
left
(t) if a > 0 or u(L, t) = u
right
(t) if a 0. (4.1.4)
The boundary conditions for the Burgers equation are either (i) periodic, (ii) specied at
the inow boundaries:
u(0, t) = u
left
(t) if u(0, t) > 0 or u(L, t) = u
right
(t) if u(L, t) 0, (4.1.5)
or (iii) solid walls with u(0, t) = u(L, t) = 0.
It is convenient to set up the discretization for a general hyperbolic scalar equation. We
therefore concisely combine (4.1.2) and (4.1.3) as follows
t
u +
x
f = 0 (4.1.6)
with the ux f = f(u) in general, and f(u) = a u and f(u) = u
2
/2 for the linear advection
and Burgers equations in particular; and initial condition u
0
(x) = u(x, 0).
Weak formulation
We multiply (4.1.6) by an arbitrary test function w = w(x) (smooth within each element),
integrate by parts over each individual and isolated element, and then add the contribution
from all elements to obtain the following weak formulation:
N
el
k=1
__
K
k
w
du
dt
dx + [f(x
k+1
) w(x
k+1
) f(x
+
k
) w(x
+
k
)]
_
K
k
f(u)
x
wdx
_
= 0, (4.1.7)
where w(x
k+1
) = lim
xx
k+1
w(x, t) and w(x
+
k
) = lim
xx
k
w(x, t). (We only denote these
dependencies explicitly when confusion may arise.) Hence, the uxes at the faces arising in
element K
k
are evaluated inside the element.
Let [u] = u
+
u
and u = (u
+
+ u
= lim
xx
k
u(x) and u
+
= lim
xx
k
u(x). Consider the ux at a point
Chapter 4. Space discontinuous Galerkin nite element methods 19
x
k+1
. Since the elements K
k
are isolated from one another at this stage u
:= u(x
k+1
) ,=
u(x
+
k+1
) =: u
+
.
We rewrite the weak formulation (4.1.7) as a sum over the elements for the interior
integrals and a sum over the nodes for the face or nodal ux terms
N
el
k=1
__
K
k
w
du
dt
dx
_
K
k
f(u)
x
wdx
_
f(x
+
1
) w(x
+
1
) +f(x
N
el
+1
) w(x
N
el
+1
)
+
N
el
k=2
_
f(x
k
) w(x
k
) f(x
+
k
) w(x
+
k
)
_
= 0. (4.1.8)
The ux term at the interior nodes is rewritten as follows
f(x
k
) w(x
k
) f(x
+
k
) w(x
+
k
) =
_
(
1
f
+
+
2
f
) [w] + [f] (
2
w
+
+
1
w
)
_
[f]=0
= (
1
f
+
+
2
f
) [w] (4.1.9)
if we enforce continuity, i.e. [f] = 0, at a node; also
1
+
2
= 1 and
1,2
0.
The heart of the discontinuous Galerkin numerical method hinges now on the choice
of the numerical ux. In (4.1.9), we enforced continuity of the ux, which suggests that
we should replace f(x
k
) and f(x
+
k
) both by the same numerical ux
f =
f(u
, u
+
) =
1
f
+
+
2
f
k
) ,= f(x
+
k
) in the numerical discontinuous nite
element discretization. It turns out that for arbitrary
1,2
with
1
+
2
= 1 instabilities
can occur. In general, the numerical ux is chosen as a function of both u
+
and u
f =
f(u
, u
+
) or
f(x
k
) =
f
_
u
(x
k
), u
+
(x
k
)
_
. We discuss choice of the numerical ux
shortly.
Discretized weak formulation
We consider niteelement discretizations of the general linear advection and inviscid Burg
ers equations (4.1.6) with approximations u
h
, w
h
to the variable u = u(x, t) and test func
tions w = w(x). These are such that u
h
and w
h
belong to the broken space
V
h
=
_
v
v[
K
k
P
d
P
(K
k
), k = 1, . . . , N
el
_
, (4.1.10)
in which P
d
P
(K
k
) denotes the space of polynomials in K
k
of degree d
P
. Note that u
h
is continuous in an element but generally discontinuous at the nodes, i.e. across element
boundaries.
After replacement of u, w by u
h
, w
h
and f at the nodes by the numerical ux
f in (4.1.8),
Chapter 4. Space discontinuous Galerkin nite element methods 20
we arrive at the following weak formulation
N
el
k=1
__
K
k
w
h
du
h
dt
dx
_
K
k
f(u
h
)
x
w
h
dx
_
f
_
u
left
, u
h
(x
+
1
)
_
w
h
(x
+
1
)
+
f
_
u
h
(x
N
el
+1
), u
right
_
w
h
(x
N
el
+1
) +
N
el
k=1
f
_
u
h
(x
k
), u
h
(x
+
k
)
_ _
w
h
(x
k
) w
h
(x
+
k
)
_
= 0
(4.1.11)
with u
left
and u
right
the boundary values at the left and right boundary chosen to enforce
the boundary conditions, if necessary. For the linear advection equation with a > 0, with a
wind a blowing from left to right, no boundary condition is required at x = L, and vice
versa for a < 0.
To reduce the partial dierential equations explicitly to ordinary dierential equations,
we choose a nite number of (orthogonal) polynomials to expand the variables in each
element as follows:
u
h
(x, t) =
d
P
m=0
U
m
(K
k
, t)
m,k
(x), w
h
(x) =
d
P
m=0
W
m
(K
k
)
m,k
(x) (4.1.12)
with polynomial basis functions
m,k
(x) P
d
P
(K
k
). In one dimension the number of
coecients equals equals the degree of the polynomials plus one. These coecients are
chosen such that
U
0
=
U(K
k
, t) =
_
K
k
u(x, t) dx/[K
k
[ and
m,k
(x) =
_
1 if m = 0
m,k
(x)
_
K
k
m,k
(x) dx/[K
k
[ if m 1
_
.
Here, for example, we approximate u
h
, w
h
on K
k
by a mean and a slope
u
h
(x, t) =
U
k
+
U
k
1,k
(x) and w
h
(x) =
W
k
+
W
k
1,k
(x) (4.1.13)
with
U
k
=
U(K
k
, t) the mean and
U
k
=
U
1
(K
k
, t) the slope. We note that
1,k
= .
Since coecient
W
k
and
W
k
are arbitrary we can alternately set
W
k
and
W
k
to one in
each element and the other coecients
W
k
,
W
k
to zero. We thus obtain, after substituting
(4.1.13) into (4.1.11) and using the arbitrariness of
W
k
and
W
k
, the following equations for
the mean and uctuating part per element
[K
k
[
d
U
k
dt
+
f(x
k+1
)
f(x
k
) = 0 (4.1.14a)
[K
k
[
3
d
U
k
dt
+ [
f(x
k+1
) +
f(x
k
)]
_
1
1
f(U
h
) d = 0. (4.1.14b)
Chapter 4. Space discontinuous Galerkin nite element methods 21
Herein, the integrals expressed in the the reference coordinate system are approximated
with a thirdorder twopoint Gauss quadrature rule
_
1
1
f() d f(c
m
) +f(c
m
) (4.1.15)
with c
m
= 1/
, u
+
), is chosen to (i) be consistent such that
f(u, u) = f(u), (ii) be
conservative, which we have used in the derivation in (4.1.9), and (iii) reduce to an Eux,
that is,
_
u
+
u
f(s)
f(u
, u
+
) ds 0.
This last property of the Eux guarantees L
2
stability as we will discuss later. Note that
the numerical ux is the only way of communication between elements, and that the ux
is determined by the values of u
h
immediately left and right of each face.
Given the values u
and u
+
immediately left and right of each face or node x
k
, we wish
to obtain a sensible numerical ux. Note that u
h
is generally not constant in the neighboring
elements k 1 and k adjacent to node x
k
, except when only a leadingorder expansion is
used for which u(x, t) is approximated by its mean per element only. A wellknown way is
to extend the values u
into the left and right elements, and calculate the exact solution to
a local Riemann problem around each node x
k
: nd the solution u = u
e
(x, t) for t > t
0
of
t
u +
x
f(u) =0 (4.1.16)
u(x, t
0
) =
_
u
x < x
k
u
+
x x
k
. (4.1.17)
The numerical ux is then dened as
f = f(u
e
(x
k
, t)), which is an approximate ux as
solution u
e
is an exact solution to a local problem with simplied (piecewise constant)
initial condition. These local Riemann problems do not interfere with another as long as
the time step is small enough. Roughly speaking, the (shock or rarefaction) waves arising
from the jumps at the nodes should not cross another. Hence, there is a smoothing step
involved in each time step since the numerical solution is a projection onto a nite number
of polynomials.
The linear advection equation has characteristics dx/dt = a. Hence, du/dt = 0 on this
characteristic x = x
0
+ a t with x
0
an integration constant. The solution of the Riemann
problem (4.1.16) for the linear advection equation is therefore the upwind solution:
u
e
(x, t
) =
_
u
x < x
k
+a t
u
+
x x
k
+a t
(4.1.18)
Chapter 4. Space discontinuous Galerkin nite element methods 22
u
x
u
u u
u
x
right
shock
u
u
x
u
u
u
left rarefaction
x
x
right
left rarefaction
shock
left rarefaction
t
t t
t
t
+
+
+
+
Figure 4.2: The solution to the Riemann problem for Burgerss equation gives either a shock
solution for u
> u
+
, or a rarefaction wave for u
u
+
. The shock wave case divides in a
case where the (right) shock moves to the left and one where the shock moves to the right.
This depends on the sign of the shock speed s. The (left) rarefaction wave case divides
in three cases. The distinction into left and right wave is made for the case where the
wave moves into a state of rest with either u
+
= 0 (shock case with u
> u
+
) or u
= 0
(rarefaction case with u
u
+
).
for t
= t t
0
. Hence,
f
linear advection
(x
k
) =
_
a u
a > 0
a u
+
a 0
. (4.1.19)
Likewise, the characteristics of Burgers equation are dx/dt = u. Hence, du/dt = 0 on
these characteristics x = x
0
+u
0
t with x
0
an integration constant, such that the solution is
implicit u(x, t) = u
0
(xu(x, t)). For the constant initial data in the Riemann problem, the
characteristics are readily solved. We nd a shock wave when the characteristics converge
for u
> u+, and a rarefaction wave when the characteristics diverge for u
u
+
, as a
sketch in the x, tplane reveals. The ve dierent situations around the origin x
= x x
k
are sketched in Fig. 4.2.
Chapter 4. Space discontinuous Galerkin nite element methods 23
The discontinuity of the Burgers shock is located at x
b
(t) and has speed s = dx
b
(t)/dt,
which follows from (the Rankine Hugoniot relation)
0 = lim
0
_
x
b
(t)+
x
b
(t)
t
u +
x
(u
2
/2) dx = s [u] + [u
2
/2] (4.1.20)
with u = (U
l
+ U
r
)/2 and [u] = U
r
U
l
, and U
l
and U
r
the values immediately left and
right of the shock. Hence, s = (U
l
+ U
r
)/2. In the Riemann problem the shock wave thus
has shock speed s = (u
+ u
+
)/2 and its position is given by x
= s t
. Since the ux is
evaluated at x
= x x
k
, the ux is either
f = u
2
/2 when s > 0, or
f = u
2
+
/2 when s 0
for the shock wave case.
The rarefaction wave in the Riemann problem has characteristics dx
/dt
= u on which
u is constant. The tail and the head of the rarefaction wave lie at x
= u
and x
= u
+
t
,
respectively. Hence the solution is
u(x
, t
) =
_
_
_
u
< u
/t
< x
< u
+
t
u
+
x
> u
+
t
. (4.1.21)
We deduce from this solution that we must indeed have u
u
+
. So at x
= 0, we nd for
the rarefaction wave case that u(0, t
) = u
when u
> 0, u(0, t
) = 0 when u
< 0 and
u
+
> 0, and u(0, t
) = u
+
when u
+
< 0.
Hence, the numerical ux for Burgerss equation then becomes
f
burgers
(x
k
) =
_
_
u
2
/2 s > 0 u
> u
+
u
2
+
/2 s 0 u
> u
+
u
2
/2 u
> 0 u
u
+
0 u
< 0 u
+
> 0 u
u
+
u
2
+
/2 u
+
< 0 u
u
+
. (4.1.22)
We note and leave as a check that both these uxes are consistent and form Euxes, see
conditions (i) and (iii). For more complex functions and systems of hyperbolic equations,
the exact Riemann problem is often too complicated, and approximate Riemann solvers are
used to determine the numerical ux in a computationally ecient way.
Initial and boundary conditions
The expansion coecients
U
m
(K
k
, t) dened in (4.1.12) are obtained by projection of the
initial condition onto the basis functions
m,k
. For the piecewise linear case, we obtain the
initial values of the mean and slope per element as follows
U
k
(0) =
1
2
_
1
1
u
0
(x()) d (4.1.23)
U
k
(0) =
3
2
_
1
1
u
0
(x()) d. (4.1.24)
Chapter 4. Space discontinuous Galerkin nite element methods 24
For periodic boundary conditions, we take u
left
= u
h
(x
N
el
+1
) and u
right
= u
h
(x
+
1
). In
case we use a piecewise linear approximation, we thus have
u
left
=
U
N
el
+1
+
U
N
el
+1
and u
right
=
U
1
U
1
. (4.1.25)
For the linear advection equation with a > 0, we specify u
left
(t) and, likewise, u
right
(t) when
a 0. For Burgers equation with solid walls at x = 0, L, we take u
left
= (
U
1
U
1
) and
u
right
= (
U
N
el
+1
+
U
N
el
+1
). For Burgers equation and open boundaries, we need to specify
u
left
(t) when (
U
1
U
1
) > 0 and u
right
(t) when (
U
N
el
+1
+
U
N
el
+1
) < 0, as the wind u at the
relevant boundary then blows into the domain.
Time discretization and time step
We write (4.1.14) as a system of ordinary dierential equations
dU
dt
=G(U, t) (4.1.26)
with U = (
U,
U)
T
the state vector of unknown coecients of the basis functions, and the
remaining terms are collected in G and placed on the righthandside. We can then use the
secondorder
U
(1)
=U
n
+ t G(U
n
, t
n
)
U
n+1
=
_
U
n
+U
(1)
+ t G(U
(1)
, t
n
+ t)
_
/2 or
(4.1.27)
or the thirdorder RungeKutta method
U
(1)
=U
n
+ t G(U
n
, t
n
)
U
(2)
=
_
3 U
n
+U
(1)
+ t G(U
(1)
, t
n
+ t)
_
/4
U
n+1
=
_
U
n
+ 2 U
(2)
+ 2 t G(U
(2)
, t
2
+ t/2)
_
/3
(4.1.28)
of Shu and Osher (1989), for example, to discretize (4.1.26) in time. The numerical ux
dened in (4.1.19) and (4.1.22), which was based on the related Riemann problem, for the
linear advection and Burgers equations is time dependent. In the time stepping method,
it is evaluated at t
.
A rough time step estimate is based on the characteristics of both equations:
t = CFL min
k
([K
k
[)/[a[ or t = CFL min
k
([K
k
[)/ max
k
([
U
n
k
+
U
n
k
[, [
U
n
k
U
n
k
[)
(4.1.29)
with CFL the CourantFriedrichsLewy number; CFL 1. The time step can thus vary
over time. Via a linear stability analysis of the linear advection equation a more detailed
time step can be calculated or, for the nonlinear Burgers equation, estimated.
Chapter 4. Space discontinuous Galerkin nite element methods 25
Slope limiter
Articial numerical oscillations can appear around discontuities in the solution, because
the projection onto the nite element basis functions are approximate. To diminish these
undesirable oscillations, we apply a slope limiter after every time step. We apply the slope
limiter as described in [17]. The idea of the slope limiter is to replace the original polynomial
P
0
with a new polynomial P that uses the data of the midpoints of the original element u
m
and its neighboring elements u
a
and u
b
. Two linear polynomials, P
1
and P
2
are constructed
connecting the data of the neighboring element to that of the original element (see Fig. 4.3).
We obtain:
P
1
=
u
m
(x x
a
) u
a
(x x
m
)
x
m
x
a
, P
2
=
u
m
(x x
b
) u
b
(x x
m
)
x
m
x
b
. (4.1.30)
Now map the polynomials P
j
, j = 0, 1, 2 onto the DGspace and solve for ( u
0
)
j
and ( u
1
)
j
:
_
_
K
k
0
dK
_
K
k
1
dK
_
K
k
0
dK
_
K
k
1
dK
_
_
( u
0
)
j
( u
1
)
j
_
=
_
_
K
k
0
P
j
dK
_
K
k
1
P
j
dK
_
.
After the polynomial reconstruction is performed, an oscillation indicator is sought to assess
the smoothness of P
i
. The oscillation indicator for the polynomial P
i
, i = 0, 1, 2, can be
dened as o
i
= P
i
/x. The coecients of the new solution u in element K
k
are constructed
as the sum of all the polynomials multiplied by a weight, u
q
=
2
i=0
w
i
( u
q
)
i
, q = 0, 1 in
which the weights are computed as:
w
i
=
( +o
i
(P
i
))
2
j=0
( +o
i
(P
j
))
,
where is a positive number. Take small, e.g., = 10
12
. Take = 1. If we want more
smoothing, take e.g. = 10.
Pseudocode
The program outline for the discontinous Galerkin nite element discretization of the one
dimensional scalar hyperbolic equation (4.1.6) is as follows:
read input le/make input: get N
el
, CFL, T
end
, . . .
read mesh le/make mesh: make [K
k
[, x
k
,
U
k
,
U
k
, . . . ,
f
k
, RHS
k
set initial condition (4.1.23)
while (time < T
end
) time loop (to solve (4.1.14a),(4.1.14b)),
. determine time step
. do intermediate time steps, e.g. RK3 (4.1.28)
. calculate ux
f
k
at nodes x
k
, see, e.g., (4.1.19) & (4.1.22)
Chapter 4. Space discontinuous Galerkin nite element methods 26
P
1
P
2
x
m
x
a
x
b
K
k1
K
k
K
k+1
u
a
u
m
u
b
P
0
Figure 4.3: Slopelimiter
. calculate element integrals in (4.1.14b), put in RHS
k
. solution update
. do measurements
End.
(4.1.31)
4.1.2 Advectiondiusion and viscous Burgers equation
System of rst order equations
We consider the linear advection diusion equation
t
u +a
x
u =
2
xx
u (4.1.32)
for a, R and > 0, and the viscous Burgers equation
t
u +u
x
u =
2
xx
u (4.1.33)
on a domain = [0, L] with initial condition u
0
= u(x, 0).
We concisely combine (4.1.32) and (4.1.33) and rewrite it as a system of equations, rst
order in space,
t
u +
x
F
u
= 0 and q +
x
F
q
= 0 (4.1.34)
Chapter 4. Space discontinuous Galerkin nite element methods 27
with uxes F = (F
u
, F
q
)
T
:
F
u
= F
u
(u, q) = f(u) +q and F
q
= F
q
(u) = u. (4.1.35)
The ux F
u
has a convective part f(u) and a diusive part q. We remember that for
the advection diusion equation we have f(u) = a u and for the Burgers equation we have
f(u) = u
2
/2.
We consider periodic boundary conditions. A variety of boundary conditions is con
sidered in the geological application of Bokhove et al. (2005), where a combination of
Dirichlet, Neumann, and free boundary conditions are studied for a relevant nonlinear
advectiondiusion equation.
Weak formulation
We consider niteelement discretizations of (4.1.34) and (4.1.35) with approximations,
w
h
= (u
h
, q
h
), to the state vector, (u, q), and basis functions, v = (v
u
, v
q
). The discretization
is such that u
h
, q
h
, and (the approximations of) v
u,q
belong to the broken space (4.1.10).
We multiply (4.1.34) by test functions, v =
_
v
u
(x), v
q
(x)
_
, integrate by parts for each
individual and isolated element, and then add the contribution from all elements to obtain
the following weak formulation
N
el
k=1
__
K
k
v
u
du
h
dt
dx +
_
F
u
(x
k+1
) v
u
(x
k+1
)
F
u
(x
k
) v
u
(x
+
k
)
_
_
K
k
F
u
x
v
u
dx
_
= 0
N
el
k=1
__
K
k
v
q
q
h
dx +
_
F
q
(x
k+1
) v
q
(x
k+1
)
F
q
(x
k
) v
q
(x
+
k
)
_
_
K
k
F
q
x
v
q
dx
_
= 0,
(4.1.36)
where v
u,q
(x
k+1
) = lim
xx
k+1
v
u,q
(x, t) and v
u,q
(x
+
k
) = lim
xx
k
v
u,q
(x, t). We also replaced
the uxes at the nodes by numerical uxes
F
u
(x
k
) =
F
u
(w
k
, w
+
k
) and
F
q
(x
k
) =
F
q
(u
k
, u
+
k
).
Discretized weak formulation
We approximate u
h
and q
h
by a mean and slope
u
h
(x, t) =
U
k
+
U
k
and q
h
(x) =
Q
k
+
Q
k
(4.1.37)
with
Q
k
=
Q(K
k
, t) the mean and
Q
k
=
Q
k
(K
k
, t) the slope, and likewise for v
u
, v
q
. We
thus obtain, after substituting (4.1.37) into (4.1.36) and using the arbitrariness of the test
Chapter 4. Space discontinuous Galerkin nite element methods 28
functions, the following system of coupled algebraic and ordinary equations
[K
k
[
d
U
k
dt
+
F
u
(x
k+1
)
F(x
k
) = 0
[K
k
[
3
d
U
k
dt
+
_
F
u
(x
k+1
) +
F
u
(x
k
)
_
_
1
1
F
u
(u
h
, q
h
) d = 0
[K
k
[
Q
k
+
F
q
(x
k+1
)
F
q
(x
k
) = 0
[K
k
[
3
Q
k
+
_
F
q
(x
k+1
) +
F
q
(x
k
)
_
_
1
1
F
q
(u
h
, q
h
) d = 0.
(4.1.38)
The integrals can be approximated with a thirdorder Gauss quadrature rule, see (4.1.15).
Local discontinuous Galerkin method: numerical ux
The numerical ux,
F
u
(w
, w
+
), is chosen to (i) be consistent such that
F(w, w) = F(w),
(ii) be conservative, (iii) ensure a local determination of q
h
in terms of u
h
, (iv) reduce to
an Eux in the conservative limit when = 0, that is,
_
u
+
u
F
u
(s, q; = 0)
F
u
(w
, w
+
; = 0) ds 0
with F
u
(u, q; = 0) = f(u), and (v) be L
2
stable, as will be shown. Note that the ux is
the only way of communication between elements, and that the ux is determined by the
values of u
h
and q
h
immediately left and right of each face.
The numerical ux chosen is
F
u
(w
, w
+
) =
f(u
, u
+
) +q
+
and
F
q
= F
q
(u
) = u
, (4.1.39)
with
f(u
, u
+
) the convective ux valid in the inviscid limit = 0, and the diusive ux is
alternating, q
+
in
F
u
versus u
in
F
q
.
L
2
stability for the discretized equations follows in an analogy of the L
2
stability for the
continuous case, and motivates the choice of the numerical ux. To wit, multiply (4.1.34)
by u and q, respectively, sum, and integrate over space and time to obtain:
1
2
_
L
0
u(T)
2
u
2
0
dx +
_
T
0
_
L
0
q
2
dxdt
_
T
0
_
L
0
(F
u
x
u +F
q
x
q) dxdt+
_
T
0
(uF
u
+q F
q
)
x=L
(uF
u
+q F
q
)
x=0
dt = 0
1
2
_
L
0
u(T)
2
u
2
0
dx +
_
T
0
_
L
0
q
2
dxdt +
_
T
0
_
uF
u
(u)
_
[
x=L
_
uF
u
(u)
_
[
x=0
dt = 0,
(4.1.40)
Chapter 4. Space discontinuous Galerkin nite element methods 29
since
F
u
x
u +F
q
x
q = f(u)
x
u +q
x
u +u
x
q =
x
((u) +q F
q
) (4.1.41)
with (u) =
_
u
0
f(s) ds.
The discrete version of L
2
stability for the numerical spatial discretization proceeds
as follows (cf., Cockburn and Shu, 1998). We add the weak formulation (4.1.36) of both
equations and integrate in time to nd
B
h
(w
h
, v
h
) =
_
T
0
_
L
0
du
h
dt
v
u
+v
q
q
h
dxdt
_
T
0
2kN
el
(
F [v
h
])
k
dt+
_
T
0
(
F v
h
)
k=N
el
+1
(
F v
+
h
)
k=1
dt
_
T
0
1kN
el
_
K
k
F
x
v
h
dxdt
(4.1.42)
with w
h
= (u
h
, q
h
), v
h
= (v
u
, v
q
), and [v] = v
+
v
h
) +F
q
q
h
F w
h
_
k=N
el
+1
dt +
_
T
0
dissipation
(t) dt,
(4.1.43)
where
dissipation
(t) =
2kN
el
F [w
h
]
1kN
el
_
K
k
F
x
w
h
dx+
_
(u
h
) +F
q
q
h
_
k=N
el
+1
_
(u
h
) +F
q
q
h
_
+
k=1
.
(4.1.44)
Rewriting
1kN
el
_
K
k
F
x
w
h
dx =
2kN
]el
[(u
h
) +F
q
q
h
]
k
+
_
(u
h
) +F
q
q
h
_
+
k=1
_
(u
h
) +F
q
q
h
_
k=N
el
+1
(4.1.45)
is used to evaluate (4.1.44) further. Hence, requiring that
dissipation
(t) =
2kN
el
k
dissipation
(t) =
2kN
el
_
[(u
h
) +F
q
q
h
]
F [w
h
]
_
k
=
2kN
el
_
[(u
h
)] + [F
q
] q
h
[u
h
]
F
u
+
F
q
[q
h
] [q
h
]
F
q
_
k
> 0
(4.1.46)
Chapter 4. Space discontinuous Galerkin nite element methods 30
motivates the choice (4.1.39), where we used that
[F
q
q
h
] = [F
q
] q
h
+
F
q
[q
h
]. (4.1.47)
Reordering the chosen convective ux (4.1.39) in the limit = 0 produces
lim
0
k
dissipation
(t) = [(u
h
)] [u
h
]
f(u
, u
+
) =
_
u
+
u
F
u
(s, q; = 0)
f(u
, u
+
) ds 0
(4.1.48)
for F
u
(u, q; = 0) = f(u), which is satised provided that the Eux property (iv) holds.
In the diusive limit, the cancellation is as follows
[F
q
] q
h
[u
h
] q
+
+
F
q
[q
h
] [q
h
]
F
q
=
1
2
_
(u
+
u
) (q
+
+q
) 2 (u
+
u
) q
+
+ (u
+
+u
) (q
+
q
) 2 (q
+
q
) u
_
= 0.
Hence,
k
dissipation
0 and thus
dissipation
0. This proves L
2
stability, since the rst
two quadratic terms in (4.1.42) are now always bounded or even decreasing if the boundary
terms cancel. The boundary terms in (4.1.42) cancel for periodic boundary conditions, for
example.
Time discretization
We write (4.1.38) as a system of ordinary dierential and algebraic equations
dU
dt
=G
U
(U, q) and q = G
q
(U) (4.1.49)
with U = (
U,
U)
T
the state vector of unknown coecients of the basis functions and
q = (
Q,
Q)
T
, and G
U,q
the remaining terms placed on the righthandside. Using the
thirdorder RungeKutta method to discretize (4.1.49) in time, we obtain
q
n
= G
q
(U
n
), U
(1)
= U
n
+ t G
U
(U
n
, q
n
)
q
(1)
= G
q
(U
(1)
), U
(2)
=
_
3 U
n
+U
(1)
+ t G
U
(U
(1)
, q
(1)
)
_
/4
q
(2)
= G
q
(U
(2)
), U
n+1
=
_
U
n
+ 2 U
(2)
+ 2 t G
U
(U
(2)
, q
(2)
)
_
/3.
(4.1.50)
Note that we can solve for U and q in an explicit manner because the new (intermediate)
stage of q can always be found from the new (intermediate) stage of U before commencing
the time update.
Chapter 4. Space discontinuous Galerkin nite element methods 31
4.2 Onedimensional hyperbolic systems
4.2.1 System of equations
We will consider the space discontinuous Galerkin nite element discretization of the fol
lowing hyperbolic system of conservation laws with extra geometrical, source or sink terms
t
U +
x
F(U) = S, (4.2.1)
where U is the n
q
1 state vector of variables, F = F(U) the ux vector and S the source
vector. The ux F is such that A(u) = F/U has real eigenvalues. The system is at least
hyperbolic when S = 0.
To particularize the numerical ux, we need to specify a particular system. We have
chosen as example the equations modelling the crosssectionally averaged ow of shallow
water through a channel with a contraction. The variables involved are the velocity u =
u(x, t) and the crosssection A = A(x, t) = b(x) h(x, t), and the averaged depth across the
channel h(x, t) as function of the coordinate x along the channel and time. The width of
the channel b = b(x) is given. This dimensionless system in its pseudoconservative form
reads
t
A+
x
(Au) = 0 (4.2.2a)
t
(Au) +
x
_
Au
2
+
A
2
2 b F
2
0
_
=
A
2
2 b
2
F
2
0
x
b C
d
b Au[Au[/A
2
, (4.2.2b)
where F
0
= u
0
/
g h
0
is the Froude number and C
d
= C
d
b
0
/h
0
the friction coecient. This
Froude number F
0
is based on the upstream inow values of velocity, u
0
, and depth, h
0
.
The dimensional friction C
d
0.004 stems from the engineering practise (Akers, 2005). We
have used the upstream width b
0
, velocity and depth u
0
and h
0
to scale the system.
To relate (4.2.2) to (4.2.1) we identify
U = (A, m = Au)
T
, F =
_
Au, Au
2
+
A
2
2 b F
2
0
_
T
(4.2.3)
S = S
g
+S
0
(4.2.4)
S
g
=
_
0,
A
2
2 b
2
F
2
0
x
b
_
T
(4.2.5)
S
0
=
_
0, C
d
b Au[Au[/A
2
_
T
. (4.2.6)
Weak formulation
We choose a test function w
h
which is dened and continuous on each element K
k
, but
generally discontinuous across an element boundary. The weak formulation follows by
Chapter 4. Space discontinuous Galerkin nite element methods 32
multiplication of (4.2.1) with test function w
h
, integration (by parts) over each element and
summation over all elements
K
k
_
K
k
w
h
t
U F(U)
x
w
h
S w
h
dx +F
_
U(x
k+1
)
_
w
h
(x
k+1
) F
_
U(x
+
k
)
_
w
h
(x
+
k
) = 0
(4.2.7)
with x
+
k
= limx x
k
and x
k+1
= limx x
k+1
.
Numerical ux
We rework the summation of the uxes over elements in (4.2.7) to one over the nodes
K
k
_
K
k
F
_
U(x
k+1
)
_
w
h
(x
k+1
) F
_
U(x
+
k
)
_
w
h
(x
+
k
) =
F
_
U(x
+
1
)
_
w
h
(x
+
1
) +F
_
U(x
N
el
+1
)
_
w
h
(x
N
el
+1
)+
N
el
j=2
F
_
U(x
j
)
_
w
h
(x
j
) F
_
U(x
+
j
)
_
w
h
(x
+
j
)
F
_
U(x
+
1
)
_
w
h
(x
+
1
) +F
_
U(x
N
el
+1
)
_
w
h
(x
N
el
+1
) +
N
el
j=2
F
r
w
r
F
l
w
l
(4.2.8)
with F
r
= F
_
U(x
+
j
)
_
, F
l
= F
_
U(x
j
)
_
, w
r,l
denoting evaluation right or left of node x
j
. The
last expression we further reorder as follows
F
r
w
r
F
l
w
l
=(w
r
w
l
) (F
l
+ F
r
) + (w
r
+ w
l
) (F
r
F
l
)
=(w
r
w
l
) (F
l
+ F
r
),
(4.2.9)
by imposing ux conservation F
r
= F
l
of the continuous F(U), and with + = 1 and
, 0. Flux conservation is thus included explicitly.
We use the HLL or HLLC numerical ux (see Batten, 1997; and Toro, 1999) dened as
follows
F =
1
2
_
F
r
+F
l
([S
l
[ [S
m
[) U
l
+ ([S
r
[ [S
m
[) U
r
+[S
l
[ U
l
[S
r
[ U
r
_
, (4.2.10)
(S
l,r
S
m
) U
l,r
= (S
l,r
u
l,r
) U
l,r
+
_
0
P
P
l,r
_
(4.2.11)
P
= P
l,r
+A
l,r
(S
l,r
u
l,r
) (S
m
u
l,r
), (4.2.12)
S
l
= min(u
l
a
l
, u
r
a
r
), S
r
= max(u
l
+a
l
, u
r
+a
r
), a
l,r
=
_
h
l,r
/F
0
, (4.2.13)
Chapter 4. Space discontinuous Galerkin nite element methods 33
where a
l,r
are the gravity wave speeds to the left and rightof a node, and S
l,r
are the estimate
of the fastest left and right going waves.
In the discretization, we now approximate U U
h
by expansion of U in terms of basis
functions, continuous on each element, and replace F
l
+ F
r
by a numerical ux
F(U
l
, U
r
).
From (4.2.7), we then obtain
K
k
_
K
k
w
h
t
U
h
F(U
h
)
x
w
h
S(U
h
) w
h
dx +
F
_
U
h
(x
k+1
), U
h
(x
k+1
)
_
w
h
(x
k+1
)
F
_
U
h
(x
k
), U
h
(x
+
k
)
_
w
h
(x
+
k
) = 0.
(4.2.14)
Discretized weak formulation
When we expand U
h
and w
h
, cf. (4.1.12), into rst order polynomials we get
U
h
=
U
k
+
U
k
and w
h
=
W
k
+
W
k
(4.2.15)
with mean and slope coecients
U
k
(t) and
U
k
(t). Since w
h
is arbitrary, we can only take
W
k
= 1 and
W
k
= 1 alternately for each element, and obtain the spatial discretization
[K
k
[
d
U
k
dt
+
F
_
U
h
(x
k+1
), U
h
(x
k+1
)
_
F
_
U
h
(x
k
), U
h
(x
+
k
)
_
=
_
1
1
A
2
2 b
2
F
2
0
_
0
b
k
_
d +
[K
k
[
2
_
1
1
_
0
C
d
b Au[Au[/A
2
_
d (4.2.16)
[K
k
[
3
d
U
k
dt
+
F
_
U
h
(x
k+1
), U
h
(x
k+1
)
_
+
F
_
U
h
(x
k
), U
h
(x
+
k
)
_
_
1
1
F(U
h
) d =
_
1
1
A
2
2 b
2
F
2
0
_
0
b
k
_
d +
[K
k
[
2
_
1
1
_
0
C
d
b Au[Au[/A
2
_
d. (4.2.17)
Time discretization
Abstractly, we write the spatially discrete system (4.2.16)(4.2.17) as
d
U
dt
=
R
d
(U) and
d
U
dt
= R
d
(U). (4.2.18)
Two choices for the time discretization are a second order predictorcorrector Crank
Nicolson scheme, and the thirdorder RungeKutta scheme of Shu and Osher (1989). The
Chapter 4. Space discontinuous Galerkin nite element methods 34
predictorcorrector scheme is
=
U
n
+ t
R
d
(U
n
),
=
U
n
+ t R
d
(U
n
)
U
n+1
=
1
2
_
U
n
+
U
+ t
R
d
(U
n
) + t
R
d
(U
)
_
,
U
n+1
=
1
2
_
U
n
+
U
+ t R
d
(U
n
) + t R
d
(U
)
_
. (4.2.19)
In the proper CrankNicolson scheme the state U
is replaced by U
n+1
except the last U
U
(1)
=
U
n
+ t
R
d
(U
n
),
U
(1)
=
U
n
+ t R
d
(U
n
)
U
(2)
=
1
4
_
3
U
n
+
U
(1)
+ t
R
d
(U
(1)
)
_
,
U
(2)
=
1
4
_
3
U
n
+
U
(1)
+ t R
d
(U
(1)
)
_
U
n+1
=
1
3
_
U
n
+ 2
U
(2)
+ 2 t
R
d
(U
(2)
)
_
,
U
n+1
=
1
3
_
U
n
+ 2
U
(2)
+ 2 t R
d
(U
(2)
)
_
. (4.2.20)
4.2.2 Flow at rest
An important test specic to the shallow water equations (4.2.2) is whether rest ow with
u = 0 and h = H constant remains at rest. One can show that for rest ow with constant
h so that h
l
= h
r
and continuous b(x) so that b
l
= b
r
the numerical ux becomes
F =
_
0, b h
2
/(2 F
2
0
)
_
T
. If we project the discontinuous Galerkin expansion coecients of b(x)
such that b
h
remainscontinuous at the nodes and approximate
x
b in terms of this expansion,
then rest ow remains at rest in the numerical discetization. This is the reason why the
extra Sterm has been divided into a gradient, S
g
, and nongradient, S
0
, part in (4.2.3).
4.3 Exercises
1. The goal of this exercise is to make a numerical implementation and verication of
the space discontinuous nite element method for the scalar hyperbolic system, and
for the linear advection and inviscid Burgers equations considered in section 4.1.1 in
particular.
A wellknown strategy is to test the code rst for mean values only, that is, for a
leading order nite volume discretization (4.1.14a) before including the higher order
expansions in (4.1.12).
Chapter 4. Space discontinuous Galerkin nite element methods 35
(a) Write down two exact solutions for the linear advection equation: for the Rie
mann problem and for a general initial condition in a periodic domain.
(b) Write down exact solutions for Burgers equation, one for the Riemann problem
and one for general initial conditions using the method of characteristics. Predict
when wave breaking occurs for an initially smooth prole u
0
(x).
(c) Implement the algorithm, e.g. using Matlab. Use the pseudo code (4.1.31), if
necessary. For example, for Burgers equation
t
u +u
x
u = 0 we can use initial
data u
0
(x) = sin(
6
x) for a periodic domain 0 < x 12. For Burgers equation
t
u + u
x
u = 0, we can alternatively use Riemann initial data u
0
(x) = 1 for
x < 1 and u
0
(x) = 0 for x 1 (and vice versa) for a domain 0 < x 12 with
inow and outow boundaries.
(d) Take f(u) = a u and verify the implementation against exact solutions of the
linear advection equation. Show that the method is second order acccurate in
space for smooth and nonsmooth solutions by making convergence tables for the
L
1
, L
2
and L
F
u
(w
, w
+
) =
f(u
, u
+
) +q
and
F
q
= F
q
(u
+
) = u
+
(4.3.2)
also satises L
2
stability. Does the ux
F
u
(w
, w
+
) =
f(u
, u
+
) + q and
F
q
= F
q
( u) = u (4.3.3)
satisfy L
2
stability?
Chapter 5
Spacetime discontinuous Galerkin
nite element methods
5.1 Spacetime methods for scalar conservation laws
Many applications in uid dynamics have timedependent boundaries where the boundary
movement is either prescribed or part of the solution. Examples are uidstructure interac
tion, twophase ows with free surfaces, Stefan problems and water waves. In all of these
problems the computational mesh has to follow the boundary movement and the interior
mesh points have to move to maintain a consistent mesh without grid folding. This mesh
movement imposes additional complications for the numerical discretization relative to the
case without mesh movement. In particular, ensuring that the numerical discretization is
conservative on timedependent meshes is nontrivial. This is important for many reasons.
In the rst place the equations of uid dynamics express conservation of mass, momentum
and energy, which should preferrably also be satised at the discrete level, but also problems
with discontinuities require a conservative scheme since otherwise the shock speed will be
inaccurate.
A natural way to derive numerical discretizations for problems which require deforming
and moving meshes is to use the spacetime approach. In this technique time is considered
as an extra dimension and treated in the same way as space. In this chapter we will extend
the discontinuous Galerkin nite element discretization discussed chapter 4 to a spacetime
discretization. We will only discuss the main aspects of this spacetime DG method using
a scalar hyperbolic partial dierential equation in one space dimension as model problem.
The extension to parabolic and incompletely parabolic partial dierential equations and
systems are beyond the scope of these notes. More details on spacetime DG methods,
including applications to inviscid compressible ow described by the Euler equations of gas
dynamics, can be found in Van der Vegt and Van der Ven [23], [24]. Extensions of the
spacetime DG method to the advectiondiusion equation are given in Sudirham, Van der
36
Chapter 5. Spacetime discontinuous Galerkin nite element methods 37
Vegt and Van Damme [21] and for the compressible NavierStokes equations in Klaij, Van
der Vegt and Van der Ven [13].
Consider now a scalar conservation law in a time dependent ow domain (t) R with
boundary :
u
t
+
f(u)
x
1
= 0, x
1
(t), t (t
0
, T), (5.1.1)
with boundary conditions:
u(t, x
1
) = B(u, u
w
), x
1
(t), t (t
0
, T), (5.1.2)
and initial condition:
u(0, x
1
) = u
0
(x
1
), x
1
(t
0
). (5.1.3)
Here, u denotes a scalar quantity, t represents time, with t
0
the initial and T the nal time
of the time evolution. The boundary operator is denoted as B(u, u
w
), with u
w
prescribed
data at the boundary and denes which type of boundary conditions are imposed at .
Examples are Dirichlet boundary conditions, with u = u
w
, or Neumann boundary conditions
with
u
n
= u
w
, where n denotes the unit outward normal vector at . An example of a
timedependent domain, resembling a piston moving into and out of a cylinder is given in
Figure 5.1.
If we would directly discretize (5.1.1)(5.1.3) with a nite element or nite volume
method then at each instant of time the mesh points have to move in order to account
for the boundary movement. At their new position we generally do not have data points
available and we need to interpolate or extrapolate the data from the old mesh to the new
mesh. This interpolation process is generally nonconservative and can introduce substan
tial errors. Also, one has to be very careful in dening the proper mesh velocities. For a
detailed discussion see Lesoinne and Farhat [15].
An alternative approach is provided by the spacetime discretization method. In a space
time discretization we directly consider the domain in R
2
. A point x R
2
has coordinates
(x
0
, x
1
), with x
0
= t representing time and x R the spatial coordinate. We dene the
spacetime domain as the open domain c R
2
. The boundary c of the spacetime domain
c consists of the hypersurfaces (t
0
) := x c [ x
0
= t
0
, (T) := x c [ x
0
= T, and
Q := x c [ t
0
< x
0
< T. The spacetime domain boundary c therefore is equal to
c = (t
0
) Q (T).
The scalar conservation law (5.1.1) can now be reformulated in the spacetime frame
work. For this purpose we consider the spacetime domain c in R
2
, see Figure 5.2. The
spacetime formulation of the scalar conservation law (5.1.1) is obtained by introducing the
spacetime ux vector:
T(u) := (u, f(u))
T
.
Chapter 5. Spacetime discontinuous Galerkin nite element methods 38
x
1
(t)
t
1
x
(t)
(t)
Figure 5.1: Example of a time dependent ow domain (t).
The scalar conservation law then can be written as:
div T(u(x)) = 0, x c, (5.1.4)
with boundary conditions:
u(x) = B(u, u
w
), x Q, (5.1.5)
and initial condition:
u(x) = u
0
(x), x (t
0
). (5.1.6)
Here, the div operator is dened as div T =
F
i
x
i
.
The spacetime formulation requires the introduction of a spacetime slab, element and
faces. First, consider the time interval 1 = [t
0
, T], partitioned by an ordered series of time
levels t
0
< t
1
< < t
N
T
= T. Denoting the nth time interval as I
n
= (t
n
, t
n+1
), we have
1 =
n
I
n
. The length of I
n
is dened as t
n
= t
n+1
t
n
. Let (t
n
) be the spacetime
Chapter 5. Spacetime discontinuous Galerkin nite element methods 39
Q
x
1
x
Q
)
0
(t
(t)
(T)
E
0
Figure 5.2: Example of a spacetime domain c.
domain at time t = t
n
. A spacetime slab is then dened as the domain c
n
= c (I
n
R),
with boundaries (t
n
), (t
n+1
) and Q
n
= c
n
((t
n
) (t
n+1
)).
We now describe the construction of the spacetime elements / in the spacetime slab
c
n
. Let the domain (t
n
) be divided into N
n
nonoverlapping spatial elements K
n
. At
t
n+1
the spatial elements K
n+1
are obtained by mapping the vertices of the elements K
n
to their new position at t = t
n+1
. Each spacetime element / is obtained by connecting the
elements K
n
and K
n+1
using linear interpolation in time. A sketch of the spacetime slab
c
n
is shown in Figure 5.3. The element boundary of the spacetime slab is denoted as /
and consists of three parts K
n
, K
n+1
, and Q
n
K
= /(K
n
K
n+1
).
The geometry of the spacetime element can be dened by introducing the mapping G
n
K
.
This mapping connects the spacetime element /
n
to the reference element
/ = [1, 1]
2
and is dened using the following steps. First, we dene a smooth, orientation preserving
and invertible mapping
n
t
in the interval I
n
as:
n
t
: (t
n
) (t) : x
1
n
t
(x
1
), t I
n
.
Next, we split (t
n
) into the tessellation
T
n
h
with nonoverlapping elements K
j
. The ele
Chapter 5. Spacetime discontinuous Galerkin nite element methods 40
x
T
1
x
K
K
n
n
n+1
t
n
t
I
j
n+1
j
E
j
K
n
Q
j
Q
n
j
n
(T)
0
Figure 5.3: Spacetime slab in spacetime domain c.
ments K
j
are dened using the mapping F
n
K
:
F
n
K
: [1, 1] K
n
:
1
2
i=1
x
i
(K
n
)
i
(
1
),
with x
i
(K
n
) the spatial coordinates of the spacetime element at time t = t
n
and
i
the
standard linear nite element shape functions dened on the interval [1, 1] as:
1
(
1
) =
1
2
(1
1
),
2
(
1
) =
1
2
(1 +
1
).
Similarly, we use the mapping F
n+1
K
to dene the element K
n+1
:
F
n+1
K
: [1, 1] K
n+1
:
1
2
i=1
n
t
n+1
(x
i
(K
n
))
i
(
1
).
Using linear interpolation in time the spacetime element / can now be dened using the
mapping:
G
n
K
: [1, 1]
2
/
n
: (
0
,
1
) (x
0
, x
1
), (5.1.7)
Chapter 5. Spacetime discontinuous Galerkin nite element methods 41
t
x
t
x
t
F
n
K
G
K
1
1
[1,1]
2
S
n
S
2
t
2
2
K
n+1
K
K
n
x
n=
n
Figure 5.4: Geometry of 2D spacetime element in both computational and physical space.
with:
(x
0
, x
1
) =
_
1
2
(t
n
+t
n+1
)
1
2
(t
n
t
n+1
)
0
,
1
2
(1
0
)F
n
K
(
1
) +
1
2
(1 +
0
)F
n+1
K
(
1
)
_
.
An overview of the dierent mappings is given in Figure 5.4. The spacetime tessellation is
now dened as:
T
n
h
:= / = G
n
k
(
/) [ K
T
n
h
.
5.2 Spacetime discontinuous Galerkin nite element discretiza
tion
The spacetime formulation can be used both in continuous and discontinuous nite element
methods. The key dierence here is if continuous or discontinuous basis functions are used
inside a spacetime slab. In this section we will discuss the construction of a spacetime
Chapter 5. Spacetime discontinuous Galerkin nite element methods 42
discontinuous Galerkin discretization for the scalar conservation law (5.1.1). The rst step
is the denition of the basis functions
m
, (m = 0, 1, 2) on the master element
/ = [1, 1]
2
,
for which we use linear basis functions, both in space and time:
m
(
0
,
1
) = 1, m = 0,
=
m1
, m = 1, 2
The basis functions
m
on the spacetime element / then can be dened as:
m
(x) =
m
G
1
K
(x).
It is important to realize that these polynomial basis functions are dened independently
on each element and we do not require any continuity across element faces, both in space
and time. This is the main dierence with the discontinuous Galerkin method discussed
in chapter 4, where only discontinuous basis functions in space are used. An impression
of the basis functions is given in Figure 5.5. For a number of reasons, in particular the
denition of a stabilization operator to deal with discontinuous solutions, it is benecial to
split the test and trial functions into an element mean at time t
n+1
and a uctuating part.
We introduce therefore the basis functions
m
: / R:
(x
0
, x
1
) = 1, m = 0,
=
m
(x
0
, x
1
)
1
[K
j
(t
n+1
)[
_
K
j
(t
n+1
)
dK, m = 1, 2.
The discontinuous Galerkin discretization requires the denition of the following nite ele
ment space:
V
1
h
(T
n
h
) :=
_
v
h
v
h
[
K
n
j
P
1
(/
n
j
), j = 1, , N
n
_
,
with P
1
(/) = span
_
m
, m = 0, 1, 2
_
. The trial functions u
h
: T
n
h
R
2
are dened in each
element /
j
T
n
h
as:
u
h
(x) = T(u(x)[
K
) =
2
m=0
u
m
(/
j
)
m
(x), x /
j
, (5.2.1)
with T the projection operator to the nite element space V
1
h
(T
n
h
) and u
m
the expan
sion coecients. Due to the denition of the basis functions
m
, which ensures that
_
K(t
n+1
)
m
(x)dK = 0 for m = 1, 2, we have the relation:
u
h
(K
j
(t
n+1
)) :=
1
[K(t
n+1
)[
_
K(t
n+1
)
dK = u
0
,
and we can write:
u
h
(x) = u
h
(K
j
(t
n+1
)) + u
h
(x),
Chapter 5. Spacetime discontinuous Galerkin nite element methods 43
Figure 5.5: Discontinous Galerkin approximation of a function.
with u
h
(K
j
(t
n+1
)) the mean solution at t
n+1
and u
h
(x) the uctuations in element /
n
with
_
K(t
n+1
)
u(x)dK = 0. One of the main benets of this splitting is that the equation for u
0
is very similar to a rst order nite volume discretization and is only weakly coupled to the
equations for u
h
.
The discontinuous Galerkin nite element formulation is now obtained using the follow
ing steps. First, equation (5.1.4) is multiplied with arbitrary test functions w
h
V
1
h
and
integrated over the spacetime domain c, split into spacetime elements. After introducing
the trial functions u
h
V
1
h
, we obtain the weighted residual formulation:
Find a u
h
V
1
h
, such that for all w
h
V
1
h
, we have:
N
T
n=0
Nn
j=1
_
_
K
n
j
w
h
divT(u
h
)d/ +
_
K
n
j
(grad w
h
)
T
D(u
h
) grad u
h
d/
_
= 0. (5.2.2)
Here, the second integral is the stabilization operator, with D(u
h
) R
22
the stabilization
matrix, which is necessary to obtain monotone solutions near discontinuities. This contri
bution will be discussed in Section 5.3. The discontinuous Galerkin weak formulation is
now obtained by integrating (5.2.2) by parts, resulting in:
Chapter 5. Spacetime discontinuous Galerkin nite element methods 44
x
1
x
j
K
j
h
u
h
K
u
K
n
j
u
h
+
u
h
+
n+1
n
Q
Q
n
j
j
n
n
n
n
n
0
Figure 5.6: Denition of the traces in a spacetime slab.
Find a u
h
V
1
h
, such that for all w
h
V
1
h
, we have:
N
T
n=0
Nn
j=1
_
_
K
n
j
grad w
h
T(u
h
)d/ +
_
K
n
j
w
h
n
T(u
h
)d(/)
+
_
K
n
j
(grad w
h
)
T
D(u
h
) grad u
h
d/
_
= 0. (5.2.3)
In the evaluation of the integrals in the weak formulation it is important to make a distinc
tion between the traces at the element boundary taken from either the inside or the outside
of the element. The traces at / are dened as:
w
h
= lim
0
w
h
(x n
K
),
with n the unit outward spacetime normal vector at /. The traces are also shown in
Figure 5.6.
The integrals over the faces / in the weak formulation (5.2.3) can be further eval
uated using the fact that the interior faces are counted twice in the summation over the
Chapter 5. Spacetime discontinuous Galerkin nite element methods 45
elements. The same applies for boundary faces if we extend the mesh with ghostcells. We
can transform the integrals over the element boundaries therefore into:
K
_
K
w
h
T
d(/) =
S
_
S
1
2
(w
h
n
+w
+
h
n
+
)(T
+T
+
)+
1
2
(w
h
+w
+
h
)(T
+T
+
n
+
)do, (5.2.4)
with T
= T(u
h
), S the faces in the tessellation, and n
, n
+
the normal vectors at each
side of the face o, which satisfy n
+
= n
do =
_
S
w
h
n
+
T
+
do, w
h
V
1
h
(T
n
h
),
hence the second contribution in (5.2.4) is zero. The boundary integrals therefore are equal
to:
K
_
K
w
h
T
d(/) =
S
_
S
1
2
(w
h
w
+
h
)n
(T
+T
+
)do,
using the relation n
+
= n
h
, u
+
h
, n) =
1
2
n (T
+T
+
),
this introduces upwind information into the DG formulation and this technique shows a close
resemblance with upwind nite volume methods. The boundary integrals at the element
faces can therefore be expressed as:
K
_
K
w
h
T
d(/) =
S
_
S
(w
h
w
+
h
)H(u
h
, u
+
h
, n
)do
=
K
_
K
w
h
H(u
h
, u
+
h
, n
)d(/),
where we used the fact that the numerical ux has to be conservative, which imposes the
condition H(u
h
, u
+
h
, n
) = H(u
+
h
, u
h
, n
+
).
In the denition of the numerical ux we have to make a distinction between the faces
K
n
j
and K
n+1
j
at the time levels t = t
n
and t
n+1
, respectively, and the faces Q
n
j
. The rst
two faces have a spacetime normal vector n = (1, 0)
T
and information should only move
from the past to the future, whereas through the faces Q
n
j
information ows both into and
out of the element /. The numerical ux at the boundary faces K
n
j
and K
n+1
j
, therefore is
dened as:
H(u
h
, u
+
h
, n
) =u
+
h
at K
n
j
=u
h
at K
n+1
j
.
Chapter 5. Spacetime discontinuous Galerkin nite element methods 46
The numerical ux at the boundary faces Q
n
j
is chosen as a monotone Lipschitz H(u
h
, u
+
h
, n),
which is consistent:
H(u, u, n) = n T(u)
and conservative:
H(u
h
, u
+
h
, n
) = H(u
+
h
, u
h
, n
+
).
The monotone Lipschitz ux H(u
h
, u
+
h
, n) is obtained by (approximately) solving a Rie
mann problem with initial states u
h
and u
+
h
at the element faces Q
n
j
at time t = t
n
and
is discussed in detail in chapter 4. Important consistent and monotone Lipschitz uxes are
the:
Godunov ux
EngquistOsher ux
LaxFriedrichs ux
Roe ux with entropy x
HLLC ux.
The choice which numerical ux should be used depends on many aspects, e.g. accuracy,
robustness, computational complexity, and also personal preference. After introducing the
numerical uxes we can transform the weak formulation (5.2.3) into:
Find a u
h
V
1
h
(T
n
h
), such that for all w
h
V
1
h
(T
n
h
), the following variational equation
is satised:
Nn
j=1
_
_
K
n
j
(grad w
h
) T(u
h
)d/ +
_
K
j
(t
n+1
)
w
h
u
h
dK
_
K
j
(tn)
w
h
u
+
h
dK +
_
Q
n
j
w
h
H(u
h
, u
+
h
, n
)dQ+
_
K
n
j
(grad w
h
)
T
D(u
h
) grad u
h
d/
_
= 0. (5.2.5)
This formulation shows that due to the causality of the timeux, the solution in a space
time slab now only depends explicitly on the data from the previous spacetime slab.
The algebraic equation for the DG discretization are obtained by introducing the poly
nomial expansions for u
h
and w
h
, given by (5.2.1) into the weak formulation (5.2.5) and
using the fact that the coecients w
m
are arbitrary. The following set of equations for the
element mean u
h
(K
j
(t
n+1
)) are then obtained:
K
j
(t
n+1
)
u
h
(K
j
(t
n+1
))
K
j
(t
n
)
u
h
(K
j
(t
n
)) +
_
Q
n
j
H(u
h
, u
+
h
, n
)dQ = 0. (5.2.6)
Chapter 5. Spacetime discontinuous Galerkin nite element methods 47
Note, these equations have a similar structure as a rst order accurate nite volume formu
lation, except that more accurate data are used at the element faces.
The equations for the coecients u
m
(/
n
j
), (m = 1, 2) related to the uctuating part of
the ow eld u
h
are equal to:
2
m=1
u
m
(/
n
j
)
_
_
K
n
j
l
t
m
d/ +
_
K
n+1
j
l
(x
1
, t
n+1
)
m
(x
1
, t
n+1
)dK
+
_
K
n
j
l
x
k
D
kp
(u
h
)
m
x
p
d/
_
_
K
n
j
u
h
(x
1
, t
n
)
l
(x
1
, t
+
n
)dK
+
_
Q
n
j
l
H(u
h
, u
+
h
, n
)dQ
_
K
n
j
l
x
1
T
1
(u
h
)d/ = 0, l = 1, 2. (5.2.7)
The algebraic system given by (5.2.6)(5.2.7) is in general nonlinear, except for the case
of a linear advection equation when f(u) = au, with a a constant. The solution of this
nonlinear system of equations will be discussed in Section 5.4.
5.3 Stabilization operator
The discontinuous Galerkin nite element method without stabilization operator does not
guarantee monotone solutions around discontinuities and sharp gradients. In these regions
numerical oscillations develop when polynomials of degree one or higher are used. In order
to prevent these numerical oscillations frequently a slope limiter is used which reduces
the slope of u
h
in regions where the solution is oscillatory. The use of a slope limiter
in combination with a DG method results has become quite popular, but also has serious
disadvantages. It may result in an unnecessary reduction in accuracy in smooth parts of the
ow eld and prevents convergence to steady state, which is particularly important when
an implicit time integration method is used. The problems in obtaining a steady state
solution originate from an inconsistency in the combination of a discontinuous Galerkin
discretization and a slope limiter. Since the limited solution does not satisfy the steady
state of the discontinuous Galerkin equations, it is not possible to reduce the residual to
machine accuracy. Instead, the scheme tries to converge to the unlimited solution, which
suers however from numerical oscillations, and the limiter must remain active to prevent
this, resulting in limit cycle behavior.
A better alternative is provided by adding a stabilization operator to the DG discretiza
tion, such as proposed by Cockburn and Gremaud [8] and Jare, Johnson and Szepessy
[12].
The stabilization operator uses the jump in the polynomial representation at the element
faces in the discontinuous Galerkin discretization and the element residual. In this way
Chapter 5. Spacetime discontinuous Galerkin nite element methods 48
optimal use is made of the information contained in a DG discretization and we maintain
the compact stencil of the discontinuous Galerkin method.
The eectiveness of the stabilization operator in (5.2.5) strongly depends on the arti
cial viscosity matrix D(u
h
) R
22
. The denition of the articial viscosity matrix is more
straightforward if the stabilization operator acts independently in all computational coor
dinate directions. This is achieved by introducing the articial viscosity matrix
D R
22
in computational space using the relation:
D(u
h
[
K
n
j
, u
h
[
K
n
j
) = R
T
D(u
h
[
K
n
j
, u
h
[
K
n
j
) R, (5.3.1)
with u
h
[
K
n
j
the solution data in the neighboring elements of K
n
j
. The matrix R R
22
is
dened as:
R = 2 H
1
grad G
K
. (5.3.2)
The matrix H R
22
is introduced to ensure that both D and
D have the same mesh
dependence as a function of h
i
, and is dened as:
H = diag (h
0
, h
1
),
with h
i
R
+
the leading terms of the expansion of the mapping G
K
(5.1.7) in the computa
tional coordinates
i
, (0 i 1). The multiplication with the factor two in (5.3.2) ensures
that for orthogonal cells the matrix R is the rotation matrix from the computational space
to the physical space. The stabilization operator in (5.2.5) can now be further evaluated,
resulting in:
_
K
n
j
n
x
k
R
pk
D
pq
(u
h
[
K
n
j
, u
h
[
K
n
j
)R
ql
m
x
l
d/ =4
_
K
(H
1
)
pn
D
pq
(u
h
[
K
n
j
, u
h
[
K
n
j
)(H
1
)
qm
[J
G
K
[d
/,
=
4[/
n
j
[
h
2
n
nm
D
nn
(u
h
[
K
n
j
, u
h
[
K
n
j
)
(no summation on n), where we used the relations: (grad G
K
)
ij
= x
j
/
i
and
n
/
p
=
np
and made the assumption that
D is constant in each element.
The stabilization operator should act only in areas with discontinuities or when the
mesh resolution is insucient. This requirement can be directly coupled to the jump in
the solution across element faces and the element residual, respectively, both of which
are readily available in the discontinuous Galerkin discretization. In regions with smooth
solutions these contributions are of the order of the truncation error and will therefore not
reduce the accuracy in these regions.
For problems with discontinuities the articial viscosity model proposed and analyzed
by Jare, Johnson and Szepessy [12] is useful. In this model both the jumps at the element
Chapter 5. Spacetime discontinuous Galerkin nite element methods 49
faces and the element residual are used to dene the articial viscosity:
D
qq
(u
h
[
K
n
j
, u
h
[
K
n
j
) = max
_
C
2
h
2
K
R
q
(u
h
[
K
n
j
, u
h
[
K
n
j
) , C
1
h
3
2
K
_
, q = 1,
=0, otherwise,
with
R(u
h
[
K
n
j
, u
h
[
K
n
j
) =
k=0
T(u
h
)
u
h
u
h
(G
K
(0))
x
k
+C
0
u
+
h
(x
(3)
) u
h
(x
(3)
)
/h
K
+
2
m=1
1
h
K
n
T
K
f(u
+
h
(x
(m)
)) n
T
K
f(u
h
(x
(m)
))
, (5.3.3)
with h
K
=
_
h
2
0
+h
2
1
. The coecients , C
0
, C
1
and C
2
are positive constants and set
equal to C
0
= 1.2, C
1
= 0.1, C
2
= 1.0 and = 0.1. The points x
(1)
and x
(2)
are the
midpoints of the faces Q
n
j
and x
(3)
the midpoint of K
n
j
. For stronger shocks the addition
of the quasilinear form of the conservation law, which is the rst contribution on the
righthand side of (5.3.3), signicantly improves the robustness of the numerical scheme,
since this contribution detects discontinuities very well. Numerical tests showed that the
contributions of the element residual of the quasilinear equations and the contributions in
the jump of the ux at the element faces are equally important.
5.4 Solution of algebraic equations for the DG expansion co
ecients
The spacetime DG formulation results in an implicit timeintegration scheme. The equa
tions for the DG expansion coecients (5.2.6)(5.2.7) in the spacetime slab c
n
can be
represented symbolically as an equation for u
n
:
L( u
n
; u
n1
) = 0, (5.4.1)
with u
n1
the expansion coecients in the previous time slab c
n1
. In general the equations
for the expansion coecients will be nonlinear, only for the ux f(u) = au, with a a
constant, a linear system will be obtained. There are several ways to solve these non
linear equations. A standard procedure would be to apply a Newton method, but this
technique has several disadvantages. In the rst place computing the Jacobian matrix,
either analytically or numerically, is a nontrivial and computationally expensive task. Also,
ecient linear algebra techniques need to be used to solve the linear system. Considering
its size this generally have to be iterative, Krylov subspace methods, but nding good
preconditioners for the linear system, which strongly inuence both the convergence rate
Chapter 5. Spacetime discontinuous Galerkin nite element methods 50
and robustness, is dicult. Another disadvantage of a Newton method is that the locality
of the DG discretization is lost, because a large global linear system must be solved. This
particularly complicates the implementation on a parallel computer.
An alternative technique to solve the nonlinear system of algebraic equations (5.2.6)
(5.2.7) is to use a pseudotime integration method. In this technique a pseudotime deriva
tive of the expansion coecients is added to (5.4.1) and this equation is solved by marching
the solution with a RungeKutta method to a steady state:
u
(/
n
j
)
=
1
t
L( u
, u
n1
).
At steady state, when
u
= 0, then u
n
= u
.
The pseudotime integration scheme uses a pointimplicit ve stage RungeKutta (RK)
scheme, which can be summarized as:
Algorithm 1. RungeKutta algorithm for pseudotime integration.
1. Initialize the rst RungeKutta stage: v
(0)
= u
n1
.
2. Do for all stages s = 1 to 5:
(1 +
s
) v
(s)
= v
(0)
+
s
_
v
(s1)
L
k
( v
(s1)
, u
n1
)
_
3. End do
4. Update solution: u
n
= v
(5)
.
Here, is dened as
= /t and the RungeKutta coecients are equal to
1
=
0.0791451,
2
= 0.163551,
3
= 0.283663,
4
= 0.5, and
5
= 1.0.
This pseudotime integration technique is very simple to implement and preserves the
locality of the DG discretization. It will, however, only be ecient when fast convergence
to steady is achieved. For this purpose the coecients in the RungeKutta scheme have
been optimized to damp the transients in the pseudotime integration as quickly as possible
and to allow large pseudotime steps. In addition, the use of a point implicit RK scheme
ensures that the pseudotime integration method is stable for any positive value of . More
details about the RK scheme will be given in the next section. Optimizing the RungeKutta
scheme is, however, not sucient to obtain an ecient solver. Convergence to steady state
is therefore further accelerated using a multigrid technique. In this method the original
ne mesh is coarsened a number of times and the solution on the coarse meshes is used to
accelerate convergence to steady state on the ne mesh. For the details of the multigrid
algorithm we refer to van der Vegt and van der Ven [23] since they are beyond the scope of
these notes.
Chapter 5. Spacetime discontinuous Galerkin nite element methods 51
5.5 Stability analysis of the pseudotime integration method
for the linear advection equation
A simple example of a spacetime DG discretization is obtained by considering the linear
advection equation:
u
t
+au
x
= 0,
with a > 0. After some lengthy algebra, the spacetime discontinuous Galerkin discretiza
tion for the linear advection equation using a mesh with grid velocities s
j
a, j = 1, N,
with N the number of mesh points, can be represented in matrix form as:
/
U(/
n
j
) B
U(/
n
j1
) = (
U(/
n1
j
),
with:
/ =
_
_
_
_
_
x
n+1
j
+c
n
j+
1
2
c
n
j+
1
2
c
n
j+
1
2
2a
1
+c
n
j+
1
2
2at
n
1
3
a
2
+c
n
j+
1
2
+d
11
2a
1
c
n
j+
1
2
+ 2at
n
x
n
j
x
n+1
j
c
n
j+
1
2
c
n
j+
1
2
2
3
a
3
+
4
3
c
n
j+
1
2
+d
22
_
_
_
_
_
B =
_
_
_
_
_
c
n
j
1
2
c
n
j
1
2
c
n
j
1
2
c
n
j
1
2
c
n
j
1
2
c
n
j
1
2
c
n
j
1
2
c
n
j
1
2
4
3
c
n
j
1
2
_
_
_
_
_
, ( =
_
_
_
_
x
n
j
0 0
0
1
3
x
n
j
0
2x
n
j
0 0
_
_
_
_
,
with x
n
j
= x
n
j+1
x
n
j
, x
n
j
=
1
2
(x
n
j
+ x
n
j+1
), a
1
= x
n+1
j
x
n
j
, a
2
= 2x
n+1
j
x
n
j
,
a
3
= 2x
n
j
+x
n+1
j
, c
n
j
1
2
= t
n
(a s
j
1
2
), and s
n
j+
1
2
= (x
n+1
j+1
x
n
j+1
)/t
n
. Here x
n
j
and
x
n
j+1
denote the begin and end points of the element at time t
n
, respectively. The terms
d
11
and d
22
are determined by the articial dissipation operator.
The linear advection equation provides a nice model problem to study the stability of the
pseudotime integration method. For this purpose, we assume periodic boundary conditions
and use Fourier analysis to investigate the properties of the RungeKutta scheme. If we
assume that the mesh size is uniform mesh and the time step, element size, and velocity
remain constant, i.e. t = t
n
, x = x
n+1
j
= x
n
j
, and s = s
n
j
1
2
= s
n
j+
1
2
for all j
and n, and set the articial viscosity coecients equal to zero, then the operator L can be
expressed as:
L(
U
n
,
U
n1
) = /
U(/
n
j
) B
U(/
n
j1
) (
U(/
n1
j
), (5.5.1)
with the matrices /, B, ( R
33
dened as:
/ =
_
_
_
1 +
1
3
+
2 2 +
4
3
_
_
_, B =
_
_
_
4
3
_
_
_, ( =
_
_
_
1 0 0
0
1
3
0
2 0 0
_
_
_,
Chapter 5. Spacetime discontinuous Galerkin nite element methods 52
with = t(a s)/x and s a.
Consider the spatial Fourier mode
U(/
n
j
) = e
ij
U
F
, and introduce this into (5.5.1), then
the stability of the pseudotime integration algorithm is determined by the equation:
d
U
F
d
=
1
t
T()
U
F
,
with T() = / e
i
B. Since the linear advection equation is hyperbolic the matrix
T can be written as: T = QMQ
1
, with Q the matrix of the right eigenvectors of T
and M a diagonal matrix with the eigenvalues
m
() of T(). Introducing a new vector
V
F
= Q
1
U
F
, we obtain a system of independent ODEs:
d
V
F
m
d
=
m
()
t
V
F
m
, for m = 0, 1, 2.
This system of ordinary dierential equations is solved with the pointimplicit RungeKutta
scheme given by Algorithm 1. The amplication factor G(z) is dened recursively as:
G(z) = 1
For s = 1 to 5
G(z) =
1.0 +
s
(
+z)G(z)
1.0 +
s
End for
The pseudotime integration method is stable if the amplication factor G satises the
condition [G(z
m
())[ 1, for m = 0, 1, 2; [0, 2) with z
m
() dened as z
m
() =
m
(). The stability is analyzed for dierent values of the physical and pseudotime
step CFLnumbers (dened as CFL
t
= at/x and CFL
= a/x, respectively),
and the ratio s/a.
In Figure 5.7 contour values of the stability domain [G(z)[ 1 for the 5stage semi
implicit RungeKutta scheme with optimized coecients given by Algorithm 1 are shown
for the physical CFL numbers CFL
t
= 1 and 100, respectively. Also shown are the loci
of the eigenvalues z
m
(), [0, 2), which must be inside the stability region to ensure
the stability of the pseudotime integration. For CFL
t
= 1 the RungeKutta scheme
is stable for CFL
= 1.8
(bottom), no grid velocity.
Chapter 5. Spacetime discontinuous Galerkin nite element methods 54
ensure stability when the semiimplicit technique is not used. For physical CFL numbers
larger than 100 the eect of the pointimplicit RungeKutta scheme is, however, negligible.
The eect of using optimized coecients in the RungeKutta scheme is also large, as can be
seen in Figure 5.8 where the stability contours for the pointimplicit RungeKutta scheme
with coecients
s
=
1
4
,
1
6
,
3
8
,
1
2
, 1 for the stages s = 1, , 5 are shown. This are the co
ecients for the Jameson RungeKutta scheme, which is a popular RungeKutta method
in computational uid dynamics and also frequently used as a smoother in multigrid algo
rithms. For this RungeKutta scheme the pseudotime step CFL number must be reduced
to CFL
0.95 for the Jameson RungeKutta scheme. The eect of grid velocity
is stabilizing if the grid velocity is in the range 0 s a. This is a direct consequence of
the relation = CFL
t
(1 s/a). When the grid velocity is in this range then it reduces
the eective physical time step CFL number and since the pseudotime integration has a
larger stability domain for smaller values of CFL
t
this improves stability.
5.6 Conclusions
The spacetime discontinuous Galerkin nite element method provides a versatile conserva
tive numerical technique to solve partial dierential equations on time dependent domains
which require moving and deforming meshes. The spacetime DG method results in a very
local, element wise discretization, which is benecial for mesh adaption using local grid
renement or adjustment of the polynomial order and parallel computing. The use of a
pseudotime integration method using a RungeKutta time integration method in combi
nation with a multigrid technique provides an ecient algorithm to solve the nonlinear
algebraic equations for the expansion coecients in a spacetime DG method.
Chapter 5. Spacetime discontinuous Galerkin nite element methods 55
10 9 8 7 6 5 4 3 2 1 0
5
4
3
2
1
0
1
2
3
4
5
Re(z)
I
m
(
z
)
0
.
6
0
.
8
0
.
4
0
.
4
0
.
2
0
.
2
0
.
4
0
.
6
0
.
8
1
1
10 9 8 7 6 5 4 3 2 1 0
6
4
2
0
2
4
6
Re(z)
I
m
(
z
)
0
.
2
0.2
0
.
2
0.2
0
.
2
0
.
4
0
.
4
0
.6
0
.
6
0
.8
0
.
8
1
1
Figure 5.8: Loci of the eigenvalues z
m
(), [0, 2), (dots) of the DG discretization of
u
t
+ au
x
= 0 and the stability domain of the explicit 5stage RungeKutta method with
optimized coecients (top) and the ve stage semiimplicit Jameson RungeKutta scheme
(bottom). CFL
t
= 1.0. CFL