|
numerics 0.1.0
|
Source: examples/heat_demo.cpp
Solves \(\partial_t u = \kappa\,\nabla^2 u\) on \([0,1]^2\) with zero Dirichlet BCs. A Gaussian blob set by num::gaussian2d + num::fill_grid diffuses under the standard 5-point Laplacian (num::pde::diffusion_step_2d_dirichlet). Three snapshots are rendered as a side-by-side heatmap with num::plt::heatmap.
| Feature | Role |
|---|---|
num::pde::diffusion_step_2d_dirichlet | Explicit Euler step: u += coeff · Lap(u), Dirichlet BCs |
num::gaussian2d | Isotropic Gaussian IC: \(\exp(-r^2/2\sigma^2)\) |
num::fill_grid | Populates an NxN grid from f(x, y) |
num::plt::heatmap | Renders a 2D field as a gnuplot pm3d map panel |
num::plt::subplot | Arranges multiple panels side by side |