cartan-dec 0.3.0

Discrete exterior calculus on Riemannian manifolds: simplicial complexes, Hodge operators, and covariant differential operators built on cartan-core
Documentation

cartan-dec

Discrete exterior calculus on Riemannian manifolds.

crates.io docs.rs

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 type M, simplex dimension K, and boundary dimension B.
  • ExteriorDerivative, sparse boundary operators d0 and d1 (via sprs).
  • HodgeStar, diagonal Hodge star operators (barycentric or circumcentric dual).
  • Operators, assembled Laplace-Beltrami, Bochner, and Lichnerowicz Laplacians.
  • Mesh quality: mesh_quality module with Delaunay/well-centred predicates, intrinsic edge flips, and Lloyd/CVT smoothing.
  • Mesh generators: mesh_gen module with icosphere and torus builders (optional well-centred output).
  • Complex line bundles: line_bundle module with Section<K> for k-atic fields, ConnectionAngles, BochnerLaplacian<K>, and exact discrete defect charges (Poincare-Hopf).
  • Extrinsic operators: extrinsic module 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: stokes module 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 cartan_dec::{FlatMesh, Operators};
use cartan_manifolds::Euclidean;
use nalgebra::DVector;

// Build a 4x4 uniform triangular grid on [0,1]^2.
let mesh = FlatMesh::unit_square_grid(4);
let ops = Operators::from_mesh(&mesh, &Euclidean::<2>);

// Apply the scalar Laplacian to a vertex field.
let f = DVector::from_element(mesh.n_vertices(), 1.0);
let lf = ops.apply_laplace_beltrami(&f);

License

MIT