Polytope class
#include <Rodin/Geometry/Polytope.h>
Base class for all geometric elements in finite element meshes.
A Polytope represents a geometric entity in a finite element mesh, ranging from vertices (0D) to cells (highest dimension). Polytopes are the building blocks of mesh topology and provide the geometric foundation for finite element computations.
Mathematical Foundation
Each polytope in a mesh has:
- A dimension (0 for vertices, 1 for edges, etc.)
- An index unique within its dimension
- An associated reference element
- A transformation mapping reference to physical coordinates
Hierarchy
The Polytope class serves as the base for specialized classes:
Usage
Polytopes are typically obtained through iterators:
for (auto it = mesh.getCell(); it; ++it) { const Cell& cell = *it; std::cout << "Cell " << cell.getIndex() << " has measure " << cell.getMeasure() << std::endl; }
Derived classes
Public types
- struct Project
- Projection operations for polytope sub-entities.
- struct Traits
- Geometric traits for polytope types.
- enum class Type { Point, Segment, Triangle, Quadrilateral, Tetrahedron, Wedge }
- Enumeration of supported polytope geometries.
Public static variables
Constructors, destructors, conversion operators
Public functions
- auto operator=(const Polytope& other) -> Polytope&
- Copy assignment operator.
- auto operator=(Polytope&& other) -> Polytope&
- Move assignment operator.
- auto getIndex() const -> Index
- Gets the polytope's index within its dimension.
- auto getDimension() const -> size_t
- Gets the topological dimension.
- auto getMesh() const -> const MeshBase&
- Gets the containing mesh.
- auto getAttribute() const -> Attribute
- Gets the attribute (marker) of this polytope.
- auto getMeasure() const -> Real
- Gets the geometric measure of this polytope.
- auto getTransformation() const -> const PolytopeTransformation&
- Gets the geometric transformation for this polytope.
- auto getVertex() const -> VertexIterator
- Gets an iterator over the vertices of this polytope.
- auto getVertices() const -> const Array<Index>&
- Gets the vertex indices defining this polytope.
- auto getAdjacent() const -> PolytopeIterator
- Gets an iterator over polytopes adjacent to this one.
- auto getGeometry() const -> Type
- Gets the geometry type of this polytope.
- auto isCell() const -> bool
- Checks if this is a cell (maximal dimension).
- auto isFace() const -> bool
- Checks if this is a face (codimension 1).
- auto isVertex() const -> bool
- Checks if this is a vertex (dimension 0).
- auto setAttribute() -> Polytope&
- Sets the attribute for this polytope.
Enum documentation
enum class Rodin:: Geometry:: Polytope:: Type
Enumeration of supported polytope geometries.
This enumeration defines the geometric types supported in Rodin's finite element framework, covering both simplicial and tensor-product element families commonly used in numerical analysis.
| Enumerators | |
|---|---|
| Point |
0D vertex element |
| Segment |
1D line element |
| Triangle |
2D triangular element |
| Quadrilateral |
2D quadrilateral element |
| Tetrahedron |
3D tetrahedral element |
| Wedge |
3D prismatic element (triangular prism) |
Function documentation
size_t Rodin:: Geometry:: Polytope:: getDimension() const
Gets the topological dimension.
| Returns | Dimension of this polytope |
|---|
Attribute Rodin:: Geometry:: Polytope:: getAttribute() const
Gets the attribute (marker) of this polytope.
| Returns | Attribute value |
|---|
Attributes are typically used to mark material regions, boundary conditions, or other domain-specific properties.
Real Rodin:: Geometry:: Polytope:: getMeasure() const
Gets the geometric measure of this polytope.
| Returns | The measure (length/area/volume) of the polytope |
|---|
Computes the -dimensional measure of the polytope:
| Dimension | Measure |
|---|---|
| 0 | Always 0 |
| 1 | Length |
| 2 | Area |
| 3 | Volume |
const PolytopeTransformation& Rodin:: Geometry:: Polytope:: getTransformation() const
Gets the geometric transformation for this polytope.
| Returns | Reference to the transformation |
|---|
VertexIterator Rodin:: Geometry:: Polytope:: getVertex() const
Gets an iterator over the vertices of this polytope.
| Returns | Iterator over all vertices |
|---|
const Array<Index>& Rodin:: Geometry:: Polytope:: getVertices() const
Gets the vertex indices defining this polytope.
| Returns | Array of vertex indices |
|---|
PolytopeIterator Rodin:: Geometry:: Polytope:: getAdjacent() const
Gets an iterator over polytopes adjacent to this one.
| Returns | Iterator over adjacent polytopes |
|---|
Type Rodin:: Geometry:: Polytope:: getGeometry() const
Gets the geometry type of this polytope.
| Returns | Geometry type (Triangle, Tetrahedron, etc.) |
|---|
bool Rodin:: Geometry:: Polytope:: isCell() const
Checks if this is a cell (maximal dimension).
| Returns | True if this polytope is a cell, false otherwise |
|---|
bool Rodin:: Geometry:: Polytope:: isFace() const
Checks if this is a face (codimension 1).
| Returns | True if this polytope is a face, false otherwise |
|---|
bool Rodin:: Geometry:: Polytope:: isVertex() const
Checks if this is a vertex (dimension 0).
| Returns | True if this polytope is a vertex, false otherwise |
|---|
Polytope& Rodin:: Geometry:: Polytope:: setAttribute()
Sets the attribute for this polytope.
| Returns | Reference to this polytope for method chaining |
|---|