Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived > Class Template Reference

A base class for creating and managing mesh data structures. More...

#include <mesh_base.hpp>

Collaboration diagram for vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >:
[legend]

Public Types

enum  Entity { VtxEnty = 0 , FacetEnty = SelfDim - 1 , CellEnty = SelfDim }
 Enumerates the different types of mesh entities based on their dimension. More...
using index_t = IndexType
using float_t = FloatType
using SelfPoint = Point<FloatType, SelfDim>
 Map for cell-to-cell connectivity (the dual graph).
using DualMap = datastructure::CrsMap<IndexType, IndexType>
 Map from cells to the facets that form their boundary.
using CellToFacetMap = datastructure::CrsMap<IndexType, IndexType>
 Map from cells to the vertices that define them.
using CellToVtxMap = datastructure::CrsMap<IndexType, IndexType>
 An uncompressed (temporary) version of the CellToVtxMap.
using CellToVtxMapUncompressed = datastructure::CrsMapUncompressed<IndexType>
 Map from facets to the cells they separate.
using FacetToCellMap
 Map from facets to the vertices that define them.
using FacetToVtxMap
 Map from vertices to the cells they belong to.
using VtxToCellMap = datastructure::CrsMap<IndexType, IndexType>
 Represents an edge as a pair of vertex indices.
using EdgeVtxs = std::array<IndexType, 2>
 Map from an edge to its two vertices.
using EdgeToVtxMap = std::vector<EdgeVtxs>
 Map from cells to their edges.
using CellToEdgeMap = datastructure::CrsMap<IndexType, IndexType>
 Map from edges to adjacent cells.
using EdgeToCellMap = datastructure::CrsMap<IndexType, IndexType>

Public Member Functions

std::vector< SelfPoint > & getVertexes ()
 Gets a modifiable reference to the vector of vertices.
const std::vector< SelfPoint > & getVertexes () const
 Gets a constant reference to the vector of vertices.
DualMap & getDualMap ()
 Gets a modifiable reference to the dual graph (cell-to-cell connections).
const DualMap & getDualMap () const
 Gets a constant reference to the dual graph (cell-to-cell connections).
CellToFacetMap & getCellToFacetMap ()
 Gets a modifiable reference to the cell-to-facet map.
const CellToFacetMap & getCellToFacetMap () const
 Gets a constant reference to the cell-to-facet map.
CellToVtxMap & getCellToVtxMap ()
 Gets a modifiable reference to the cell-to-vertex map.
const CellToVtxMap & getCellToVtxMap () const
 Gets a constant reference to the cell-to-vertex map.
FacetToCellMap & getFacetToCellMap ()
 Gets a modifiable reference to the facet-to-cell map.
const FacetToCellMap & getFacetToCellMap () const
 Gets a constant reference to the facet-to-cell map.
FacetToVtxMap & getFacetToVtxMap ()
 Gets a modifiable reference to the facet-to-vertex map.
const FacetToVtxMap & getFacetToVtxMap () const
 Gets a constant reference to the facet-to-vertex map.
VtxToCellMap & getVtxToCellMap ()
 Gets a modifiable reference to the vertex-to-cell map.
const VtxToCellMap & getVtxToCellMap () const
 Gets a constant reference to the vertex-to-cell map.
const auto & getDualGlobalMap () const
const auto & getCellToFacetGlobalMap () const
const auto & getCellToVtxGlobalMap () const
const auto & getFacetToCellGlobalMap () const
const auto & getFacetToVtxGlobalMap () const
const auto & getVtxToCellGlobalMap () const
auto & getMeshTags ()
 Gets a modifiable reference to the mesh tags.
const auto & getMeshTags () const
 Gets a constant reference to the mesh tags.
auto & getMetadata ()
 Gets a modifiable reference to the mesh metadata.
const auto & getMetadata () const
 Gets a constant reference to the mesh metadata.
IndexType numCells () const
 Returns the total number of cells in the mesh.
void buildInternalMaps ()
 Builds all the secondary connectivity maps from the primary ones.
constexpr IndexType nEntity (std::size_t dim) const
 Returns the total number of entities of a given dimension.
constexpr IndexType nLocEntity (std::size_t dim) const
 Returns the number of locally owned entities of a given dimension.
template<std::size_t dim>
constexpr auto & getEntityToCellMap () const
 Gets the map from a given entity dimension to cells.
template<std::size_t dim>
constexpr auto & getEntityToCellGlobalMap () const
 Gets the global map from a given entity dimension to cells.
constexpr IndexType nOwnedCells () const
 Returns the number of locally owned cells.
template<class Archive>
void serialize (Archive &ar, const unsigned int)
 Serializes the mesh data.

Static Public Member Functions

static constexpr bool parallel ()
 Indicates if the mesh is configured for parallel computation.

Static Public Attributes

static constexpr IndexType outer_dim = OuterDim
 The dimension of the embedding space.
static constexpr IndexType self_dim = SelfDim
 The dimension of the mesh itself.
static constexpr IndexType vtx_per_face = self_dim <= 2 ? self_dim : -1
 True if the mesh is a surface in a higher-dimensional space (e.g., a 2D surface in 3D space).
static constexpr bool is_manifold = !(outer_dim == self_dim)
 A special value used to represent an undefined or invalid index.
static constexpr IndexType UNDEF = static_cast<IndexType>(-1)

Protected Member Functions

const auto & self () const
 Helper to get a constant reference to the Derived class instance.
auto & self ()
 Helper to get a reference to the Derived class instance.
datastructure::CrsMap< index_t, index_t > invertCellAgglomeration (const std::vector< index_t > &old_to_new_cell) const
 Creates a map from new (agglomerated) cell IDs to old (fine) cell IDs.
std::vector< index_t > buildNewToOldFacetAgglomerationAndCellToFacet (const auto &new_to_old_cell, Derived &agg_mesh) const
 Builds the facet mapping and cell-to-facet map for an agglomerated mesh.
auto buildFacetToCellAndFacetToVtxAgglomeration (const std::vector< index_t > &new_to_old_facet, const std::vector< index_t > &old_to_new_cell, Derived &agg_mesh) const
 Builds the facet-to-cell and facet-to-vertex maps for an agglomerated mesh.
void buildCellToVtxAgglomeration (const auto &new_to_old_cell, const auto &old_to_new_vtx, Derived &agg_mesh) const
 Builds the cell-to-vertex map for an agglomerated mesh.
Derived agglomerateBase (const std::vector< index_t > &old_to_new_cell, bool check_connected=true) const
 Creates a new, coarser mesh by grouping cells together.
void agglomerateCheckConnected (const datastructure::CrsMap< IndexType, IndexType > &new_to_old_cell) const
 Checks if each new agglomerated cell consists of connected old cells.
void buildVtxToCell ()
 Builds the vertex-to-cell connectivity map.
void buildCellToFacet ()
 Builds the cell-to-facet connectivity map.
void buildDualGraph ()
 Builds the dual graph (cell-to-cell adjacency).

Protected Attributes

std::vector< SelfPoint > m_vertexes
 < A list of all vertex coordinates.
DualMap m_dual_graph
 Maps each cell to the list of its boundary facets.
CellToFacetMap m_cell_to_facet
 Maps each cell to the list of its vertices.
CellToVtxMap m_cell_to_vtx
 Maps each facet to its borders.
FacetToCellMap m_facet_to_cell
 Maps each facet to its vertices.
FacetToVtxMap m_facet_to_vtx
 Maps each vertex to the list of cells it belongs to.
VtxToCellMap m_vtx_to_cell
 Stores all tags associated with the mesh.
MeshTag< SelfDim, IndexType > m_mesh_tags
 Stores global metadata for the mesh.
Metadata< FloatType, IndexType > m_metadata

Friends

bool operator== (const MeshBase &lhs, const MeshBase &rhs)
 Checks if two meshes are identical.

Detailed Description

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
class vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >

A base class for creating and managing mesh data structures.

This class provides the fundamental storage and connectivity information for a mesh, such as vertices, cells, and faces. It uses a common programming pattern called CRTP (Curiously Recurring Template Pattern), which allows it to be extended by a Derived class with more specific features.

It defines the relationships between different mesh parts (e.g., which vertices form a cell, which cells are neighbors).

Template Parameters
FloatTypeThe data type for floating-point numbers (e.g., float or double).
IndexTypeThe data type for indices (e.g., int or std::size_t).
OuterDimThe dimension of the space the mesh lives in (e.g., 3 for a surface in 3D space).
SelfDimThe dimension of the mesh itself (e.g., 2 for a 2D mesh, 3 for a 3D mesh).
DerivedThe actual mesh class that inherits from this base (CRTP).

Member Typedef Documentation

◆ CellToEdgeMap

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::CellToEdgeMap = datastructure::CrsMap<IndexType, IndexType>

Map from edges to adjacent cells.

◆ CellToFacetMap

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::CellToFacetMap = datastructure::CrsMap<IndexType, IndexType>

Map from cells to the vertices that define them.

◆ CellToVtxMap

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::CellToVtxMap = datastructure::CrsMap<IndexType, IndexType>

An uncompressed (temporary) version of the CellToVtxMap.

◆ CellToVtxMapUncompressed

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::CellToVtxMapUncompressed = datastructure::CrsMapUncompressed<IndexType>

Map from facets to the cells they separate.

If this is not a manyfold a facet separates exactly two cells (unless on the boundary of the mesh). If it is a manifold there is no limit (e.g. a graph junction of many edges)

◆ DualMap

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::DualMap = datastructure::CrsMap<IndexType, IndexType>

Map from cells to the facets that form their boundary.

◆ EdgeToCellMap

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::EdgeToCellMap = datastructure::CrsMap<IndexType, IndexType>

◆ EdgeToVtxMap

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::EdgeToVtxMap = std::vector<EdgeVtxs>

Map from cells to their edges.

◆ EdgeVtxs

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::EdgeVtxs = std::array<IndexType, 2>

Map from an edge to its two vertices.

◆ FacetToCellMap

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::FacetToCellMap
Initial value:
std::conditional_t<
std::vector<std::array<IndexType, 2>>>
Definition crs_map.hpp:72
static constexpr bool is_manifold
A special value used to represent an undefined or invalid index.
Definition mesh_base.hpp:384

Map from facets to the vertices that define them.

◆ FacetToVtxMap

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::FacetToVtxMap
Initial value:

Map from vertices to the cells they belong to.

◆ float_t

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::float_t = FloatType

◆ index_t

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::index_t = IndexType

◆ SelfPoint

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::SelfPoint = Point<FloatType, SelfDim>

Map for cell-to-cell connectivity (the dual graph).

◆ VtxToCellMap

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::VtxToCellMap = datastructure::CrsMap<IndexType, IndexType>

Represents an edge as a pair of vertex indices.

Member Enumeration Documentation

◆ Entity

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
enum vulpes::geometry::MeshBase::Entity

Enumerates the different types of mesh entities based on their dimension.

Enumerator
VtxEnty 

A vertex (dimension 0).

A facet (e.g., an edge in 2D, a face in 3D).

FacetEnty 

A cell (e.g., a triangle/quad in 2D, a tet/hex in 3D).

CellEnty 

Member Function Documentation

◆ agglomerateBase()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
Derived vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::agglomerateBase ( const std::vector< index_t > & old_to_new_cell,
bool check_connected = true ) const
protected

Creates a new, coarser mesh by grouping cells together.

This process, called agglomeration, is used to create a simplified version of the mesh, for example in multigrid solvers.

Parameters
old_to_new_cellA vector mapping each old cell to a new, larger cell ID.
check_connectedIf true, verifies that each new cell is formed by a connected group of old cells.
Returns
A new Derived mesh object representing the agglomerated mesh.

◆ agglomerateCheckConnected()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::agglomerateCheckConnected ( const datastructure::CrsMap< IndexType, IndexType > & new_to_old_cell) const
protected

Checks if each new agglomerated cell consists of connected old cells.

It performs a search (DFS) within each group of old cells to ensure they form a single, contiguous block. It will exit with an error if a disconnected group is found.

Parameters
new_to_old_cellA map from new cell IDs to the old cell IDs they contain.

◆ buildCellToFacet()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::buildCellToFacet ( )
protected

Builds the cell-to-facet connectivity map.

Note
Requires the m_facet_to_cell map to be already built.

◆ buildCellToVtxAgglomeration()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::buildCellToVtxAgglomeration ( const auto & new_to_old_cell,
const auto & old_to_new_vtx,
Derived & agg_mesh ) const
protected

Builds the cell-to-vertex map for an agglomerated mesh.

Parameters
new_to_old_cellA map from new cell IDs to the old cell IDs they contain.
old_to_new_vtxA map from old vertex IDs to new vertex IDs.
[in,out]agg_meshThe new, agglomerated mesh being built.

◆ buildDualGraph()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::buildDualGraph ( )
protected

Builds the dual graph (cell-to-cell adjacency).

Two cells are considered neighbors if they share a common facet.

Note
Requires the m_cell_to_facet and m_facet_to_cell maps to be already built.

◆ buildFacetToCellAndFacetToVtxAgglomeration()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
auto vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::buildFacetToCellAndFacetToVtxAgglomeration ( const std::vector< index_t > & new_to_old_facet,
const std::vector< index_t > & old_to_new_cell,
Derived & agg_mesh ) const
protected

Builds the facet-to-cell and facet-to-vertex maps for an agglomerated mesh.

Parameters
new_to_old_facetA map from new facet IDs to old facet IDs.
old_to_new_cellA map from old cell IDs to new cell IDs.
[in,out]agg_meshThe new, agglomerated mesh being built.
Returns
A map from old vertex IDs to new vertex IDs.

◆ buildInternalMaps()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::buildInternalMaps ( )
inline

Builds all the secondary connectivity maps from the primary ones.

This is a convenience function that calls the individual build methods for creating maps like VtxToCell, CellToFacet, and the DualGraph.

◆ buildNewToOldFacetAgglomerationAndCellToFacet()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
std::vector< IndexType > vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::buildNewToOldFacetAgglomerationAndCellToFacet ( const auto & new_to_old_cell,
Derived & agg_mesh ) const
protected

Builds the facet mapping and cell-to-facet map for an agglomerated mesh.

This function identifies the boundary facets of the new, larger cells.

Parameters
new_to_old_cellA map from new cell IDs to the old cell IDs they contain.
[in,out]agg_meshThe new, agglomerated mesh being built.
Returns
A vector mapping new facet IDs to their original old facet IDs.

◆ buildVtxToCell()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::buildVtxToCell ( )
protected

Builds the vertex-to-cell connectivity map.

Note
Requires the m_cell_to_vtx map to be already built.

◆ getCellToFacetGlobalMap()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getCellToFacetGlobalMap ( ) const
inline

◆ getCellToFacetMap() [1/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
CellToFacetMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getCellToFacetMap ( )
inline

Gets a modifiable reference to the cell-to-facet map.

◆ getCellToFacetMap() [2/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const CellToFacetMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getCellToFacetMap ( ) const
inline

Gets a constant reference to the cell-to-facet map.

◆ getCellToVtxGlobalMap()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getCellToVtxGlobalMap ( ) const
inline

◆ getCellToVtxMap() [1/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
CellToVtxMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getCellToVtxMap ( )
inline

Gets a modifiable reference to the cell-to-vertex map.

◆ getCellToVtxMap() [2/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const CellToVtxMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getCellToVtxMap ( ) const
inline

Gets a constant reference to the cell-to-vertex map.

◆ getDualGlobalMap()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getDualGlobalMap ( ) const
inline

◆ getDualMap() [1/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
DualMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getDualMap ( )
inline

Gets a modifiable reference to the dual graph (cell-to-cell connections).

◆ getDualMap() [2/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const DualMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getDualMap ( ) const
inline

Gets a constant reference to the dual graph (cell-to-cell connections).

◆ getEntityToCellGlobalMap()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
template<std::size_t dim>
auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getEntityToCellGlobalMap ( ) const
inlineconstexpr

Gets the global map from a given entity dimension to cells.

Similar to getEntityToCellMap, but for the entire (global) mesh. This call is forwarded to the Derived class.

Template Parameters
dimThe dimension of the entity.
Returns
A reference to the corresponding map.

◆ getEntityToCellMap()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
template<std::size_t dim>
auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getEntityToCellMap ( ) const
inlineconstexpr

Gets the map from a given entity dimension to cells.

For example, getEntityToCellMap<0>() would return the vertex-to-cell map. This call is forwarded to the Derived class.

Template Parameters
dimThe dimension of the entity.
Returns
A reference to the corresponding map.

◆ getFacetToCellGlobalMap()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getFacetToCellGlobalMap ( ) const
inline

◆ getFacetToCellMap() [1/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
FacetToCellMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getFacetToCellMap ( )
inline

Gets a modifiable reference to the facet-to-cell map.

◆ getFacetToCellMap() [2/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const FacetToCellMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getFacetToCellMap ( ) const
inline

Gets a constant reference to the facet-to-cell map.

◆ getFacetToVtxGlobalMap()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getFacetToVtxGlobalMap ( ) const
inline

◆ getFacetToVtxMap() [1/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
FacetToVtxMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getFacetToVtxMap ( )
inline

Gets a modifiable reference to the facet-to-vertex map.

◆ getFacetToVtxMap() [2/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const FacetToVtxMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getFacetToVtxMap ( ) const
inline

Gets a constant reference to the facet-to-vertex map.

◆ getMeshTags() [1/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getMeshTags ( )
inline

Gets a modifiable reference to the mesh tags.

◆ getMeshTags() [2/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getMeshTags ( ) const
inline

Gets a constant reference to the mesh tags.

◆ getMetadata() [1/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getMetadata ( )
inline

Gets a modifiable reference to the mesh metadata.

◆ getMetadata() [2/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getMetadata ( ) const
inline

Gets a constant reference to the mesh metadata.

◆ getVertexes() [1/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
std::vector< SelfPoint > & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getVertexes ( )
inline

Gets a modifiable reference to the vector of vertices.

◆ getVertexes() [2/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const std::vector< SelfPoint > & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getVertexes ( ) const
inline

Gets a constant reference to the vector of vertices.

◆ getVtxToCellGlobalMap()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getVtxToCellGlobalMap ( ) const
inline

◆ getVtxToCellMap() [1/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
VtxToCellMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getVtxToCellMap ( )
inline

Gets a modifiable reference to the vertex-to-cell map.

◆ getVtxToCellMap() [2/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const VtxToCellMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::getVtxToCellMap ( ) const
inline

Gets a constant reference to the vertex-to-cell map.

◆ invertCellAgglomeration()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
datastructure::CrsMap< IndexType, IndexType > vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::invertCellAgglomeration ( const std::vector< index_t > & old_to_new_cell) const
protected

Creates a map from new (agglomerated) cell IDs to old (fine) cell IDs.

Parameters
old_to_new_cellA vector where the index is the old cell ID and the value is the new cell ID.
Returns
A compressed map (CrsMap) from new cell IDs to a list of the old cell IDs they contain.

◆ nEntity()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::nEntity ( std::size_t dim) const
inlineconstexpr

Returns the total number of entities of a given dimension.

This call is forwarded to the Derived class.

Parameters
dimThe dimension of the entity (e.g., 0 for vertices, self_dim for cells).
Returns
The number of entities.

◆ nLocEntity()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::nLocEntity ( std::size_t dim) const
inlineconstexpr

Returns the number of locally owned entities of a given dimension.

This is mainly for parallel computing. This call is forwarded to the Derived class.

Parameters
dimThe dimension of the entity.
Returns
The number of local entities.

◆ nOwnedCells()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::nOwnedCells ( ) const
inlineconstexpr

Returns the number of locally owned cells.

Returns
The number of cells owned by the current process.

◆ numCells()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::numCells ( ) const
inline

Returns the total number of cells in the mesh.

It also includes assertions to ensure the mesh data is consistent.

Returns
The number of cells.

◆ parallel()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
constexpr bool vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::parallel ( )
inlinestaticconstexpr

Indicates if the mesh is configured for parallel computation.

Returns
Always returns false in this base implementation.

◆ self() [1/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::self ( )
inlineprotected

Helper to get a reference to the Derived class instance.

◆ self() [2/2]

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::self ( ) const
inlineprotected

Helper to get a constant reference to the Derived class instance.

◆ serialize()

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
template<class Archive>
void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::serialize ( Archive & ar,
const unsigned int  )
inline

Serializes the mesh data.

This function is used to save or send the mesh's state. It's designed to work with a serialization library like Boost.Serialization.

Parameters
arThe archive object to write to or read from.

◆ operator==

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
bool operator== ( const MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived > & lhs,
const MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived > & rhs )
friend

Checks if two meshes are identical.

Parameters
lhsThe left-hand side mesh.
rhsThe right-hand side mesh.
Returns
true if all data members of the two meshes are equal, false otherwise.

Member Data Documentation

◆ is_manifold

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
bool vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::is_manifold = !(outer_dim == self_dim)
staticconstexpr

A special value used to represent an undefined or invalid index.

◆ m_cell_to_facet

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
CellToFacetMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::m_cell_to_facet
protected

Maps each cell to the list of its vertices.

◆ m_cell_to_vtx

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
CellToVtxMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::m_cell_to_vtx
protected

Maps each facet to its borders.

If this is not a manifold the cells are always two if the facet is internal and one if on the boundary, in this case one of the two entries is UNDEF. The cell in the first position in the one where the vertices of the facet in m_facet_to_vtx follow the "correct" orientation (CCW in 2D/outer pointing following the right-hand rule in 3D), the second one instead must be the contrary.

◆ m_dual_graph

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
DualMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::m_dual_graph
protected

Maps each cell to the list of its boundary facets.

◆ m_facet_to_cell

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
FacetToCellMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::m_facet_to_cell
protected

Maps each facet to its vertices.

In 1D, facets are the same as vertices.

◆ m_facet_to_vtx

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
FacetToVtxMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::m_facet_to_vtx
protected

Maps each vertex to the list of cells it belongs to.

◆ m_mesh_tags

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
MeshTag<SelfDim, IndexType> vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::m_mesh_tags
protected

Stores global metadata for the mesh.

◆ m_metadata

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
Metadata<FloatType, IndexType> vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::m_metadata
protected

◆ m_vertexes

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
std::vector<SelfPoint> vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::m_vertexes
protected

< A list of all vertex coordinates.

The dual graph, storing neighbors for each cell. Two cells are neighbors if they share a facet.

◆ m_vtx_to_cell

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
VtxToCellMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::m_vtx_to_cell
protected

Stores all tags associated with the mesh.

◆ outer_dim

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::outer_dim = OuterDim
staticconstexpr

The dimension of the embedding space.

◆ self_dim

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::self_dim = SelfDim
staticconstexpr

The dimension of the mesh itself.

The number of vertices per face. Set to -1 for 3D meshes where faces can have variable vertices.

◆ UNDEF

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::UNDEF = static_cast<IndexType>(-1)
inlinestaticconstexpr

◆ vtx_per_face

template<typename FloatType, typename IndexType, IndexType OuterDim, IndexType SelfDim, typename Derived>
IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Derived >::vtx_per_face = self_dim <= 2 ? self_dim : -1
staticconstexpr

True if the mesh is a surface in a higher-dimensional space (e.g., a 2D surface in 3D space).


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