Exterior Forms and the Exterior Derivative
ExteriorDerivative encodes the topological structure of the mesh as sparse
incidence matrices (vertex-to-edge) and (edge-to-triangle). These
are the discrete analogues of the continuous exterior derivative .
Summary
| Operator | Matrix | Input | Output | Meaning |
|---|---|---|---|---|
| 0-form (vertex field) | 1-form (edge field) | discrete gradient | ||
| 1-form (edge field) | 2-form (triangle field) | discrete curl |
Key property (exactness): ; the boundary of a boundary is zero.
Code Examples
Building the exterior derivative
use cartan_dec::{Mesh, ExteriorDerivative};
let mesh = Mesh::unit_square_grid(4);
let ext = ExteriorDerivative::from_mesh(&mesh);Applying : discrete gradient of a scalar field
use nalgebra::DVector;
// Scalar field f on vertices
let f = DVector::from_fn(mesh.n_vertices(), |i, _| {
let [x, y] = mesh.vertices[i];
x + y
});
// df: 1-form on edges - direct matrix multiplication
let df = &ext.d0 * &f;
assert_eq!(df.len(), mesh.n_edges());Applying : discrete curl of a 1-form
// curl(df) = d₁(d₀(f)) = 0 for exact 1-forms
let curl_df = &ext.d1 * &df;
assert!(curl_df.norm() < 1e-12); // exactness: d∘d = 0Formula Reference
incidence: for edge with :
incidence: for triangle and edge : +1 if appears positively oriented in , -1 if negatively, 0 if absent.
Numerical Notes
Sparsity: has exactly non-zeros; has exactly . Both are represented as sparse matrices for efficient matrix-vector products.
Exactness: is exact by construction (not approximate). This is a topological identity that holds at machine precision.
Applications
- Discrete Hodge decomposition:
- Building Laplacians:
- Checking closedness/exactness of discrete differential forms