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:


Chapters

  1. 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).
  2. 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.
  3. The spectral differentiation matrix — Closed-form formula for . Spectral accuracy of the discrete derivative; convergence visualization showing the log-y straight line.
  4. 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.
  5. Multi-element SEM in 1D — C⁰ continuity at interfaces, h-version vs. p-version vs. hp-refinement. Two sliders, error vs. total DOF.
  6. 2D SEM on a single quadrilateral — Tensor-product Lagrange basis, the Kronecker structure of the mass matrix, the four-term stiffness matrix.
  7. Sum factorization — The trick that turns per-element work into by evaluating dimension by dimension. Why SEM scales to high in 2D and 3D.
  8. 2D SEM on a multi-element mesh — The full 2D solver. quadrilaterals at order , assembled, solved, rendered as a heatmap.
  9. 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.