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

Represents a 3D mesh. More...

#include <mesh_3d.hpp>

Inheritance diagram for vulpes::geometry::Mesh3D< FloatType, IndexType >:
[legend]
Collaboration diagram for vulpes::geometry::Mesh3D< FloatType, IndexType >:
[legend]

Public Types

using SelfPoint = Point<FloatType, 3>
 Alias for a 3D point with coordinates of type FloatType.
using BaseType
 Alias for the base class, MeshBase.
using CellsFaceVtxsUncompressed = std::vector<std::vector<IndexType>>
 A vector of vectors, where each inner vector holds the vertex indices for the faces of a cell.
using CellToVtxMap
 An uncompressed (temporary) version of the CellToVtxMap.
using CellToVtxMapUncompressed
 Map from facets to the cells they separate.
using CellToEdgeMap
 Map from edges to adjacent cells.
using EdgeToCellMap
using EdgeToVtxMap
 Map from cells to their edges.
using EdgeVtxs
 Map from an edge to its two vertices.
using index_t
using float_t
using DualMap
 Map from cells to the facets that form their boundary.
using CellToFacetMap
 Map from cells to the vertices that define them.
using FacetToCellMap
 Map from facets to the vertices that define them.
using FacetToVtxMap
 Map from vertices to the cells they belong to.
using VtxToCellMap
 Represents an edge as a pair of vertex indices.
enum  Entity
 Enumerates the different types of mesh entities based on their dimension. More...

Public Member Functions

 Mesh3D ()=default
 Default constructor. Creates an empty 3D mesh.
 Mesh3D (const std::vector< SelfPoint > &vertexes, const CellToVtxMapUncompressed &cell_vertices, const CellsFaceVtxsUncompressed &cells_face_vtxs)
 Constructor for creating a 3D mesh from a list of vertices, cell-to-vertex connectivity, and cell-face-vertex connectivity.
 Mesh3D (const std::vector< SelfPoint > &vertexes, const CellToVtxMapUncompressed &cell_vertices, const CellsFaceVtxsUncompressed &cells_face_vtxs, const MeshTag< 3, IndexType > &mesh_tags)
 Constructor for creating a 3D mesh with tags.
template<class Archive>
void serialize (Archive &ar, const unsigned int)
 Serializes the mesh data for saving or transferring.
EdgeToVtxMap & getEdgeToVtxMap ()
 Gets a mutable reference to the edge-to-vertex map.
const EdgeToVtxMap & getEdgeToVtxMap () const
 Gets a constant reference to the edge-to-vertex map.
CellToEdgeMap & getCellToEdgeMap ()
 Gets a mutable reference to the cell-to-edge map.
const CellToEdgeMap & getCellToEdgeMap () const
 Gets a constant reference to the cell-to-edge map.
EdgeToCellMap & getEdgeToCellMap ()
 Gets a mutable reference to the edge-to-cell map.
const EdgeToCellMap & getEdgeToCellMap () const
 Gets a constant reference to the edge-to-cell map.
const auto & getEdgeToVtxGlobalMap () const
 Gets a constant reference to the global edge-to-vertex map.
const auto & getCellToEdgeGlobalMap () const
 Gets a constant reference to the global cell-to-edge map.
const auto & getEdgeToCellGlobalMap () const
 Gets a constant reference to the global edge-to-cell map.
constexpr IndexType nEntity (std::size_t dim) const
 Returns the number of entities of a specific dimension in the mesh.
template<std::size_t dim>
constexpr auto & getEntityToCellMap () const
 Returns the entity-to-cell map for a given dimension.
Mesh3D agglomerate (const std::vector< IndexType > &old_to_new_cell) const
 Creates a new mesh by agglomerating (merging) cells of the current mesh.
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 nLocEntity (std::size_t dim) const
 Returns the number of locally owned entities of a given dimension.
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.

Static Public Member Functions

static Mesh3D extrude (const Mesh2D< FloatType, IndexType > &mesh_2d, const Eigen::Vector< FloatType, 2 > z_range, IndexType n_elems)
 Creates a 3D mesh by extruding a 2D mesh.
static constexpr bool parallel ()
 Indicates if the mesh is configured for parallel computation.

Static Public Attributes

static constexpr IndexType outer_dim
 The dimension of the embedding space.
static constexpr IndexType self_dim
 The dimension of the mesh itself.
static constexpr IndexType vtx_per_face
 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
 A special value used to represent an undefined or invalid index.
static constexpr IndexType UNDEF

Protected Member Functions

void buildFacetToCellAndFacetToVertex (const CellsFaceVtxsUncompressed &cells_face_vtxs)
 Builds the facet-to-cell and facet-to-vertex maps.
void buildEdgeMaps ()
 Builds the edge-related maps.
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, Mesh3D< FloatType, IndexType > &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, Mesh3D< FloatType, IndexType > &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, Mesh3D< FloatType, IndexType > &agg_mesh) const
 Builds the cell-to-vertex map for an agglomerated mesh.
Mesh3D< FloatType, IndexType > 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

EdgeToVtxMap m_edge_to_vtx
 A map from edges to their constituent vertices.
CellToEdgeMap m_cell_to_edge
 A map from cells to their edges.
EdgeToCellMap m_edge_to_cell
 A map from edges to the cells that contain them.
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 Mesh3D &lhs, const Mesh3D &rhs)
 Compares two Mesh3D objects for equality.

Detailed Description

template<typename FloatType, typename IndexType>
class vulpes::geometry::Mesh3D< FloatType, IndexType >

Represents a 3D mesh.

Template Parameters
FloatTypeThe floating-point type for vertex coordinates (e.g., float, double).
IndexTypeThe integer type for indexing vertices, cells, etc. (e.g., int, long).

Member Typedef Documentation

◆ BaseType

template<typename FloatType, typename IndexType>
using vulpes::geometry::Mesh3D< FloatType, IndexType >::BaseType
Initial value:
A base class for creating and managing mesh data structures.
Definition mesh_base.hpp:370

Alias for the base class, MeshBase.

◆ CellsFaceVtxsUncompressed

template<typename FloatType, typename IndexType>
using vulpes::geometry::Mesh3D< FloatType, IndexType >::CellsFaceVtxsUncompressed = std::vector<std::vector<IndexType>>

A vector of vectors, where each inner vector holds the vertex indices for the faces of a cell.

The format is similar to VTU files and voro++, where the first element of each inner vector is the number of vertices for the first face, followed by the vertex indices, and so on for all faces of the cell.

◆ CellToEdgeMap

template<typename FloatType, typename IndexType>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::CellToEdgeMap

Map from edges to adjacent cells.

◆ CellToFacetMap

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::CellToFacetMap
inherited

Map from cells to the vertices that define them.

◆ CellToVtxMap

template<typename FloatType, typename IndexType>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::CellToVtxMap

An uncompressed (temporary) version of the CellToVtxMap.

◆ CellToVtxMapUncompressed

template<typename FloatType, typename IndexType>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::CellToVtxMapUncompressed

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

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::DualMap
inherited

Map from cells to the facets that form their boundary.

◆ EdgeToCellMap

template<typename FloatType, typename IndexType>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::EdgeToCellMap

◆ EdgeToVtxMap

template<typename FloatType, typename IndexType>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::EdgeToVtxMap

Map from cells to their edges.

◆ EdgeVtxs

template<typename FloatType, typename IndexType>
using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::EdgeVtxs

Map from an edge to its two vertices.

◆ FacetToCellMap

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::FacetToCellMap
inherited

Map from facets to the vertices that define them.

◆ FacetToVtxMap

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::FacetToVtxMap
inherited

Map from vertices to the cells they belong to.

◆ float_t

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::float_t
inherited

◆ index_t

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::index_t
inherited

◆ SelfPoint

template<typename FloatType, typename IndexType>
using vulpes::geometry::Mesh3D< FloatType, IndexType >::SelfPoint = Point<FloatType, 3>

Alias for a 3D point with coordinates of type FloatType.

◆ VtxToCellMap

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::VtxToCellMap
inherited

Represents an edge as a pair of vertex indices.

Member Enumeration Documentation

◆ Entity

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

Constructor & Destructor Documentation

◆ Mesh3D() [1/3]

template<typename FloatType, typename IndexType>
vulpes::geometry::Mesh3D< FloatType, IndexType >::Mesh3D ( )
default

Default constructor. Creates an empty 3D mesh.

◆ Mesh3D() [2/3]

template<typename FloatType, typename IndexType>
vulpes::geometry::Mesh3D< FloatType, IndexType >::Mesh3D ( const std::vector< SelfPoint > & vertexes,
const CellToVtxMapUncompressed & cell_vertices,
const CellsFaceVtxsUncompressed & cells_face_vtxs )
inlineexplicit

Constructor for creating a 3D mesh from a list of vertices, cell-to-vertex connectivity, and cell-face-vertex connectivity.

Parameters
vertexesA vector of 3D points representing the mesh vertices.
cell_verticesAn uncompressed map showing which vertices belong to each cell.
cells_face_vtxsAn uncompressed map showing the vertices of each face for each cell.

◆ Mesh3D() [3/3]

template<typename FloatType, typename IndexType>
vulpes::geometry::Mesh3D< FloatType, IndexType >::Mesh3D ( const std::vector< SelfPoint > & vertexes,
const CellToVtxMapUncompressed & cell_vertices,
const CellsFaceVtxsUncompressed & cells_face_vtxs,
const MeshTag< 3, IndexType > & mesh_tags )
inlineexplicit

Constructor for creating a 3D mesh with tags.

Parameters
vertexesA vector of 3D points representing the mesh vertices.
cell_verticesAn uncompressed map showing which vertices belong to each cell.
cells_face_vtxsAn uncompressed map showing the vertices of each face for each cell.
mesh_tagsThe tags (metadata) to be associated with the mesh entities.

Member Function Documentation

◆ agglomerate()

template<typename FloatType, typename IndexType>
Mesh3D vulpes::geometry::Mesh3D< FloatType, IndexType >::agglomerate ( const std::vector< IndexType > & old_to_new_cell) const
inline

Creates a new mesh by agglomerating (merging) cells of the current mesh.

Parameters
old_to_new_cellA vector mapping old cell indices to new cell indices.
Returns
The new, agglomerated mesh.

◆ agglomerateBase()

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

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()

void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::agglomerateCheckConnected ( const datastructure::CrsMap< IndexType, IndexType > & new_to_old_cell) const
protectedinherited

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()

void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::buildCellToFacet ( )
protectedinherited

Builds the cell-to-facet connectivity map.

Note
Requires the m_facet_to_cell map to be already built.

◆ buildCellToVtxAgglomeration()

void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::buildCellToVtxAgglomeration ( const auto & new_to_old_cell,
const auto & old_to_new_vtx,
Mesh3D< FloatType, IndexType > & agg_mesh ) const
protectedinherited

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()

void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::buildDualGraph ( )
protectedinherited

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.

◆ buildEdgeMaps()

template<typename FloatType, typename IndexType>
void vulpes::geometry::Mesh3D< FloatType, IndexType >::buildEdgeMaps ( )
protected

Builds the edge-related maps.

This method computes and populates the m_edge_to_vtx, m_cell_to_edge, and m_edge_to_cell maps. It does this by iterating through all the faces and their vertices, identifying unique edges, and then determining which cells and vertices are connected to each edge.

◆ buildFacetToCellAndFacetToVertex()

template<typename FloatType, typename IndexType>
void vulpes::geometry::Mesh3D< FloatType, IndexType >::buildFacetToCellAndFacetToVertex ( const CellsFaceVtxsUncompressed & cells_face_vtxs)
protected

Builds the facet-to-cell and facet-to-vertex maps.

This method uses the provided cell-face-vertex connectivity to determine which faces belong to which cells and which vertices belong to each face. It correctly identifies shared faces between cells and builds the m_facet_to_cell and m_facet_to_vtx maps. It relies on the m_cell_to_vtx map being already built.

Parameters
cells_face_vtxsAn uncompressed map showing the vertices of each face for each cell.

◆ buildFacetToCellAndFacetToVtxAgglomeration()

auto vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::buildFacetToCellAndFacetToVtxAgglomeration ( const std::vector< index_t > & new_to_old_facet,
const std::vector< index_t > & old_to_new_cell,
Mesh3D< FloatType, IndexType > & agg_mesh ) const
protectedinherited

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()

void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::buildInternalMaps ( )
inlineinherited

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()

std::vector< index_t > vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::buildNewToOldFacetAgglomerationAndCellToFacet ( const auto & new_to_old_cell,
Mesh3D< FloatType, IndexType > & agg_mesh ) const
protectedinherited

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()

void vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::buildVtxToCell ( )
protectedinherited

Builds the vertex-to-cell connectivity map.

Note
Requires the m_cell_to_vtx map to be already built.

◆ extrude()

template<typename FloatType, typename IndexType>
Mesh3D< FloatType, IndexType > vulpes::geometry::Mesh3D< FloatType, IndexType >::extrude ( const Mesh2D< FloatType, IndexType > & mesh_2d,
const Eigen::Vector< FloatType, 2 > z_range,
IndexType n_elems )
static

Creates a 3D mesh by extruding a 2D mesh.

Parameters
mesh_2dThe 2D mesh to extrude.
z_rangeThe range [z_min, z_max] over which to extrude.
n_elemsThe number of new cells to create along the extrusion direction (z-axis).
Returns
The new 3D mesh.

◆ getCellToEdgeGlobalMap()

template<typename FloatType, typename IndexType>
const auto & vulpes::geometry::Mesh3D< FloatType, IndexType >::getCellToEdgeGlobalMap ( ) const
inline

Gets a constant reference to the global cell-to-edge map.

Returns
A constant reference to the CellToEdgeMap.

◆ getCellToEdgeMap() [1/2]

template<typename FloatType, typename IndexType>
CellToEdgeMap & vulpes::geometry::Mesh3D< FloatType, IndexType >::getCellToEdgeMap ( )
inline

Gets a mutable reference to the cell-to-edge map.

Returns
A mutable reference to the CellToEdgeMap.

◆ getCellToEdgeMap() [2/2]

template<typename FloatType, typename IndexType>
const CellToEdgeMap & vulpes::geometry::Mesh3D< FloatType, IndexType >::getCellToEdgeMap ( ) const
inline

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

Returns
A constant reference to the CellToEdgeMap.

◆ getCellToFacetGlobalMap()

const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getCellToFacetGlobalMap ( ) const
inlineinherited

◆ getCellToFacetMap() [1/2]

CellToFacetMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getCellToFacetMap ( )
inlineinherited

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

◆ getCellToFacetMap() [2/2]

const CellToFacetMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getCellToFacetMap ( ) const
inlineinherited

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

◆ getCellToVtxGlobalMap()

const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getCellToVtxGlobalMap ( ) const
inlineinherited

◆ getCellToVtxMap() [1/2]

CellToVtxMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getCellToVtxMap ( )
inlineinherited

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

◆ getCellToVtxMap() [2/2]

const CellToVtxMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getCellToVtxMap ( ) const
inlineinherited

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

◆ getDualGlobalMap()

const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getDualGlobalMap ( ) const
inlineinherited

◆ getDualMap() [1/2]

DualMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getDualMap ( )
inlineinherited

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

◆ getDualMap() [2/2]

const DualMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getDualMap ( ) const
inlineinherited

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

◆ getEdgeToCellGlobalMap()

template<typename FloatType, typename IndexType>
const auto & vulpes::geometry::Mesh3D< FloatType, IndexType >::getEdgeToCellGlobalMap ( ) const
inline

Gets a constant reference to the global edge-to-cell map.

Returns
A constant reference to the EdgeToCellMap.

◆ getEdgeToCellMap() [1/2]

template<typename FloatType, typename IndexType>
EdgeToCellMap & vulpes::geometry::Mesh3D< FloatType, IndexType >::getEdgeToCellMap ( )
inline

Gets a mutable reference to the edge-to-cell map.

Returns
A mutable reference to the EdgeToCellMap.

◆ getEdgeToCellMap() [2/2]

template<typename FloatType, typename IndexType>
const EdgeToCellMap & vulpes::geometry::Mesh3D< FloatType, IndexType >::getEdgeToCellMap ( ) const
inline

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

Returns
A constant reference to the EdgeToCellMap.

◆ getEdgeToVtxGlobalMap()

template<typename FloatType, typename IndexType>
const auto & vulpes::geometry::Mesh3D< FloatType, IndexType >::getEdgeToVtxGlobalMap ( ) const
inline

Gets a constant reference to the global edge-to-vertex map.

Returns
A constant reference to the EdgeToVtxMap.

◆ getEdgeToVtxMap() [1/2]

template<typename FloatType, typename IndexType>
EdgeToVtxMap & vulpes::geometry::Mesh3D< FloatType, IndexType >::getEdgeToVtxMap ( )
inline

Gets a mutable reference to the edge-to-vertex map.

Returns
A mutable reference to the EdgeToVtxMap.

◆ getEdgeToVtxMap() [2/2]

template<typename FloatType, typename IndexType>
const EdgeToVtxMap & vulpes::geometry::Mesh3D< FloatType, IndexType >::getEdgeToVtxMap ( ) const
inline

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

Returns
A constant reference to the EdgeToVtxMap.

◆ getEntityToCellGlobalMap()

auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getEntityToCellGlobalMap ( ) const
inlineconstexprinherited

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>
template<std::size_t dim>
auto & vulpes::geometry::Mesh3D< FloatType, IndexType >::getEntityToCellMap ( ) const
inlineconstexpr

Returns the entity-to-cell map for a given dimension.

Template Parameters
dimThe dimension of the entity (0 for vertices, 1 for edges, 2 for faces).
Returns
A constant reference to the corresponding map.

◆ getFacetToCellGlobalMap()

const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getFacetToCellGlobalMap ( ) const
inlineinherited

◆ getFacetToCellMap() [1/2]

FacetToCellMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getFacetToCellMap ( )
inlineinherited

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

◆ getFacetToCellMap() [2/2]

const FacetToCellMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getFacetToCellMap ( ) const
inlineinherited

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

◆ getFacetToVtxGlobalMap()

const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getFacetToVtxGlobalMap ( ) const
inlineinherited

◆ getFacetToVtxMap() [1/2]

FacetToVtxMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getFacetToVtxMap ( )
inlineinherited

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

◆ getFacetToVtxMap() [2/2]

const FacetToVtxMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getFacetToVtxMap ( ) const
inlineinherited

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

◆ getMeshTags() [1/2]

auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getMeshTags ( )
inlineinherited

Gets a modifiable reference to the mesh tags.

◆ getMeshTags() [2/2]

const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getMeshTags ( ) const
inlineinherited

Gets a constant reference to the mesh tags.

◆ getMetadata() [1/2]

auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getMetadata ( )
inlineinherited

Gets a modifiable reference to the mesh metadata.

◆ getMetadata() [2/2]

const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getMetadata ( ) const
inlineinherited

Gets a constant reference to the mesh metadata.

◆ getVertexes() [1/2]

std::vector< SelfPoint > & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getVertexes ( )
inlineinherited

Gets a modifiable reference to the vector of vertices.

◆ getVertexes() [2/2]

const std::vector< SelfPoint > & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getVertexes ( ) const
inlineinherited

Gets a constant reference to the vector of vertices.

◆ getVtxToCellGlobalMap()

const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getVtxToCellGlobalMap ( ) const
inlineinherited

◆ getVtxToCellMap() [1/2]

VtxToCellMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getVtxToCellMap ( )
inlineinherited

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

◆ getVtxToCellMap() [2/2]

const VtxToCellMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::getVtxToCellMap ( ) const
inlineinherited

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

◆ invertCellAgglomeration()

datastructure::CrsMap< index_t, index_t > vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::invertCellAgglomeration ( const std::vector< index_t > & old_to_new_cell) const
protectedinherited

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 vulpes::geometry::Mesh3D< FloatType, IndexType >::nEntity ( std::size_t dim) const
inlineconstexpr

Returns the number of entities of a specific dimension in the mesh.

Parameters
dimThe dimension of the entity (0 for vertices, 1 for edges, 2 for faces, 3 for cells).
Returns
The number of entities of the specified dimension.

◆ nLocEntity()

IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::nLocEntity ( std::size_t dim) const
inlineconstexprinherited

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()

IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::nOwnedCells ( ) const
inlineconstexprinherited

Returns the number of locally owned cells.

Returns
The number of cells owned by the current process.

◆ numCells()

IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::numCells ( ) const
inlineinherited

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()

constexpr bool vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::parallel ( )
inlinestaticconstexprinherited

Indicates if the mesh is configured for parallel computation.

Returns
Always returns false in this base implementation.

◆ self() [1/2]

auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::self ( )
inlineprotectedinherited

Helper to get a reference to the Derived class instance.

◆ self() [2/2]

const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::self ( ) const
inlineprotectedinherited

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

◆ serialize()

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

Serializes the mesh data for saving or transferring.

Template Parameters
ArchiveThe archive type (e.g., from Boost.Serialization).
Parameters
arThe archive to serialize to or from.

◆ operator==

template<typename FloatType, typename IndexType>
bool operator== ( const Mesh3D< FloatType, IndexType > & lhs,
const Mesh3D< FloatType, IndexType > & rhs )
friend

Compares two Mesh3D objects for equality.

Parameters
lhsThe left-hand side mesh.
rhsThe right-hand side mesh.
Returns
True if the meshes are identical, false otherwise.

Member Data Documentation

◆ is_manifold

bool vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::is_manifold
staticconstexprinherited

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

◆ m_cell_to_edge

template<typename FloatType, typename IndexType>
CellToEdgeMap vulpes::geometry::Mesh3D< FloatType, IndexType >::m_cell_to_edge
protected

A map from cells to their edges.

This is a crucial map, especially for things like finite element method degrees of freedom.

◆ m_cell_to_facet

CellToFacetMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::m_cell_to_facet
protectedinherited

Maps each cell to the list of its vertices.

◆ m_cell_to_vtx

CellToVtxMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::m_cell_to_vtx
protectedinherited

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

DualMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::m_dual_graph
protectedinherited

Maps each cell to the list of its boundary facets.

◆ m_edge_to_cell

template<typename FloatType, typename IndexType>
EdgeToCellMap vulpes::geometry::Mesh3D< FloatType, IndexType >::m_edge_to_cell
protected

A map from edges to the cells that contain them.

◆ m_edge_to_vtx

template<typename FloatType, typename IndexType>
EdgeToVtxMap vulpes::geometry::Mesh3D< FloatType, IndexType >::m_edge_to_vtx
protected

A map from edges to their constituent vertices.

This is a handy internal map used during the building of other maps.

◆ m_facet_to_cell

FacetToCellMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::m_facet_to_cell
protectedinherited

Maps each facet to its vertices.

In 1D, facets are the same as vertices.

◆ m_facet_to_vtx

FacetToVtxMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::m_facet_to_vtx
protectedinherited

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

◆ m_mesh_tags

MeshTag<SelfDim, IndexType> vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::m_mesh_tags
protectedinherited

Stores global metadata for the mesh.

◆ m_metadata

Metadata<FloatType, IndexType> vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::m_metadata
protectedinherited

◆ m_vertexes

std::vector<SelfPoint> vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::m_vertexes
protectedinherited

< 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

VtxToCellMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::m_vtx_to_cell
protectedinherited

Stores all tags associated with the mesh.

◆ outer_dim

IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::outer_dim
staticconstexprinherited

The dimension of the embedding space.

◆ self_dim

IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::self_dim
staticconstexprinherited

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

IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::UNDEF
inlinestaticconstexprinherited

◆ vtx_per_face

IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh3D< FloatType, IndexType > >::vtx_per_face
staticconstexprinherited

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 files: