Expand description
§tpt-sci-grid
Structured finite-difference grids and stencils for the tpt-science
pillar: uniform 1-D, 2-D and 3-D tensor-product grids, finite-difference
stencil coefficients, and assembly of discrete PDE operators (Laplacians)
on those grids.
This crate is built from scratch (no wrap target — see spec.txt). It is
motivated by the compartmental-ODE / structured-grid spatial-model needs of
tpt-soma and tpt-cerebrum (reaction–diffusion, cable-equation /
cortical-sheet style models).
The assembled operators are returned as DMatrix / DVector from the
tpt-math dense linear-algebra substrate (linalg), which is an in-house,
dual-licensed (MIT OR Apache-2.0) backend with no nalgebra/faer license
exposure, per the workspace policy in ADR 0007.
§Example
use tpt_sci_grid::{laplacian_1d, UniformGrid1D, Boundary};
let g = UniformGrid1D::new(11, 0.0, 1.0).unwrap();
let l = laplacian_1d(&g, Boundary::Dirichlet);
assert_eq!(l.nrows(), 11);
assert_eq!(l.ncols(), 11);Re-exports§
pub use error::GridError;pub use grid::Boundary;pub use grid::UniformGrid1D;pub use grid::UniformGrid2D;pub use grid::UniformGrid3D;pub use grid::linspace;pub use operator::derivative_1d;pub use operator::kron;pub use operator::laplacian_1d;pub use operator::laplacian_2d;pub use operator::laplacian_3d;pub use stencil::Stencil;pub use sparse::CsrMatrix;pub use sparse::diffuse_step;pub use sparse::laplacian_1d_sparse;pub use sparse::laplacian_2d_sparse;pub use sparse::laplacian_3d_sparse;pub use tpt_math_linalg as linalg;
Modules§
Structs§
- DMatrix
- Dense matrix / vector types re-exported from the
tpt-mathsubstrate so callers can consume assembled operators without a separate dependency. A dynamically-sized matrix ofT, stored column-major in a contiguousVec((i, j)lives ati + j * nrows). - DVector
- Dense matrix / vector types re-exported from the
tpt-mathsubstrate so callers can consume assembled operators without a separate dependency. A dynamically-sized column vector ofT, stored as a contiguousVec.