Rodin::Geometry::MeshBase class

Abstract base class for Mesh objects.

Derived classes

template<>
class Mesh<Context::Sequential>
Represents the subdivision of some domain into faces of (possibly) different geometries.

Public functions

auto isEmpty() const -> bool
Indicates if the mesh is empty or not.
auto isSurface() const -> bool
Indicates whether the mesh is a surface or not.
auto isSubMesh() const -> bool pure virtual
Indicates whether the mesh is a submesh or not.
auto isBoundary(Index faceIdx) const -> bool pure virtual
Determines whether a face of the mesh is on the boundary.
auto getDimension() const -> size_t pure virtual
Gets the dimension of the cells.
auto getSpaceDimension() const -> size_t pure virtual
Gets the dimension of the ambient space.
auto getVertexCount() const -> size_t
Gets the number of vertices in the mesh.
auto getFaceCount() const -> size_t
Gets the number of faces in the mesh.
auto getCellCount() const -> size_t
Gets the number of cells in the mesh.
auto getVolume() const -> Real
Gets the total volume of the mesh.
auto getVolume(Attribute attr) const -> Real
Gets the sum of the volumes of the cells given by the specified attribute.
auto getPerimeter() const -> Real
Gets the total perimeter of the mesh.
auto getPerimeter(Attribute attr) const -> Real
Gets the sum of the perimeters of the cells given by the specified attribute.
auto getAttributes(size_t d) const -> const FlatSet<Attribute>& pure virtual
Gets the labels of the domain cells in the mesh.
auto getBoundary() const -> FaceIterator pure virtual
Gets a FaceIterator for the boundary faces.
auto getInterface() const -> FaceIterator pure virtual
Gets a FaceIterator for the interface faces.
auto getPolytopeCount(size_t dimension) const -> size_t pure virtual
Gets the count of polytope of the given dimension.
auto getPolytopeCount(Polytope::Type g) const -> size_t pure virtual
Gets the count of polytope of the given type.
auto getCell(Index idx = 0) const -> CellIterator pure virtual
Gets an CellIterator to the cells of the mesh.
auto getFace(Index idx = 0) const -> FaceIterator pure virtual
Gets a FaceIterator to the faces of the mesh.
auto getVertex(Index idx = 0) const -> VertexIterator pure virtual
Gets a VertexIterator to the vertices of the mesh.
auto getPolytope(size_t dimension, Index idx = 0) const -> PolytopeIterator pure virtual
Gets a PolytopeIterator to the polytopes of the given dimension of the mesh.
auto getPolytopeTransformation(size_t dimension, Index idx) const -> const PolytopeTransformation& pure virtual
Gets the PolytopeTransformation associated to the $ (d, i) $ -polytope.
auto getGeometry(size_t dimension, Index idx) const -> Polytope::Type pure virtual
auto getAttribute(size_t dimension, Index index) const -> Attribute pure virtual
auto setAttribute(const std::pair<size_t, Index>& p, Attribute attr) -> MeshBase& pure virtual
auto getConnectivity() -> ConnectivityBase& pure virtual
Gets a reference to the mesh connectivity.
auto getConnectivity() const -> const ConnectivityBase& pure virtual
Gets a constant reference to the mesh connectivity.
auto getVertexCoordinates(Index idx) const -> Eigen::Map<const Math::SpatialVector<Real>> pure virtual
Gets the space coordinates of the vertex at the given index.
auto setVertexCoordinates(Index idx, Real s, size_t i) -> MeshBase& pure virtual
Sets the space coordinate of the vertex at the given index for the given coordinate index.
auto setVertexCoordinates(Index idx, const Math::SpatialVector<Real>& coords) -> MeshBase& pure virtual
Sets the space coordinate of the vertex at the given index for the given coordinate index.

Function documentation

bool Rodin::Geometry::MeshBase::isEmpty() const

Indicates if the mesh is empty or not.

An empty mesh is defined as a mesh with no vertices.

bool Rodin::Geometry::MeshBase::isSurface() const

Indicates whether the mesh is a surface or not.

Returns True if mesh is a surface, false otherwise.

A mesh is considered a surface mesh if has codimension of 1, meaning the difference between its space dimension and its topological dimension is 1.

bool Rodin::Geometry::MeshBase::isSubMesh() const pure virtual

Indicates whether the mesh is a submesh or not.

Returns True if mesh is a submesh, false otherwise.

A Mesh which is also a SubMesh may be casted into down to access the SubMesh functionality. For example:

if (mesh.isSubMesh())
{
  // Cast is well defined
  auto& submesh = static_cast<SubMesh&>(mesh);
}

size_t Rodin::Geometry::MeshBase::getDimension() const pure virtual

Gets the dimension of the cells.

Returns Dimension of the cells.

size_t Rodin::Geometry::MeshBase::getSpaceDimension() const pure virtual

Gets the dimension of the ambient space.

Returns Dimension of the space which the mesh is embedded in

Real Rodin::Geometry::MeshBase::getVolume() const

Gets the total volume of the mesh.

Returns Sum of all cell volumes.

Real Rodin::Geometry::MeshBase::getVolume(Attribute attr) const

Gets the sum of the volumes of the cells given by the specified attribute.

Parameters
attr in Attribute of cells
Returns Sum of element volumes with given attribute

Real Rodin::Geometry::MeshBase::getPerimeter() const

Gets the total perimeter of the mesh.

Returns Sum of all element perimeters.

Real Rodin::Geometry::MeshBase::getPerimeter(Attribute attr) const

Gets the sum of the perimeters of the cells given by the specified attribute.

Parameters
attr in Attribute of cells
Returns Sum of element perimeters with given attribute

const FlatSet<Attribute>& Rodin::Geometry::MeshBase::getAttributes(size_t d) const pure virtual

Gets the labels of the domain cells in the mesh.

Returns Set of all the attributes in the mesh object.

size_t Rodin::Geometry::MeshBase::getPolytopeCount(size_t dimension) const pure virtual

Gets the count of polytope of the given dimension.

Parameters
dimension in Polytope dimension

PolytopeIterator Rodin::Geometry::MeshBase::getPolytope(size_t dimension, Index idx = 0) const pure virtual

Gets a PolytopeIterator to the polytopes of the given dimension of the mesh.

Parameters
dimension in Polytope dimension
idx

const PolytopeTransformation& Rodin::Geometry::MeshBase::getPolytopeTransformation(size_t dimension, Index idx) const pure virtual

Gets the PolytopeTransformation associated to the $ (d, i) $ -polytope.

Parameters
dimension
idx in Polytope index

Polytope::Type Rodin::Geometry::MeshBase::getGeometry(size_t dimension, Index idx) const pure virtual

Parameters
dimension
idx in Polytope index

Gets the geometry type of the $ (d, i) $ -polytope.

Attribute Rodin::Geometry::MeshBase::getAttribute(size_t dimension, Index index) const pure virtual

Gets the attribute of the $ (d, i) $ -polytope.

MeshBase& Rodin::Geometry::MeshBase::setAttribute(const std::pair<size_t, Index>& p, Attribute attr) pure virtual

Parameters
in Pair indicating polytope dimension and index
attr in Attribute of polytope

Sets the attribute of the $ (d, i) $ -polytope.

Eigen::Map<const Math::SpatialVector<Real>> Rodin::Geometry::MeshBase::getVertexCoordinates(Index idx) const pure virtual

Gets the space coordinates of the vertex at the given index.

Parameters
idx in Vertex index

MeshBase& Rodin::Geometry::MeshBase::setVertexCoordinates(Index idx, Real s, size_t i) pure virtual

Sets the space coordinate of the vertex at the given index for the given coordinate index.

Parameters
idx in Vertex index
in New coordinate
in Coordinate index

For example, the following code sets the coordinates of the 0-vertex to $ (0, 5, 10) $ in a mesh embedded in three dimensional space.

Mesh mesh;
// Add vertices...
mesh.setVertexCoordinates(0, 0.0, 0);
mesh.setVertexCoordinates(0, 5.0, 1);
mesh.setVertexCoordinates(0, 10.0, 2);

MeshBase& Rodin::Geometry::MeshBase::setVertexCoordinates(Index idx, const Math::SpatialVector<Real>& coords) pure virtual

Sets the space coordinate of the vertex at the given index for the given coordinate index.

Parameters
idx in Vertex index
coords in New coordinates