Polytopes
Reference shapes, physical cells and their lower-dimensional entities.
Cells and their geometry
A mesh combines vertices, edges, faces and cells through incidence relations. The cells have the mesh's topological dimension; their coordinates lie in the embedding space. A triangular surface mesh therefore has dimension two even when its vertices have three coordinates.
Polytope::Type identifies a reference shape. A concrete Polytope also identifies an entity in a mesh, with its connectivity, attribute and geometric transformation.
Dimension and role
| Dimension | Entities | Role |
|---|---|---|
| 0 | Points | Vertices |
| 1 | Segments | Edges; cells of a curve mesh |
| 2 | Triangles and quadrilaterals | Faces; cells of a surface mesh |
| 3 | Tetrahedra, pyramids, hexahedra and wedges | Volume cells |
A facet is an entity of dimension one less than a cell. Facets are edges in a two-dimensional mesh and faces in a three-dimensional mesh.
Supported reference shapes
Polytope::Type | Dimension | Vertices | Reference construction |
|---|---|---|---|
Point | 0 | 1 | A point |
Segment | 1 | 2 | Unit interval |
Triangle | 2 | 3 | Unit simplex |
Quadrilateral | 2 | 4 | Product of two unit intervals |
Tetrahedron | 3 | 4 | Unit simplex |
Pyramid | 3 | 5 | Collapsed square cross-sections |
Hexahedron | 3 | 8 | Product of three unit intervals |
Wedge | 3 | 6 | Triangle times unit interval |
The figures and tables use the reference vertices returned by Polytope::Traits(type).getVertex(i). The numbered markers identify the zero-based local vertex indices.








Reference vertices and local ordering
The tables give each reference vertex in local order. Coordinate tuples have the reference cell's topological dimension.
For a physical cell with local-to-global vertex connectivity , its geometric map satisfies . The local index selects a position in that cell's connectivity; identifies the vertex in the mesh. Preserve this order when constructing connectivity or supplying geometric vertex data.
Point
The reference point is the unique element of . Its coordinate vector is empty, written , and getVertex(0).size() is zero.
| Local index | Reference coordinates |
|---|---|
| 0 |
Segment
| Local index | Reference coordinates |
|---|---|
| 0 | |
| 1 |
Triangle
| Local index | Reference coordinates |
|---|---|
| 0 | |
| 1 | |
| 2 |
Quadrilateral
| Local index | Reference coordinates |
|---|---|
| 0 | |
| 1 | |
| 2 | |
| 3 |
Tetrahedron
| Local index | Reference coordinates |
|---|---|
| 0 | |
| 1 | |
| 2 | |
| 3 |
Pyramid
Vertices zero through three form the square base. The apex is vertex four, directly above vertex zero. Horizontal cross-sections shrink toward that apex.
| Local index | Reference coordinates |
|---|---|
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 |
Hexahedron
Vertices zero through three lie on the bottom face. Vertices four through seven are their corresponding vertices on the top face.
| Local index | Reference coordinates |
|---|---|
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 |
Wedge
Vertices zero through two form the bottom triangle. Vertices three through five are their corresponding vertices on the top triangle.
| Local index | Reference coordinates |
|---|---|
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 |
Reference and physical coordinates
A geometric map sends a reference point to a physical point. Reference coordinates determine basis values and reference quadrature samples; the map supplies physical coordinates and derivatives. On a curved cell, the map also depends on its geometric control points.
Reference vertices can be obtained directly from the library.
const Polytope::Traits traits(Polytope::Type::Pyramid); for (size_t i = 0; i < traits.getVertexCount(); ++i) { const auto& reference = traits.getVertex(i); // Use reference coordinates in the order defined by the element. }
A Geometry::Point combines a cell with reference coordinates. Its Jacobian has embedding dimension rows and cell dimension columns. For surface meshes it is rectangular. The quadrature guide explains the corresponding measure factors in a complete checked example.
Generate a mesh
Uniform grids are available for supported volume-cell shapes. Axis counts specify vertices; coordinates initially have unit spacing. Selecting a reference shape and selecting the physical domain are separate choices. Scale the generated coordinates to obtain a unit domain.
Lower-dimensional entities
A triangle has three edges and three vertices; a tetrahedron has four faces, six edges and four vertices. The mesh stores these incidences through Connectivity. Relations are computed on demand. For example, compute(1, 2) discovers edges and associates each edge with its incident cells in a triangular mesh.
Inspect cell-induced ordering
getSubPolytopes(entities, cellIndex, d) enumerates a cell's -dimensional sub-entities in their local order. Each result contains a geometry type and an ordered vertex key. The key contains mesh vertex indices in the order induced by the parent cell.
For a pyramid with cell vertex key , the face sequence uses the following positions in that key.
| Local face | Shape | Parent-cell vertex positions |
|---|---|---|
| 0 | Quadrilateral | |
| 1 | Triangle | |
| 2 | Triangle | |
| 3 | Triangle | |
| 4 | Triangle |
The edge sequence follows the base loop , followed by the apex edges .
Inspect stored connectivity
compute(D, d) builds the cell-to-entity relation for a mesh of topological dimension . compute(d, D) builds the reverse relation, listing the cells incident to each entity. getIndex(d, key) resolves a vertex key to the entity's mesh index, and getPolytope(d, index) exposes its stored vertex order.
The following code inspects the edges and faces of cell zero in a small pyramid mesh. It uses Rodin::Geometry, Rodin::Context, <iostream> and <vector>.
Mesh mesh = Mesh().UniformGrid(Polytope::Type::Pyramid, {2, 2, 2}); auto& connectivity = mesh.getConnectivity(); const size_t D = mesh.getDimension(); const Index cellIndex = 0; std::cout << "Cell vertices"; for (Index vertex : connectivity.getPolytope(D, cellIndex)) std::cout << ' ' << vertex; std::cout << '\n'; for (size_t d : {size_t{1}, size_t{2}}) { connectivity.compute(D, d); connectivity.compute(d, D); std::vector<Connectivity<Context::Local>::SubPolytope> entities; connectivity.getSubPolytopes(entities, cellIndex, d); for (size_t local = 0; local < entities.size(); ++local) { const auto& induced = entities[local].vertices; const auto index = connectivity.getIndex(d, induced); std::cout << "Dimension " << d << ", local " << local << ", mesh index " << *index << '\n'; std::cout << " Cell-induced vertices"; for (Index vertex : induced) std::cout << ' ' << vertex; std::cout << "\n Stored vertices"; for (Index vertex : connectivity.getPolytope(d, *index)) std::cout << ' ' << vertex; std::cout << "\n Incident cells"; for (Index cell : connectivity.getIncidence({d, D}, *index)) std::cout << ' ' << cell; std::cout << '\n'; } }
This cell has eight edges and five faces. The reverse incidence lists expose which entities are shared with neighboring cells.
The entries returned by getIncidence({D, d}, cellIndex) are mesh indices of the incident entities. Each index is resolved through getPolytope(d, index) when its vertex order is needed.
A shared edge or face has one stored vertex order. An incident cell can induce a different order on that same entity. Comparing the two ordered keys gives the vertex permutation needed to align traces or local facet data. Oriented integration additionally requires the appropriate normal convention for each incident cell. The interface traces tutorial demonstrates two-sided values on a shared edge.
Traverse mesh entities
The iteration guide describes the cell, vertex and facet iterators. Entity indices belong to their own dimension; edge index zero and cell index zero identify different objects.
Select a cell family
Cell shape, geometric mapping, finite element family and polynomial degree jointly determine approximation properties. Triangles and tetrahedra are simplices; quadrilaterals and hexahedra support tensor-product constructions; wedges combine a triangular section with an interval. Pyramids connect quadrilateral and triangular faces and require their own reference basis. Accuracy comparisons should keep the problem, degrees of freedom, quadrature and mesh quality explicit.