|
numerics
|
A C++ numerical computing library with interactive physics simulations.
num::Vector, num::Matrix, num::SparseMatrix, num::BandedMatrixnum::Backend — seq, blocked, simd, blas, omp, gpunum::spectral::fft, num::spectral::ifft — complex DFT / inverse DFTnum::spectral::rfft, num::spectral::irfft — real-to-complex and inversenum::spectral::FFTPlan — precomputed plan for repeated transformsFFTBackend::seq (Cooley-Tukey radix-2), FFTBackend::fftw (FFTW3, optional)num::markov::UmbrellaWindow, MetropolisStats, UmbrellaStatsnum::SparseMatrix — CSR format; num::sparse_matvecnum::BandedMatrix — band-storage; num::banded_matvec, num::banded_solvepage_app_ising
Metropolis dynamics and umbrella-sampled nucleation on a 300×300 lattice. Reproduces Brendel et al. (2005) nucleation experiments.
| Library feature | Role |
|---|---|
num::markov::metropolis_sweep_prob | Sweep hot path with precomputed Boltzmann table |
num::markov::umbrella_sweep_prob | Per-sweep rejection / save-restore for window sampling |
num::SparseMatrix + sparse_matvec | Neighbour-sum matrix for energy observable (SIMD path) |
num::RunningStats, num::Histogram | Online mean, variance, nucleus-size distribution per window |
num::newton | Mean-field self-consistency equation solver |
page_app_fluid
Weakly compressible SPH with heat transport, rigid bodies, and particle injection. Tait EOS, cubic-spline kernel, Morris viscosity Laplacian.
| Library feature | Role |
|---|---|
num::CellList2D | O(1) neighbour queries; Newton-3rd-law pair traversal |
num::Backend dispatch | seq (pair loop) ↔ omp (per-particle) selectable at runtime |
num::Vector | Flat particle attribute arrays |
page_app_fluid3d
3D WCSPH with opposing hose jets, heat transport, and a free-orbit camera whose orientation rotates the gravity vector.
| Library feature | Role |
|---|---|
num::CellList3D | 3D counting-sort spatial hash; 13-stencil Newton-3rd-law pairs |
num::Backend dispatch | seq (pair traversal) ↔ omp (per-particle) |
num::Vector | Flat particle attribute arrays |
page_app_ns
Chorin projection on a staggered MAC grid; semi-Lagrangian advection; matrix-free CG pressure solve. Kelvin–Helmholtz double shear layer initial condition.
| Library feature | Role |
|---|---|
num::cg_matfree | Matrix-free CG for -∇²p = r; warm-start from previous pressure field |
num::dot | Inner products inside CG (dispatched to best available backend) |
num::Vector | Velocity faces u, v; pressure p; intermediates u*, v*, rhs |
page_app_tdse
Strang operator splitting with Crank–Nicolson kinetic sweeps; Thomas algorithm for O(N) tridiagonal solves; Lanczos eigendecomposition; five interchangeable potentials.
| Library feature | Role |
|---|---|
num::thomas | O(N) complex tridiagonal solve per row/column (kinetic sweeps) |
num::lanczos | Krylov subspace for lowest eigenmodes |
num::brent | Bessel zero-finding for exact circular-well energies |
num::gauss_legendre | Norm and energy quadrature |
page_app_em
DC current flow + magnetostatics on a 32³ voxel grid. Four Poisson problems (one electric, three magnetic) solved with matrix-free CG; interactive magnetic dipole.
| Library feature | Role |
|---|---|
num::cg_matfree | All four Poisson solves (variable-coefficient electric + 3× magnetic) |
num::Grid3D | 3D scalar field storage for φ, A, J, B components |
num::Vector | Flattened field arrays passed to the solver |
Run cmake --build build --target report to generate output/REPORT.md — a full snapshot of the current build:
output/plots/Sections whose backend was not found at configure time are left as placeholders, so the report always reflects exactly what is installed.