Expand description
Finite-difference PDE solvers for common one-dimensional equations.
All solvers operate on simple Vecf64` grids and accept closure-based
boundary conditions or source terms for flexibility. The emphasis is on
correctness and clarity rather than maximum performance.
Structs§
- CflCondition
- Stability criterion checker for explicit finite-difference schemes.
Functions§
- advection_
1d_ upwind - Solve the 1-D linear advection equation ∂u/∂t + c ∂u/∂x = 0 for
n_stepstime steps using a first-order upwind scheme. - burger_
equation_ 1d - Solve the inviscid Burgers equation ∂u/∂t + ∂(u²/2)/∂x = 0 for
n_stepstime steps using the Godunov (Rusanov) flux. - diffusion_
reaction_ 1d - Solve the 1-D diffusion-reaction equation
∂u/∂t = D ∂²u/∂x² + R(u, x, t)
for
n_stepstime steps using the explicit FTCS scheme. - heat_
equation_ 1d - Solve the 1-D heat equation ∂u/∂t = α ∂²u/∂x² for
n_stepstime steps using the explicit Forward-Time Centred-Space (FTCS) scheme. - poisson_
1d - Solve the 1-D Poisson equation −u″ = f on a uniform grid using the Thomas algorithm (tridiagonal matrix algorithm, TDMA).
- wave_
equation_ 1d - Solve the 1-D wave equation ∂²u/∂t² = c² ∂²u/∂x² using the second-order leapfrog (Störmer–Verlet) explicit scheme.