cartan-dec
Discrete exterior calculus on Riemannian manifolds.
Part of the cartan workspace.
Overview
cartan-dec bridges continuous Riemannian geometry (cartan-core) to
discrete differential operators for PDE solvers on simplicial meshes. All
metric information flows through the Hodge star; topology is encoded in the
metric-free exterior derivative.
The crate provides:
Mesh<M, K, B>, a generic simplicial complex parameterised by manifold typeM, simplex dimensionK, and boundary dimensionB.ExteriorDerivative, sparse boundary operators d0 and d1 (viasprs).HodgeStar, diagonal Hodge star operators (barycentric or circumcentric dual).Operators, assembled Laplace-Beltrami, Bochner, and Lichnerowicz Laplacians.- Mesh quality:
mesh_qualitymodule with Delaunay/well-centred predicates, intrinsic edge flips, and Lloyd/CVT smoothing. - Mesh generators:
mesh_genmodule with icosphere and torus builders (optional well-centred output). - Complex line bundles:
line_bundlemodule withSection<K>for k-atic fields,ConnectionAngles,BochnerLaplacian<K>, and exact discrete defect charges (Poincare-Hopf). - Extrinsic operators:
extrinsicmodule with tangent-plane projection, FEM gradients, Killing operator, DIV, GRAD, and viscosity Laplacian for surfaces in R^3 (following Zhu, Saintillan, Chern 2025). - Stokes solver:
stokesmodule with augmented Lagrangian solver for incompressible viscous flow on triangle meshes. - Upwind covariant advection and discrete divergence for scalar, vector, and tensor fields.
All operators are generic over M: Manifold with const generics K and
B, so the same code works on flat meshes and curved Riemannian surfaces.
Example
use ;
use Euclidean;
use DVector;
// Build a 4x4 uniform triangular grid on [0,1]^2.
let mesh = unit_square_grid;
let ops = from_mesh;
// Apply the scalar Laplacian to a vertex field.
let f = from_element;
let lf = ops.apply_laplace_beltrami;