Rodin::Geometry module

Meshes, geometric transformations, and mapped evaluation.

\[ \mathbf{x}=F_K(\widehat{\mathbf{x}}). \]

Mesh<Context::MPI> and getConnectivity().compute(d1, d2) describe mesh entities and their incidence relations. Polytope, Geometry::Point, and PolytopeTransformation connect reference elements to physical geometry for integration, field evaluation, mesh extraction, and deformation.

Key classes include:

  • Mesh<Context::MPI> — The primary mesh class supporting triangular, quadrilateral, tetrahedral, and hexahedral meshes
  • Polytope — Geometric entities (vertices, edges, faces, cells) with type enumeration
  • getConnectivity().compute(d1, d2) — Incidence relations between polytopes of different dimensions
  • Geometry::Point — Evaluation point for grid functions, bundling reference coordinates, physical coordinates, Jacobian data, and the owning polytope

Mesh Creation

MethodDescription
Mesh::UniformGrid(type, shape)Structured grid on the unit hypercube
Mesh::Box(faceType, shape)Surface mesh (boundary of unit box)
Mesh::Build()Programmatic construction via Builder pattern
mesh.load(file, format)Load from MFEM, MEDIT, or HDF5

Mesh Operations

MethodDescription
getConnectivity().compute(d1, d2)Compute incidence relation $ d_1 \to d_2 $
scale(factor)Scale all vertex coordinates by a scalar factor
displace(vectorFunction)Apply a displacement field to all vertices
skin()Extract the boundary surface mesh
getDimension()Topological dimension (2 for triangles, 3 for tetrahedra)
getSpaceDimension()Ambient space dimension (>= topological dimension)
getVertexCount()Number of vertices
getCellCount()Number of cells
getVolume()Sum of measures of the three-dimensional entities
getArea()Sum of measures of the two-dimensional entities
getPerimeter()Total perimeter (or surface area) of the domain boundary
getVertex() / getCell() / getBoundary()Polytope iterators
getVertexCoordinates(idx)Get coordinates of a vertex
setAttribute({dim, idx}, attr)Set attribute of a polytope (for BC labeling)

Polytope types

TypeDimensionDescription
Point0Vertex
Segment1Edge
Triangle23-vertex face/cell
Quadrilateral24-vertex face/cell
Tetrahedron34-vertex cell
Hexahedron38-vertex cell
Wedge3Triangular prism (6 vertices)
Pyramid3Square-base pyramid (5 vertices)
Mesh mesh;
mesh = mesh.UniformGrid(Polytope::Type::Triangle, {16, 16});
mesh.getConnectivity().compute(1, 2); // Compute face-to-cell connectivity

Namespaces

namespace Euclidean
Module for dealing with Euclidean geometries.

Classes

class AttributeIndex
Attribute indexing for mesh polytopes.
class BalancedCompactPartitioner
Partitioner that creates balanced, spatially compact partitions.
class Bounds
A conservative convex enclosure described by support bounds.
class ConnectivityBase
Abstract base class for mesh connectivity.
template<class T>
class GeometryIndexed
Template container indexed by polytope geometry types.
template<class T>
class ContainerIndexGenerator
Index generator that wraps a container's iterators.
template<class FE>
class ParametricTransformation
Template for finite-element parametric transformations.
template<class MeshType>
class MinSTCut
Mesh-aware binary Potts classifier selected by mesh type.
See specializations
SpecializationDescription
Mesh<Context::Local>
Full specialization
template <>
class MinSTCut<
  Mesh< Context::Local >> final;
Serial mesh-aware Potts classifier using local connectivity.
template<class ContextType>
class Connectivity
Template for connectivity information.
See specializations
SpecializationDescription
Context::Local
Full specialization
template <>
class Connectivity<
  Context::Local> final;
Mesh connectivity for sequential (local) meshes.
template<class ContextType = Context::Local>
class Mesh
Represents a polyhedral complex.
See specializations
SpecializationDescription
Context::Local
Full specialization
template <>
class Mesh<
  Context::Local>;
Represents the subdivision of some domain into faces of (possibly) different geometries.
Context::MPI
Full specialization
template <>
class Mesh<
  Context::MPI>;
Distributed mesh specialization for MPI contexts.
template<class Context>
class SubMesh
Represents a subset of a Mesh.
See specializations
SpecializationDescription
Context::Local
Full specialization
template <>
class SubMesh<
  Context::Local> final;
SubMesh representing a subregion of a parent mesh.
Context::MPI
Full specialization
template <>
class SubMesh<
  Context::MPI> final;
SubMesh representing a distributed subregion of a parent MPI mesh.
template<class Context>
class SubMeshBuilder
Builder for constructing SubMesh objects.
class GreedyPartitioner
Partitioner using a greedy algorithm.
class IdentityTransformation
Polytope identity transformation.
class IndexGeneratorBase
Abstract base class for index generators.
class EmptyIndexGenerator
Index generator that represents an empty sequence.
class BoundedIndexGenerator
Index generator for a bounded range of indices.
template<class Iterator>
class IteratorIndexGenerator
Index generator that wraps an iterator pair.
class VectorIndexGenerator
Index generator backed by a vector of indices.
class SetIndexGenerator
Index generator backed by a set of indices.
class CCL
Mesh data structures, geometric operations, and computational geometry utilities.
class MeshBase
Abstract base class for all mesh implementations.
class Partitioner
Abstract base class for mesh partitioning strategies.
class PointBase
Base class for spatial points on a discrete mesh.
class Point
Concrete implementation of a spatial point on a mesh.
class PointCloud
Point cloud with a point-centric API and Eigen "matrix" views.
class Polytope
Base class for all geometric elements in finite element meshes.
class Cell
Represents a cell (highest-dimensional element) in a mesh.
class Face
Represents a face (codimension-1 element) in a mesh.
class Vertex
Represents a vertex (0-dimensional element) in a mesh.
template<class T, class Derived>
class PolytopeIteratorBase
Base class template for polytope iterators.
class PolytopeIterator
Iterator over general polytopes of specified dimension.
class CellIterator
Iterator over mesh cells (highest-dimensional polytopes).
class FaceIterator
Iterator over mesh faces (codimension-1 polytopes).
class VertexIterator
Iterator over mesh vertices (0-dimensional polytopes).
class PolytopeQuadrature
Cached quadrature attached to one specific polytope.
class PolytopeQuadratureIndex
Thread-safe cache of polytope quadratures.
class PolytopeTransformation
Abstract base class for polytope geometric transformations.
class PolytopeTransformationIndex
Thread-safe index for managing polytope transformations.
class Shard
Local view of one partition of a distributed mesh.
template<class Context>
class SharderBase
Base implementation for decomposing a partitioned mesh into shards.
template<class Context>
class Sharder
Interface for mesh sharding algorithms.
See specializations
SpecializationDescription
Context::MPI
Full specialization
template <>
class Sharder<
  Context::MPI>;
Utility for distributing a global mesh across MPI ranks by splitting into per-rank shards, scattering them from a root, and gathering the local mesh on each rank.
class SubMeshBase
Abstract base class for SubMesh implementations.

Enums

enum class Region { Cells, Faces, Boundary, Interface }
Enumeration of standard mesh regions.

Typedefs

using MeshType = Mesh<Context::Local>
Local mesh type partitioned by BalancedCompactPartitioner.
using SequentialConnectivity = Connectivity<Context::Local>
Type alias for sequential (non-distributed) connectivity.
using LocalMesh = Mesh<Context::Local>
Type alias for Mesh<Context::Local>.
using Attribute = std::size_t
Standard type for representing material attributes in a mesh.
using Incidence = std::vector<std::vector<Index>>
Represents the incidence relation between polytopes.
using MPIMesh = Mesh<Context::MPI>
Convenience alias for the distributed mesh type.

Functions

template<class MeshType>
MinSTCut(const MeshType& mesh) -> MinSTCut< MeshType >
Deduces the classifier specialization from the mesh.
template<class EigenDerived>
auto operator+(const Geometry::Point& p, const Eigen::MatrixBase<EigenDerived>& q) -> auto
Addition operator for Point and Eigen vector.
template<class EigenDerived>
auto operator+(const Eigen::MatrixBase<EigenDerived>& p, const Geometry::Point& q) -> auto
Addition operator for Eigen vector and Point.
template<class EigenDerived>
auto operator-(const Geometry::Point& p, const Eigen::MatrixBase<EigenDerived>& q) -> auto
Subtraction operator for Point and Eigen vector.
template<class EigenDerived>
auto operator-(const Eigen::MatrixBase<EigenDerived>& p, const Geometry::Point& q) -> auto
Subtraction operator for Eigen vector and Point.
auto operator+(const Geometry::Point& p, const Geometry::Point& q) -> auto
Addition operator for two Points.
auto operator-(const Geometry::Point& p, const Geometry::Point& q) -> auto
Subtraction operator for two Points.
auto operator*(Real s, const Geometry::Point& p) -> auto
Scalar multiplication (scalar * Point).
auto operator*(const Geometry::Point& p, Real s) -> auto
Scalar multiplication (Point * scalar).
template<class Scalar>
auto operator+(const Math::SpatialVector<Scalar>& v, const Geometry::Point& p) -> auto
Adds a spatial vector to a point.
template<class Scalar>
auto operator+(const Geometry::Point& p, const Math::SpatialVector<Scalar>& v) -> auto
Adds a point to a spatial vector.
template<class Scalar>
auto operator-(const Math::SpatialVector<Scalar>& v, const Geometry::Point& p) -> auto
Subtracts a point's coordinates from a spatial vector.
template<class Scalar>
auto operator-(const Geometry::Point& p, const Math::SpatialVector<Scalar>& v) -> auto
Subtracts a spatial vector from a point's coordinates.
auto operator*(const Real& s, const PointCloud& A) -> PointCloud
Scalar-times-point-cloud (scales the active coordinates).
auto operator*(const PointCloud& A, const Real& s) -> PointCloud
Point-cloud-times-scalar (scales the active coordinates).
auto operator+(const PointCloud& A, const PointCloud& B) -> PointCloud
Componentwise sum of two point clouds' active coordinates.
auto operator-(const PointCloud& A, const PointCloud& B) -> PointCloud
Componentwise difference of two point clouds' active coordinates.
template<class EigenDerived>
auto operator*(const PointCloud& A, const Eigen::MatrixBase<EigenDerived>& B) -> auto
Product of the active-coordinate matrix and an Eigen matrix.
template<class EigenDerived>
auto operator*(const Eigen::MatrixBase<EigenDerived>& A, const PointCloud& B) -> auto
Product of an Eigen matrix and the active-coordinate matrix.
auto operator<<(std::ostream& os, const PointCloud& P) -> std::ostream&
Streams the active-coordinate matrix to an output stream.
auto operator<<(std::ostream& os, const Polytope::Type& p) -> std::ostream&
Stream output operator for polytope types.
auto operator==(const Polytope& lhs, const Polytope& rhs) -> bool
Equality comparison for polytopes.
auto operator<(const Polytope& lhs, const Polytope& rhs) -> bool
Less-than comparison for polytopes.
Mesh(const Context::MPI& context) -> Mesh< Context::MPI >
Deduction guide for MPI meshes.

Enum documentation

enum class Rodin::Geometry::Region

Defined in Rodin/Geometry/Region.h

Enumeration of standard mesh regions.

This enumeration defines commonly used subregions of a mesh that can be referenced in variational formulations and boundary conditions.

Enumerators
Cells

Interior cells (elements) of the mesh.

Faces

All faces (d-1 dimensional polytopes) in the mesh.

Boundary

Boundary faces (faces incident to only one cell).

Interface

Interior faces (faces incident to two cells).

Typedef documentation

using SequentialConnectivity = Connectivity<Context::Local>

Defined in Rodin/Geometry/Connectivity.h

Type alias for sequential (non-distributed) connectivity.

using LocalMesh = Mesh<Context::Local>

Defined in Rodin/Geometry/Mesh.h

Type alias for Mesh<Context::Local>.

using Attribute = std::size_t

Defined in Rodin/Geometry/Types.h

Standard type for representing material attributes in a mesh.

Attributes are used to mark different regions or materials in a mesh. For example, in a multi-material problem, each material region would have a distinct attribute value.

using Incidence = std::vector<std::vector<Index>>

Defined in Rodin/Geometry/Types.h

Represents the incidence relation between polytopes.

The incidence relation $ d \longrightarrow d' $ stores for each polytope of dimension $ d $ the indices of all incident polytopes of dimension $ d' $ .

using MPIMesh = Mesh<Context::MPI>

Defined in Rodin/MPI/Geometry/Mesh.h

Convenience alias for the distributed mesh type.

Function documentation

MinSTCut

Defined in Rodin/Geometry/MinSTCut.h

See declaration
template<class MeshType>
MinSTCut(const MeshType& mesh) -> MinSTCut< MeshType >

Deduces the classifier specialization from the mesh.

Template parameters
MeshType Mesh type, including its execution context.
Parameters
mesh Mesh borrowed by the classifier.

template<class EigenDerived>
auto operator+(const Geometry::Point& p, const Eigen::MatrixBase<EigenDerived>& q)

Defined in Rodin/Geometry/Point.h

Addition operator for Point and Eigen vector.

Template parameters
EigenDerived Eigen vector type
Parameters
p in Point
q in Vector
Returns Result vector

template<class EigenDerived>
auto operator+(const Eigen::MatrixBase<EigenDerived>& p, const Geometry::Point& q)

Defined in Rodin/Geometry/Point.h

Addition operator for Eigen vector and Point.

Template parameters
EigenDerived Eigen vector type
Parameters
p in Vector
q in Point
Returns Result vector

template<class EigenDerived>
auto operator-(const Geometry::Point& p, const Eigen::MatrixBase<EigenDerived>& q)

Defined in Rodin/Geometry/Point.h

Subtraction operator for Point and Eigen vector.

Template parameters
EigenDerived Eigen vector type
Parameters
p in Point
q in Vector
Returns Result vector

template<class EigenDerived>
auto operator-(const Eigen::MatrixBase<EigenDerived>& p, const Geometry::Point& q)

Defined in Rodin/Geometry/Point.h

Subtraction operator for Eigen vector and Point.

Template parameters
EigenDerived Eigen vector type
Parameters
p in Vector
q in Point
Returns Result vector

auto operator+(const Geometry::Point& p, const Geometry::Point& q)

Defined in Rodin/Geometry/Point.h

Addition operator for two Points.

Parameters
p in First point
q in Second point
Returns Result vector (sum of physical coordinates)

auto operator-(const Geometry::Point& p, const Geometry::Point& q)

Defined in Rodin/Geometry/Point.h

Subtraction operator for two Points.

Parameters
p in First point
q in Second point
Returns Result vector (difference of physical coordinates)

auto operator*(Real s, const Geometry::Point& p)

Defined in Rodin/Geometry/Point.h

Scalar multiplication (scalar * Point).

Parameters
s in Scalar value
p in Point
Returns Scaled vector

auto operator*(const Geometry::Point& p, Real s)

Defined in Rodin/Geometry/Point.h

Scalar multiplication (Point * scalar).

Parameters
p in Point
s in Scalar value
Returns Scaled vector

template<class Scalar>
auto operator+(const Math::SpatialVector<Scalar>& v, const Geometry::Point& p)

Defined in Rodin/Geometry/Point.h

Adds a spatial vector to a point.

Parameters
v Vector operand.
p Point at which the operation is evaluated.
Returns Sum of the operands.

template<class Scalar>
auto operator+(const Geometry::Point& p, const Math::SpatialVector<Scalar>& v)

Defined in Rodin/Geometry/Point.h

Adds a point to a spatial vector.

Parameters
p Point at which the operation is evaluated.
v Vector operand.
Returns Sum of the operands.

template<class Scalar>
auto operator-(const Math::SpatialVector<Scalar>& v, const Geometry::Point& p)

Defined in Rodin/Geometry/Point.h

Subtracts a point's coordinates from a spatial vector.

Parameters
v Vector operand.
p Point at which the operation is evaluated.
Returns Difference of the operands, or the negated operand for the unary overload.

template<class Scalar>
auto operator-(const Geometry::Point& p, const Math::SpatialVector<Scalar>& v)

Defined in Rodin/Geometry/Point.h

Subtracts a spatial vector from a point's coordinates.

Parameters
p Point at which the operation is evaluated.
v Vector operand.
Returns Difference of the operands, or the negated operand for the unary overload.

PointCloud operator*(const Real& s, const PointCloud& A)

Defined in Rodin/Geometry/PointCloud.h

Scalar-times-point-cloud (scales the active coordinates).

Parameters
s Scalar factor.
A System matrix.
Returns Product of the operands.

PointCloud operator*(const PointCloud& A, const Real& s)

Defined in Rodin/Geometry/PointCloud.h

Point-cloud-times-scalar (scales the active coordinates).

Parameters
A System matrix.
s Scalar factor.
Returns Product of the operands.

PointCloud operator+(const PointCloud& A, const PointCloud& B)

Defined in Rodin/Geometry/PointCloud.h

Componentwise sum of two point clouds' active coordinates.

Parameters
A System matrix.
B Second matrix operand.
Returns Sum of the operands.

PointCloud operator-(const PointCloud& A, const PointCloud& B)

Defined in Rodin/Geometry/PointCloud.h

Componentwise difference of two point clouds' active coordinates.

Parameters
A System matrix.
B Second matrix operand.
Returns Difference of the operands, or the negated operand for the unary overload.

template<class EigenDerived>
auto operator*(const PointCloud& A, const Eigen::MatrixBase<EigenDerived>& B)

Defined in Rodin/Geometry/PointCloud.h

Product of the active-coordinate matrix and an Eigen matrix.

Parameters
A System matrix.
B Second matrix operand.
Returns Product of the operands.

template<class EigenDerived>
auto operator*(const Eigen::MatrixBase<EigenDerived>& A, const PointCloud& B)

Defined in Rodin/Geometry/PointCloud.h

Product of an Eigen matrix and the active-coordinate matrix.

Parameters
A System matrix.
B Second matrix operand.
Returns Product of the operands.

std::ostream& operator<<(std::ostream& os, const PointCloud& P)

Defined in Rodin/Geometry/PointCloud.h

Streams the active-coordinate matrix to an output stream.

Parameters
os Output stream.
P Storage for the first Piola-Kirchhoff stress.
Returns Output stream after writing the object.

std::ostream& operator<<(std::ostream& os, const Polytope::Type& p)

Defined in Rodin/Geometry/Polytope.h

Stream output operator for polytope types.

Parameters
os in/out Output stream
p in Polytope type to output
Returns Reference to the output stream

bool operator==(const Polytope& lhs, const Polytope& rhs)

Defined in Rodin/Geometry/Polytope.h

Equality comparison for polytopes.

Parameters
lhs in Left-hand side polytope
rhs in Right-hand side polytope
Returns True if polytopes are equal (same mesh, dimension, and index)

bool operator<(const Polytope& lhs, const Polytope& rhs)

Defined in Rodin/Geometry/Polytope.h

Less-than comparison for polytopes.

Parameters
lhs in Left-hand side polytope
rhs in Right-hand side polytope
Returns Lexicographic ordering by dimension, index, then mesh address

Mesh

Defined in Rodin/MPI/Geometry/Mesh.h

See declaration
Mesh(const Context::MPI& context) -> Mesh< Context::MPI >

Deduction guide for MPI meshes.

Parameters
context MPI context associated with the mesh.