Spectral Element Method
Spectral Methods
The spectral element method takes the geometric flexibility of FEM and the convergence rate of global spectral methods and combines them. Each element holds a high-order polynomial; refining the polynomial order on a smooth solution gives exponential convergence, not just . Done right, SEM gets you to engineering accuracy with orders of magnitude fewer DOFs than P1 FEM.
This series builds it from scratch. We start with the cardinal basis — Lagrange polynomials at Gauss-Lobatto-Legendre points — and grow into a multi-element 2D solver, ending with a time-dependent problem that exploits SEM's signature property: a diagonal mass matrix.
Why SEM
Three reasons SEM exists, and why production codes for fluid dynamics (Nek5000), seismology (SPECFEM3D), and atmospheric modeling (CAM-SE) are all spectral-element-based:
- Spectral convergence on smooth solutions. Error decays like in the polynomial order , instead of in the mesh size. For a target accuracy, the DOF count is dramatically smaller.
- Geometric flexibility. Unlike global spectral methods (Chebyshev, Fourier), SEM tolerates complex domains and holes — split the geometry into elements, run spectral inside each. Anywhere FEM works, SEM works.
- Diagonal mass matrix. Choosing GLL nodes for both the basis and the quadrature makes the mass matrix collapse to a diagonal. Explicit time stepping for dynamics becomes essentially free per step — no linear solve required.
Chapters
- GLL points and the nodal Lagrange basis — Build the cardinal basis. Why GLL specifically, why nodal, what the Lebesgue constant has to say. With a visualizer contrasting GLL vs. equispaced interpolation (Runge's phenomenon, made visible).
- GLL quadrature and the diagonal mass matrix — Why GLL quadrature is exact up to degree , and why integrating with quadrature on the same nodes the basis lives at collapses the mass matrix to a diagonal. The single fact that buys SEM most of its computational advantage.
- The spectral differentiation matrix — Closed-form formula for . Spectral accuracy of the discrete derivative; convergence visualization showing the log-y straight line.
- 1D SEM Poisson — single element — Stiffness via , GLL quadrature, solve, compare. The headline plot: SEM error vs on log-y next to FEM error vs on log-log.
- Multi-element SEM in 1D — C⁰ continuity at interfaces, h-version vs. p-version vs. hp-refinement. Two sliders, error vs. total DOF.
- 2D SEM on a single quadrilateral — Tensor-product Lagrange basis, the Kronecker structure of the mass matrix, the four-term stiffness matrix.
- Sum factorization — The trick that turns per-element work into by evaluating dimension by dimension. Why SEM scales to high in 2D and 3D.
- 2D SEM on a multi-element mesh — The full 2D solver. quadrilaterals at order , assembled, solved, rendered as a heatmap.
- Time-dependent SEM — Heat or wave equation. The diagonal mass matrix makes explicit time stepping essentially free per step. Animated visualization of wave propagation across the SEM mesh.
Upcoming chapters aren't written yet.
Prerequisites
Comfort with the
finite-element series —
weak forms, basis functions, assembly, boundary conditions.
Helpful but not required: the
spectral derivative
and Chebyshev
collocation pages, since SEM borrows directly from
global-spectral ideas. Implementation in Python with
numpy; visualizers in JavaScript so they run live.