The Spectral-Element Method: Introduction: Heiner Igel
The Spectral-Element Method: Introduction: Heiner Igel
Heiner Igel
Computational Seismology 1 / 59
Outline
1 Introduction
2 Lagrange Interpolation
3 Numerical Integration: The Gauss-Lobatto-Legendre Approach
4 Weak Form of the Elastic Equation
5 Getting Down to the Element Level
6 Global Assembly and Solution
Computational Seismology 2 / 59
Introduction
Motivation
High accuracy for wave propagation problems (exact interpolation)
Flexibility with Earth model geometries (cubed sphere, curved elements)
Accurate implementation of boundary conditions (implicit)
Efficient parallelization possible (explicit time integration)
Computational Seismology 3 / 59
Introduction
History
Computational Seismology 4 / 59
Introduction
History
Computational Seismology 4 / 59
Introduction
History
Computational Seismology 4 / 59
Introduction
History
Computational Seismology 4 / 59
Introduction
History
Computational Seismology 4 / 59
Introduction
History
Computational Seismology 4 / 59
Introduction
History
Computational Seismology 4 / 59
Introduction
History
Computational Seismology 4 / 59
Introduction
History
Computational Seismology 4 / 59
Introduction
Ingredients:
Exact interpolation with
Lagrange polynomials
Numerical Integration
(Gauss-Lobatto-Legendre)
Weak formulation of wave
equation
Time extrapolation using
finite-differences
Computational Seismology 5 / 59
Introduction
u displacement
f external force
ρ mass density
µ shear modulus
Computational Seismology 6 / 59
Introduction
Boundary condition
traction-free surface
σij nj = 0
boundaries are at x = 0, L
Computational Seismology 7 / 59
Lagrange Interpolation
Computational Seismology 8 / 59
Lagrange Interpolation
3 elements (length 2)
Local basis functions
defined inside element
only
Linear basis function
(dashed)
Lagrange basis function
(solid)
Computational Seismology 9 / 59
Lagrange Interpolation
Lagrange polynomials
Computational Seismology 10 / 59
Lagrange Interpolation
(N)
`i (ξj ) = δij
They fulfill the condition that they exactly interpolate (or approximate)
the function at N+1 collocation points. Compare with discrete Fourier
series on regular grids or Chebyshev polynomials on appropriate grid
points (-> pseudospectral method).
Computational Seismology 11 / 59
Lagrange Interpolation
Computational Seismology 12 / 59
Lagrange Interpolation
Gauss-Lobatto-Legendre points
Computational Seismology 13 / 59
Lagrange Interpolation
Computational Seismology 14 / 59
Lagrange Interpolation
Function approximation
Other options at this point are the Chebyhev polynomials. They have
equally good approximation properties (but ...)
Computational Seismology 15 / 59
Lagrange Interpolation
Computational Seismology 16 / 59
Lagrange Interpolation
Visualize Lagrange
polynomials
Interpolate arbitrary
function using Lagrange
polynomials
Understand benefit of
GLL points (Runge
phenomenon)
Computational Seismology 17 / 59
Numerical Integration: The Gauss-Lobatto-Legendre Approach
Z1 Z1 N+1
X
f (x)dx ≈ PN (x)dx = wi f (xi )
−1 −1 i=1
Z1
(N)
wi = `i (x)dx .
−1
Computational Seismology 18 / 59
Numerical Integration: The Gauss-Lobatto-Legendre Approach
N ξi wi
2: 0 4/3
±1 1/3
p
3: ± 1/5 5/6
±1 1/6
4: 0p 32/45
± 3/7 49/90
±1 1/10
Computational Seismology 19 / 59
Numerical Integration: The Gauss-Lobatto-Legendre Approach
Computational Seismology 20 / 59
Numerical Integration: The Gauss-Lobatto-Legendre Approach
Computational Seismology 21 / 59
Weak Form of the Elastic Equation
Computational Seismology 22 / 59
Weak Form of the Elastic Equation
Galerkin Principle
Computational Seismology 23 / 59
Weak Form of the Elastic Equation
Weak Formulations
Computational Seismology 24 / 59
Weak Form of the Elastic Equation
Integration by parts
Z Z Z
w ρ ü dx + µ ∂x w ∂x u dx = w f dx
G
G G
Computational Seismology 25 / 59
Weak Form of the Elastic Equation
Computational Seismology 26 / 59
Weak Form of the Elastic Equation
Use approximation of u in weak form and (!) use the same basis
function as test function, w → ψi
Z Z Z
ψi ρüdx + µ∂x ψi ∂x udx = ψi f dx
G G G
Computational Seismology 27 / 59
Weak Form of the Elastic Equation
Xn Z
+ ui (t) µ(x) ∂x ψj (x) ∂x ψi (x) dx
Ge
Zi=1
= ψi f (x, t) dx
G
Computational Seismology 28 / 59
Weak Form of the Elastic Equation
Matrix notation
M Mass matrix
K Stiffness matrix
terminology originates from structural engineering problems
Computational Seismology 29 / 59
Weak Form of the Elastic Equation
Computational Seismology 30 / 59
Weak Form of the Elastic Equation
Computational Seismology 31 / 59
Weak Form of the Elastic Equation
Mapping
leads us to the solution for the coefficient vector u(t + dt) for the next
time step as already well known from the other solution schemes in
previous schemes.
Computational Seismology 32 / 59
Weak Form of the Elastic Equation
Solution scheme
h i
unew = dt 2 M−1 (f − K u) + 2u − uold
Computational Seismology 33 / 59
Getting Down to the Element Level
Computational Seismology 34 / 59
Getting Down to the Element Level
Element level
Computational Seismology 35 / 59
Getting Down to the Element Level
n
X ne Z
X
üi (t) ρ(x)ψj (x)ψi (x)dx
i=1 e=1G
e
n
X ne Z
X
+ ui (t) µ(x)∂x ψj (x)∂x ψi (x)dx
i=1 e=1G
e
ne Z
X
= ψj (x)f (x, t)dx .
e=1G
e
Computational Seismology 36 / 59
Getting Down to the Element Level
Computational Seismology 37 / 59
Getting Down to the Element Level
u inside element
n
X
u(x, t)|x∈Ge = uie (t)ψie (x)
i=1
Computational Seismology 38 / 59
Getting Down to the Element Level
n
X Z
üie (t) ρ(x)ψje (x)ψie (x)dx
i=1 Ge
n
X Z
+ uie (t) µ(x)∂x ψje (x)∂x ψie (x)dx
i=1 Ge
Z
= ψje (x)f (x, t)dx .
Ge
Computational Seismology 39 / 59
Getting Down to the Element Level
Computational Seismology 40 / 59
Getting Down to the Element Level
Coordinate transformation
Fe : [−1, 1] → Ge , x = Fe (ξ),
ξ = ξ(x) = Fe−1 (ξ), e = 1, . . . , ne
from our global system x ∈ G to our local coordinates that we denote
ξ ∈ Fe
(ξ + 1)
x(ξ) = Fe (ξ) = he + xe
2
where ne is the number of elements, and ξ ∈ [−1, 1]. Thus the physical
coordinate x can be related to the local coordinate ξ via
2(x − xe )
ξ(x) = −1
he
Computational Seismology 41 / 59
Getting Down to the Element Level
Z Z1
dx
f (x)dx = f e (ξ) dξ
dξ
Ge −1
dx he
J = = .
dξ 2
Computational Seismology 42 / 59
Getting Down to the Element Level
Skewed 3D elements
In 3D elements might be
skewed and have curved
boundaries. The calculation
of the Jacobian is then
carried out analytically by
means of shape functions.
Computational Seismology 43 / 59
Getting Down to the Element Level
n Z1
X dx
üie (t) ρ [x(ξ)] ψje [x(ξ)] ψie [x(ξ)] dξ
dξ
i=1 −1
System of n equations for each index j corresponding to one particular basis function.
We need to find basis functions that allows efficient and accurate calculation of the
required integrals.
Computational Seismology 44 / 59
Getting Down to the Element Level
N+1 Z1
X dx
üie (t) ρ(ξ)`j (ξ)`i (ξ) dξ
dξ
i=1 −1
N+1 Z1 2
X dξ dx
+ uie (t) µ(ξ)`˙j (ξ)`˙i (ξ) dξ
dx dξ
i,k =1 −1
Z1
dx
= `j (ξ)f (ξ, t) dξ
dξ
−1
Computational Seismology 46 / 59
Getting Down to the Element Level
with
dx
Mjie = wj ρ(ξ) δij
dξ ξ=ξj
N+1 2
X dξ dx
Kjie = wk µ(ξ)`j (ξ)`i (ξ)
dx dξ
k =1 ξ=ξk
dx
fje = wj f (ξ, t)
dξ ξ=ξj
Computational Seismology 47 / 59
Getting Down to the Element Level
N+1
X
∂x u e (ξ) = u e (ξi )`˙i (ξ)
i=1
Computational Seismology 48 / 59
Global Assembly and Solution
Computational Seismology 49 / 59
Global Assembly and Solution
(1)
(1)
M1,1
M1,1 (1)
(1) M2,2
M2,2
(2)
(1) (2)
M1,1 M3,3 + M1,1
(1)
M3,3
(2) (2)
Mg = + M
2,2
+
(3)
= M2,2
M1,1
(2) (2) (3)
M3,3 M3,3 + M1,1
(3)
M (3)
2,2 M2,2
(3)
M3,3 (3)
M3,3
Computational Seismology 50 / 59
Global Assembly and Solution
Computational Seismology 51 / 59
Global Assembly and Solution
(1)
f1
(1)
f2
(1) (2)
f3 + f1
(2)
fg = f2
(2) (3)
f3 + f1
(3)
f2
(3)
f3
Computational Seismology 52 / 59
Global Assembly and Solution
Computational Seismology 53 / 59
Global Assembly and Solution
Computational Seismology 54 / 59
Global Assembly and Solution
A substantial part consists of preparing the interpolation and integration procedures required to initialize the global mass- and
stiffness matrices. The final time-extrapolation is extremely compact and does not require the inversion of a global matrix as is the
case in classic finite-element methods.
Computational Seismology 55 / 59
Global Assembly and Solution
Computational Seismology 56 / 59
Global Assembly and Solution
Computational Seismology 57 / 59
Global Assembly and Solution
Summary
Computational Seismology 58 / 59
Global Assembly and Solution
Computational Seismology 59 / 59