SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::discretization::domain::mesh::MeshTopology Class Referencefinal

Provides a convenient interface for querying the topological relationships between elements, faces, and boundaries in a mesh. More...

#include <topology.hpp>

Collaboration diagram for serif::discretization::domain::mesh::MeshTopology:
[legend]

Public Member Functions

 MeshTopology (MeshTopologyData data)
 Owns material labels and connectivity independently of the mesh backend.
 
int element_count () const noexcept
 Returns the number of elements in the mesh.
 
int face_count () const noexcept
 Returns the number of faces in the mesh.
 
int boundary_element_count () const noexcept
 Returns the number of boundary elements in the mesh.
 
int element_domain_id (int elementID) const
 Returns the domain ID of the specified element.
 
int boundary_element_boundary_id (int boundaryElementID) const
 Returns the boundary ID of the specified boundary element.
 
FaceElements face_elements (int faceID) const
 Returns the elements sharing the specified face.
 
const std::vector< int > & element_neighbors (int elementID) const
 Returns the elements sharing an interior face with the specified element.
 
int boundary_element_face (int boundaryElementID) const
 Returns the face a boundary element sits on.
 
const std::vector< int > & boundary_elements_on_face (int faceID) const
 Returns the boundary elements on the specified face.
 

Private Attributes

std::vector< int > m_elementDomainIDs
 The domain IDs of the elements in the mesh.
 
std::vector< FaceElements > m_faceElements
 The elements sharing each face in the mesh.
 
std::vector< std::vector< int > > m_elementNeighbors
 The elements sharing an interior face with each element in the mesh.
 
std::vector< int > m_boundaryElementBoundaryIDs
 The boundary IDs of the boundary elements in the mesh.
 
std::vector< int > m_boundaryElementFaceIDs
 The face IDs of the boundary elements in the mesh.
 
std::vector< std::vector< int > > m_boundaryElementsByFace
 The boundary elements on each face in the mesh.
 

Static Private Attributes

static const std::vector< int > s_noElements {}
 A static empty vector to return when an element has no neighbors or a face has no boundary elements.
 

Detailed Description

Provides a convenient interface for querying the topological relationships between elements, faces, and boundaries in a mesh.

Constructor & Destructor Documentation

◆ MeshTopology()

serif::discretization::domain::mesh::MeshTopology::MeshTopology ( MeshTopologyData data)
explicit

Owns material labels and connectivity independently of the mesh backend.

Parameters
dataThe topology data from which to derive element and boundary adjacency.

Member Function Documentation

◆ boundary_element_boundary_id()

int serif::discretization::domain::mesh::MeshTopology::boundary_element_boundary_id ( int boundaryElementID) const
nodiscard

Returns the boundary ID of the specified boundary element.

Parameters
boundaryElementIDThe ID of the boundary element for which to retrieve the boundary ID.
Returns
The boundary ID of the specified boundary element.
Note
The boundary ID is the boundary label of a boundary element, i.e. which BoundaryID the mesh claims this boundary element belongs to.

◆ boundary_element_count()

int serif::discretization::domain::mesh::MeshTopology::boundary_element_count ( ) const
nodiscardnoexcept

Returns the number of boundary elements in the mesh.

Returns
The number of boundary elements in the mesh.

◆ boundary_element_face()

int serif::discretization::domain::mesh::MeshTopology::boundary_element_face ( int boundaryElementID) const
nodiscard

Returns the face a boundary element sits on.

Parameters
boundaryElementIDThe ID of the boundary element for which to retrieve the face.
Returns
The ID of the face the boundary element sits on, or -1 if no face was supplied.

◆ boundary_elements_on_face()

const std::vector< int > & serif::discretization::domain::mesh::MeshTopology::boundary_elements_on_face ( int faceID) const
nodiscard

Returns the boundary elements on the specified face.

Parameters
faceIDThe ID of the face for which to retrieve the boundary elements.
Returns
A vector containing the IDs of the boundary elements on the specified face.
Note
A face may carry more than one boundary element.

◆ element_count()

int serif::discretization::domain::mesh::MeshTopology::element_count ( ) const
nodiscardnoexcept

Returns the number of elements in the mesh.

Returns
The number of elements in the mesh.

◆ element_domain_id()

int serif::discretization::domain::mesh::MeshTopology::element_domain_id ( int elementID) const
nodiscard

Returns the domain ID of the specified element.

Parameters
elementIDThe ID of the element for which to retrieve the domain ID.
Returns
The domain ID of the specified element.
Note
The domain ID is the material label of a volume element, i.e. which DomainID the mesh claims this element belongs to.

◆ element_neighbors()

const std::vector< int > & serif::discretization::domain::mesh::MeshTopology::element_neighbors ( int elementID) const
nodiscard

Returns the elements sharing an interior face with the specified element.

Parameters
elementIDThe ID of the element for which to retrieve the neighboring elements.
Returns
A vector containing the IDs of the elements sharing an interior face with the specified element.
Note
The returned elements are not filtered by domain. Callers that care about one domain should filter as they walk.

◆ face_count()

int serif::discretization::domain::mesh::MeshTopology::face_count ( ) const
nodiscardnoexcept

Returns the number of faces in the mesh.

Returns
The number of faces in the mesh.

◆ face_elements()

FaceElements serif::discretization::domain::mesh::MeshTopology::face_elements ( int faceID) const
nodiscard

Returns the elements sharing the specified face.

Parameters
faceIDThe ID of the face for which to retrieve the elements.
Returns
A FaceElements struct containing the IDs of the elements sharing the face.

Member Data Documentation

◆ m_boundaryElementBoundaryIDs

std::vector<int> serif::discretization::domain::mesh::MeshTopology::m_boundaryElementBoundaryIDs
private

The boundary IDs of the boundary elements in the mesh.

◆ m_boundaryElementFaceIDs

std::vector<int> serif::discretization::domain::mesh::MeshTopology::m_boundaryElementFaceIDs
private

The face IDs of the boundary elements in the mesh.

◆ m_boundaryElementsByFace

std::vector<std::vector<int> > serif::discretization::domain::mesh::MeshTopology::m_boundaryElementsByFace
private

The boundary elements on each face in the mesh.

◆ m_elementDomainIDs

std::vector<int> serif::discretization::domain::mesh::MeshTopology::m_elementDomainIDs
private

The domain IDs of the elements in the mesh.

◆ m_elementNeighbors

std::vector<std::vector<int> > serif::discretization::domain::mesh::MeshTopology::m_elementNeighbors
private

The elements sharing an interior face with each element in the mesh.

◆ m_faceElements

std::vector<FaceElements> serif::discretization::domain::mesh::MeshTopology::m_faceElements
private

The elements sharing each face in the mesh.

◆ s_noElements

const std::vector< int > serif::discretization::domain::mesh::MeshTopology::s_noElements {}
staticprivate

A static empty vector to return when an element has no neighbors or a face has no boundary elements.


The documentation for this class was generated from the following files: