Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Lecture - Introduction
Ph.D. Course:
Nodal DG-FEM for solving partial differential equations
Allan P. Engsig-Karup
Scientific Computing Section
DTU Informatics
Technical University of Denmark ! Presentation and practical details
! Introduction to DG-FEM methods
August 6, 2012
! Getting setup for hands-on exercises
2 / 45
This course is organized and taught by This course is an activity of GPUlab, DTU Informatics
! Assoc. Prof. Allan Peter Engsig-Karup
Building 321, r. 016
DTU Informatics, Scientific Computing Section, DTU,
D T U I n f o r m a t i c s
Denmark.
! Prof. Jan Hesthaven The course is sponsored by the PhD school at Technical University
Building 321, r. 009 of Denmark
Division of Applied Mathematics, Brown University, USA. ! DTU Informatics Graduate School ITMAN
Teaching assistance during afternoons
and organized with support from
! Post Doc Ole Lindberg ! The Danish Center for Applied Mathematics and Mechanics,
DTU Informatics, Scientific Computing Section, DTU,
DCAMM
Denmark.
3 / 45 4 / 45
Course content Course structure
Week 1:
The following topics are covered in the course Time Monday Thuesday Wednesday Thursday Friday
1 Introduction & DG-FEM in one spatial dimension 08.30-09.00 Breakfast
09.00-11.30 1 2 3 4 Project work
2 Implementation and numerical aspects (1D) 12.30-16.00 Hands-on Hands-on Hands-on Hands-on Project work
3 Insight through theory
Week 2:
4 Nonlinear problems
Time Monday Thuesday Wednesday Thursday Friday
5 Extensions to two spatial dimensions 08.30-09.00 Breakfast
6 Introduction to mesh generation 09.00-11.30 5 5+6 7 8 Project work
12.30-16.00 Hands-on Hands-on Hands-on Hands-on Project work
7 Higher-order operators
8 Problem with three spatial dimensions and other advanced ! Lectures: approx. 2.5 h/day, including 15 mins review + 15
topics mins break.
! Hand-on exercises: approx. 3.5 h/day.
5 / 45 6 / 45
! Background
! What is your background? Experiences?
! Why are you here?
! Access to the databar terminals, software and Internet
! Access to Matlab codes, http://www.nudg.org
! Access to hands-on exercises/slides/ect.,
http://www2.imm.dtu.dk/~apek/DGFEMCourse/
! General information
! Course material:
Nodal Discontinuous Galerkin Methods - Algorithms, Analysis,
and Applications
By J. S. Hesthaven & T. Warburton (2008), Springer.
9 / 45 10 / 45
Course work
11 / 45 12 / 45
Computational Science and Engineering Our goals
17 / 45 18 / 45
Main benefits
! Robust
! Support resolution of complex geometries
! Domain is represented by non-overlapping cells ! Well-suited for hyperbolic conservation laws (local upwinding)
! Solution is represented locally as a cell average ! Method is local and can be made explicit in time
1 Method is locally conservative (due to telescopic property)
(
!
ū k ≡ u k dx k
hk Ωk ! Extensive theoretical framework since 1970’s
! PDE is satisfied on conservation form Main problems
d ū k ! Inability to achieve high-order accuracy in a straightforward
hk + f (x k+1/2 , t) − f (x k−1/2 , t) = hk ḡ k
dt way on general grids due to requirement for extended stencils
! The flux function needs to be reconstructed on cell interfaces (flux reconstruction problem)
x k±1/2 ! Grid smoothness requirements
f (x k−1/2 , t) = F (ū k−1 , ū k ), f (x k+1/2 , t) = F (ū k , ū k+1 )
21 / 45 22 / 45
Main benefits
! Robust
! Systematic implementation on unstructured meshes
! Domain is represented by non-overlapping elements
! Solution is represented globally using piecewise continuous
! High-order accuracy can be combined with complex
polynomials geometries
K
! Well-suited for elliptic problems (global statement)
'
uh (x) = u(xk , t)N k (x), N i (xj ) = δij ! Extensive theoretical framework since 1970’s
k=1
Main problems
! PDE is satisfied in a global manner
! Not well-suited for problems with direction (global statement)
) *
∂uh ∂fh duh
(
+ − gh j
N (x)dx = 0, j = 1, ..., K ⇒M + Sfh = Mgh ! Implicit in time reduces overall efficiency
Ωh ∂t ∂x dt
D k−1 Dk D k+1
x
L = xl1 xrk−1 = xlk xrk = xlk+1 xrK = R
hk+1
27 / 45 28 / 45
Formulating a DG-FEM scheme Formulating a DG-FEM scheme
We seek to represent the global solution using local high-order We want to find an approximation uh to the solution u of the
polynomial approximations similar to FEM general scalar conservation law
K
u(x, t) ∼ ∂t u + ∂x f (u) = g (x, t), x ∈Ω
%
= uh (x, t) = uhk (x, t),
k=1
Np Np
To do this, we form the local residual on the k = 1, .., K elements
& &
uhk (x, t) = ûjk (t)ψj (x) = uhk (xjk , t)lj (x) x ∈ D k : Rkh (x, t) = ∂t uhk + ∂x fhk − ghk
j=1 j=1
and require this to vanish locally in a Galerkin sense
using either a modal or nodal form.
'
This is the basis for arbitrary high-order accurate approximations. Rkh (x, t)lik (x)dx = 0, i = 1, ..., Np , k = 1, ..., K
Dk
Note: both low and high-order approximations then an option in
This is the basis for a nodal DG-FEM scheme.
the scheme.
However, we are not done yet... all elements are disconnected due
A high-order accurate method has asymptotic behavior O(hp ) of
to the local statement on the residual.
truncation error for h → 0 with p > 2.
29 / 45 30 / 45
1
In classical finite element terminology, the discrete operator approximating
the first derivative is called a convection/advection matrix.
33 / 45 34 / 45
It is also possible to derive yet another scheme from the weak form Consider the strong scheme
' ( ) *
∂t uhk ljk + ∂x uhk ljk − ghk ljk dx = n̂ · (fhk − f ∗ )ljk dx
' ( ) *
k k k k k k
∂t uh lj − uh ∂x lj − gh lj dx = − n̂ · f ∗ ljk dx Dk ∂D k
Dk ∂D k
by applying Gauss’s Theorem once more From this we can generate a local linear system of the form
' ( * duhk
Mk + S k fhk − Mk ghk = (fhk − f ∗ )δ1j − (fhk − f ∗ )δNp j
)
∂t uhk ljk + ∂x uhk ljk − ghk ljk dx = n̂ · (fhk − f ∗ )ljk dx dt
Dk ∂D k
which is clearly a semi-discrete system of the form
This is the so-called strong form.
duhk + ,
= −(Mk )−1 S k fhk − Mk ghk = (fhk − f ∗ )δ1j − (fhk − f ∗ )δNp j
We now have two basic DG-FEM schemes. How will they perform? dt
which can be solved by an appropriate explicit/implicit ODE solver.
35 / 45 36 / 45
Examples: error behavior
Consider the simple advection equation on a periodic domain
2π
∂t u − 2π∂x u = 0, x ∈ [0, 2π], u(x, 0) = sin(lx), l= λ
CPU time
Tests of h− and p-refinement
20
−2
10
0
10
1
−4
10 3
10
−6
10 1
Error
Error
−5
5 10
−8
10 0
1 0 50 100 150 200 250
−10
7
Integration time [wave periods]
10 h−version (P=2)
h−version (P=4) −10 h−version (P=1)
h−version (P=6) 10 p−version (K=20)
−12
10
10
1
10
2
41 / 45 42 / 45
43 / 45 44 / 45
Brief summary
45 / 45