Rodin::Geometry namespace

Namespace Rodin::Geometry.

Directory src/Rodin/Geometry

Module for dealing with meshes, polytopes, and geometric operations.

The Geometry module provides the core data structures for finite element meshes. Key classes include:

  • Mesh — The primary mesh class supporting triangular, quadrilateral, tetrahedral, and hexahedral meshes
  • Polytope — Geometric entities (vertices, edges, faces, cells) with type enumeration
  • Connectivity — Incidence relations between polytopes of different dimensions
  • 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()Total volume (or area) of the domain
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)
Mesh mesh;
mesh = mesh.UniformGrid(Polytope::Type::Triangle, {16, 16});
mesh.getConnectivity().compute(1, 2); // Compute face-to-cell connectivity

Namespaces

namespace Euclidean
Namespace Rodin::Geometry::Euclidean.

Classes

class AttributeIndex
Attribute indexing for mesh polytopes.
class BalancedCompactPartitioner
Partitioner that creates balanced, spatially compact partitions.
class BoundedIndexGenerator
Index generator for a bounded range of indices.
class CCL
Mesh data structures, geometric operations, and computational geometry utilities.
class Cell
Represents a cell (highest-dimensional element) in a mesh.
class CellIterator
Iterator over mesh cells (highest-dimensional polytopes).
template<class ContextType>
class Connectivity
Template for connectivity information.
template<>
class Connectivity<Context::Local>
Mesh connectivity for sequential (local) meshes.
class ConnectivityBase
Abstract base class for mesh connectivity.
template<class T>
class ContainerIndexGenerator
Index generator that wraps a container's iterators.
class EmptyIndexGenerator
Index generator that represents an empty sequence.
class Face
Represents a face (codimension-1 element) in a mesh.
class FaceIterator
Iterator over mesh faces (codimension-1 polytopes).
template<class T>
class GeometryIndexed
Template container indexed by polytope geometry types.
class GreedyPartitioner
Partitioner using a greedy algorithm.
class IdentityTransformation
Polytope identity transformation.
class IndexGeneratorBase
Abstract base class for index generators.
template<class Iterator>
class IteratorIndexGenerator
Index generator that wraps an iterator pair.
template<class ContextType = Context::Local>
class Mesh
Represents a polyhedral complex.
template<>
class Mesh<Context::Local>
Represents the subdivision of some domain into faces of (possibly) different geometries.
template<>
class Mesh<Context::MPI>
Distributed mesh specialization for MPI contexts.
class MeshBase
Abstract base class for all mesh implementations.
class MinSTCut
Serial binary Potts classifier solved by an s-t min cut.
template<class FE>
class ParametricTransformation
Template for finite-element parametric transformations.
class Partitioner
Abstract base class for mesh partitioning strategies.
class Point
Concrete implementation of a spatial point on a mesh.
class PointBase
Base class for spatial points on a discrete 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 PolytopeIterator
Iterator over general polytopes of specified dimension.
template<class T, class Derived>
class PolytopeIteratorBase
Base class template for polytope iterators.
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 SetIndexGenerator
Index generator backed by a set of indices.
class Shard
Local view of one partition of a distributed mesh.
template<class Context>
class Sharder
Interface for mesh sharding algorithms.
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.
template<class Context>
class SharderBase
Base implementation for decomposing a partitioned mesh into shards.
template<class Context>
class SubMesh
Represents a subset of a Mesh.
template<>
class SubMesh<Context::Local>
SubMesh representing a subregion of a parent mesh.
template<>
class SubMesh<Context::MPI>
SubMesh representing a distributed subregion of a parent MPI mesh.
class SubMeshBase
Abstract base class for SubMesh implementations.
template<class Context>
class SubMeshBuilder
Distributed MPI SubMesh specialization.
class VectorIndexGenerator
Index generator backed by a vector of indices.
class Vertex
Represents a vertex (0-dimensional element) in a mesh.
class VertexIterator
Iterator over mesh vertices (0-dimensional polytopes).

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 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

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 Rodin::Geometry::SequentialConnectivity = Connectivity<Context::Local>

Type alias for sequential (non-distributed) connectivity.

using Rodin::Geometry::LocalMesh = Mesh<Context::Local>

Type alias for Mesh<Context::Local>

using Rodin::Geometry::Attribute = std::size_t

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 Rodin::Geometry::Incidence = std::vector<std::vector<Index>>

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 Rodin::Geometry::MPIMesh = Mesh<Context::MPI>

Convenience alias for the distributed mesh type.

Function documentation

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

Addition operator for Point and Eigen vector.

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

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

Addition operator for Eigen vector and Point.

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

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

Subtraction operator for Point and Eigen vector.

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

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

Subtraction operator for Eigen vector and Point.

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

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

Addition operator for two Points.

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

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

Subtraction operator for two Points.

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

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

Scalar multiplication (scalar * Point).

Parameters
in Scalar value
in Point
Returns Scaled vector

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

Scalar multiplication (Point * scalar).

Parameters
in Point
in Scalar value
Returns Scaled vector

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

Adds a spatial vector to a point.

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

Adds a point to a spatial vector.

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

Subtracts a point's coordinates from a spatial vector.

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

Subtracts a spatial vector from a point's coordinates.

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

Stream output operator for polytope types.

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

bool Rodin::Geometry::operator==(const Polytope& lhs, const Polytope& rhs)

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 Rodin::Geometry::operator<(const Polytope& lhs, const Polytope& rhs)

Less-than comparison for polytopes.

Parameters
lhs in Left-hand side polytope
rhs in Right-hand side polytope
Returns True if lhs < rhs (lexicographic order by dimension then index)

Rodin::Geometry::Mesh(const Context::MPI& context) -> Mesh< Context::MPI >

Deduction guide for MPI meshes.

Parameters
context MPI context associated with the mesh.