Skip to main content

Crate cartan_dec

Crate cartan_dec 

Source
Expand description

§cartan-dec

Discrete exterior calculus (DEC) on Riemannian manifolds.

Bridges continuous geometry (cartan-core) to discrete operators for PDE solvers on simplicial meshes. All metric information flows through the Hodge star; topology is encoded in the metric-free exterior derivative.

§Modules

ModuleContents
meshMesh<M,K,B> generic simplicial complex; FlatMesh = flat 2D triangular mesh
exteriorExteriorDerivative — d₀ (0-forms to 1-forms) and d₁ (1-forms to 2-forms)
hodgeHodgeStar — diagonal ⋆₀, ⋆₁, ⋆₂ from primal/dual volumes
laplaceOperators — Laplace-Beltrami, Bochner, and Lichnerowicz Laplacians
advectionUpwind covariant advection for scalar and vector fields
divergenceDiscrete covariant divergence of vector and tensor fields
errorDecError — error type for DEC operations

§Quick start

use cartan_dec::{FlatMesh, Operators};
use cartan_manifolds::euclidean::Euclidean;
use nalgebra::DVector;

// Build a 4x4 uniform 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);

§References

  • Desbrun et al. “Discrete Exterior Calculus.” arXiv:math/0508341, 2005.
  • Hirani. “Discrete Exterior Calculus.” Caltech PhD thesis, 2003.

Re-exports§

pub use advection::apply_scalar_advection;
pub use advection::apply_vector_advection;
pub use divergence::apply_divergence;
pub use divergence::apply_tensor_divergence;
pub use error::DecError;
pub use exterior::ExteriorDerivative;
pub use hodge::HodgeStar;
pub use laplace::Operators;
pub use mesh::FlatMesh;
pub use mesh::Mesh;

Modules§

advection
Discrete covariant advection operator for scalar and tensor-valued fields.
divergence
Discrete covariant divergence of a vector field.
error
Error type for cartan-dec operations.
exterior
Discrete exterior derivative operators d0 and d1.
hodge
Discrete Hodge star operators star0, star1, star2.
laplace
Discrete Laplace-Beltrami, Bochner, and Lichnerowicz operators.
mesh
Simplicial complex: vertices, (oriented) boundary faces, and simplices.