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

A class for a 2D mesh, inheriting from MeshBase. More...

#include <mesh_2d.hpp>

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

Public Types

using SelfPoint = Point<FloatType, 2>
 Alias for a 2D point.
using BaseType
 Alias for the map from cells to vertices.
using CellToVtxMap = datastructure::CrsMap<IndexType, IndexType>
 Alias for the uncompressed version of the cell-to-vertex map.
using CellToVtxMapUncompressed = datastructure::CrsMapUncompressed<IndexType>
 A special value used to represent an undefined or invalid index.
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.
using EdgeVtxs
 Map from an edge to its two vertices.
using EdgeToVtxMap
 Map from cells to their edges.
using CellToEdgeMap
 Map from edges to adjacent cells.
using EdgeToCellMap
enum  Entity
 Enumerates the different types of mesh entities based on their dimension. More...

Public Member Functions

 Mesh2D ()=default
 Default constructor. Creates an empty mesh.
 Mesh2D (const std::vector< SelfPoint > &vertexes, const CellToVtxMapUncompressed &cell_vertices)
 Constructs a mesh from vertices and an uncompressed cell-to-vertex map.
 Mesh2D (const std::vector< SelfPoint > &vertexes, const CellToVtxMap &cell_vertices)
 Constructs a mesh from vertices and a compressed cell-to-vertex map.
 Mesh2D (const std::vector< SelfPoint > &vertexes, const CellToVtxMap &cell_vertices, const MeshTag< 2, IndexType > &tags)
 Constructs a mesh from vertices, a cell-to-vertex map, and tags.
 Mesh2D (const std::vector< SelfPoint > &vertexes, const CellToVtxMapUncompressed &cell_vertices, const MeshTag< 2, IndexType > &tags)
 Constructs a mesh from vertices, an uncompressed cell-to-vertex map, and tags.
template<class Archive>
void serialize (Archive &ar, const unsigned int)
 Serializes the mesh data by calling the base class's serialization.
constexpr IndexType nEntity (std::size_t dim) const
 Returns the total number of entities of a given dimension.
template<std::size_t dim>
constexpr auto & getEntityToCellMap () const
 Gets the connectivity map from a given entity dimension to cells.
Mesh2D agglomerate (const std::vector< IndexType > &old_to_new_cell) const
 Creates a new, coarser mesh by grouping cells together.
Mesh2D subMesh (const std::vector< IndexType > &cell_ids) const
 Creates a new mesh from a subset of 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 constexpr bool parallel ()
 Indicates if the mesh is configured for parallel computation.

Static Public Attributes

static constexpr IndexType UNDEF = static_cast<IndexType>(-1)
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.

Protected Member Functions

void buildMesh ()
 Builds all the necessary connectivity maps for the mesh.
void buildFacetToCellAndCellToFacetAndFacetToVertex ()
 Builds the core connectivity maps relating facets (edges) to cells and vertices.
void fixVertexAndFacetsOrders ()
 Enforces the CCW ordering conventions for the mesh.
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, Mesh2D< 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, Mesh2D< 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, Mesh2D< FloatType, IndexType > &agg_mesh) const
 Builds the cell-to-vertex map for an agglomerated mesh.
Mesh2D< 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

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 Mesh2D &lhs, const Mesh2D &rhs)
 Checks if two 2D meshes are identical by comparing their base class data.

Detailed Description

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

A class for a 2D mesh, inheriting from MeshBase.

This class provides a specific implementation for a two-dimensional mesh composed of polygonal cells. It defines strict ordering rules to ensure consistency, which is important for many numerical algorithms.

Mesh Properties and Ordering Rules:

  • Cell to Vertex: Vertices defining a cell are always ordered counter-clockwise (CCW).
  • Cell to Facet: Facets (edges) of a cell are ordered to follow the CCW sequence of vertices.
  • Facet to Vertex: The two vertices of a facet are always ordered by their index, from smallest to largest.
  • Facet to Cell: For an interior facet separating two cells, the first cell in the map is the one whose CCW orientation is consistent with the facet's direction. The second cell is the neighbor. For a boundary facet, one of the cell indices will be UNDEF.
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).

Member Typedef Documentation

◆ BaseType

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

Alias for the map from cells to vertices.

◆ CellToEdgeMap

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< FloatType, IndexType > >::CellToEdgeMap
inherited

Map from edges to adjacent cells.

◆ CellToFacetMap

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

Map from cells to the vertices that define them.

◆ CellToVtxMap

template<typename FloatType, typename IndexType>
using vulpes::geometry::Mesh2D< FloatType, IndexType >::CellToVtxMap = datastructure::CrsMap<IndexType, IndexType>

Alias for the uncompressed version of the cell-to-vertex map.

◆ CellToVtxMapUncompressed

template<typename FloatType, typename IndexType>
using vulpes::geometry::Mesh2D< FloatType, IndexType >::CellToVtxMapUncompressed = datastructure::CrsMapUncompressed<IndexType>

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

◆ DualMap

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

Map from cells to the facets that form their boundary.

◆ EdgeToCellMap

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< FloatType, IndexType > >::EdgeToCellMap
inherited

◆ EdgeToVtxMap

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< FloatType, IndexType > >::EdgeToVtxMap
inherited

Map from cells to their edges.

◆ EdgeVtxs

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< FloatType, IndexType > >::EdgeVtxs
inherited

Map from an edge to its two vertices.

◆ FacetToCellMap

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

Map from facets to the vertices that define them.

◆ FacetToVtxMap

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

Map from vertices to the cells they belong to.

◆ float_t

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

◆ index_t

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

◆ SelfPoint

template<typename FloatType, typename IndexType>
using vulpes::geometry::Mesh2D< FloatType, IndexType >::SelfPoint = Point<FloatType, 2>

Alias for a 2D point.

Alias for the base class type.

◆ VtxToCellMap

using vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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

◆ Mesh2D() [1/5]

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

Default constructor. Creates an empty mesh.

◆ Mesh2D() [2/5]

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

Constructs a mesh from vertices and an uncompressed cell-to-vertex map.

Parameters
vertexesA vector of 2D points representing the mesh vertices.
cell_verticesAn uncompressed map where each row contains the vertex indices for a cell.

◆ Mesh2D() [3/5]

template<typename FloatType, typename IndexType>
vulpes::geometry::Mesh2D< FloatType, IndexType >::Mesh2D ( const std::vector< SelfPoint > & vertexes,
const CellToVtxMap & cell_vertices )
inlineexplicit

Constructs a mesh from vertices and a compressed cell-to-vertex map.

Parameters
vertexesA vector of 2D points representing the mesh vertices.
cell_verticesA compressed map where each row contains the vertex indices for a cell.

◆ Mesh2D() [4/5]

template<typename FloatType, typename IndexType>
vulpes::geometry::Mesh2D< FloatType, IndexType >::Mesh2D ( const std::vector< SelfPoint > & vertexes,
const CellToVtxMap & cell_vertices,
const MeshTag< 2, IndexType > & tags )
inlineexplicit

Constructs a mesh from vertices, a cell-to-vertex map, and tags.

Parameters
vertexesA vector of 2D points representing the mesh vertices.
cell_verticesA compressed map of cell vertices.
tagsA MeshTag object containing labels for mesh entities.

◆ Mesh2D() [5/5]

template<typename FloatType, typename IndexType>
vulpes::geometry::Mesh2D< FloatType, IndexType >::Mesh2D ( const std::vector< SelfPoint > & vertexes,
const CellToVtxMapUncompressed & cell_vertices,
const MeshTag< 2, IndexType > & tags )
inlineexplicit

Constructs a mesh from vertices, an uncompressed cell-to-vertex map, and tags.

Parameters
vertexesA vector of 2D points representing the mesh vertices.
cell_verticesAn uncompressed map of cell vertices.
tagsA MeshTag object containing labels for mesh entities.

Member Function Documentation

◆ agglomerate()

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

Creates a new, coarser mesh by grouping cells together.

This method extends the base agglomeration by performing an extra step to fix the ordering of vertices and facets to ensure the new mesh follows the required CCW ordering conventions.

Parameters
old_to_new_cellA vector mapping each old cell to a new, larger cell ID.
Returns
A new Mesh2D object representing the agglomerated mesh.

◆ agglomerateBase()

Mesh2D< FloatType, IndexType > vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< 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, Mesh2D< 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, Mesh2D< FloatType, IndexType > >::buildCellToVtxAgglomeration ( const auto & new_to_old_cell,
const auto & old_to_new_vtx,
Mesh2D< 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, Mesh2D< 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.

◆ buildFacetToCellAndCellToFacetAndFacetToVertex()

template<typename FloatType, typename IndexType>
void vulpes::geometry::Mesh2D< FloatType, IndexType >::buildFacetToCellAndCellToFacetAndFacetToVertex ( )
protected

Builds the core connectivity maps relating facets (edges) to cells and vertices.

This setup function constructs the mesh's topology from the list of vertices that form each cell (m_cell_to_vtx). It simultaneously populates three data structures: m_facet_to_cell, m_cell_to_facet, and m_facet_to_vtx.

Note
This function is called internally by the mesh constructors. It requires the m_cell_to_vtx map to be correctly populated beforehand.

◆ buildFacetToCellAndFacetToVtxAgglomeration()

auto vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< FloatType, IndexType > >::buildFacetToCellAndFacetToVtxAgglomeration ( const std::vector< index_t > & new_to_old_facet,
const std::vector< index_t > & old_to_new_cell,
Mesh2D< 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, Mesh2D< 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.

◆ buildMesh()

template<typename FloatType, typename IndexType>
void vulpes::geometry::Mesh2D< FloatType, IndexType >::buildMesh ( )
inlineprotected

Builds all the necessary connectivity maps for the mesh.

This is a helper function called by the constructors to build the full mesh structure from the initial vertex and cell-to-vertex data.

◆ buildNewToOldFacetAgglomerationAndCellToFacet()

std::vector< index_t > vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< FloatType, IndexType > >::buildNewToOldFacetAgglomerationAndCellToFacet ( const auto & new_to_old_cell,
Mesh2D< 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, Mesh2D< FloatType, IndexType > >::buildVtxToCell ( )
protectedinherited

Builds the vertex-to-cell connectivity map.

Note
Requires the m_cell_to_vtx map to be already built.

◆ fixVertexAndFacetsOrders()

template<typename FloatType, typename IndexType>
void vulpes::geometry::Mesh2D< FloatType, IndexType >::fixVertexAndFacetsOrders ( )
protected

Enforces the CCW ordering conventions for the mesh.

After operations like agglomeration, the ordering of vertices within cells and facets might be incorrect. This function iterates through the mesh and reorders them to match the class's specified properties.

◆ getCellToFacetGlobalMap()

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

◆ getCellToFacetMap() [1/2]

CellToFacetMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< 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, Mesh2D< FloatType, IndexType > >::getCellToVtxGlobalMap ( ) const
inlineinherited

◆ getCellToVtxMap() [1/2]

CellToVtxMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< 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, Mesh2D< FloatType, IndexType > >::getDualGlobalMap ( ) const
inlineinherited

◆ getDualMap() [1/2]

DualMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< FloatType, IndexType > >::getDualMap ( ) const
inlineinherited

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

◆ getEntityToCellGlobalMap()

auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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::Mesh2D< FloatType, IndexType >::getEntityToCellMap ( ) const
inlineconstexpr

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

Template Parameters
dimThe dimension of the entity (0 for vertices, 1 for facets).
Returns
A constant reference to the requested map (e.g., vertex-to-cell).

◆ getFacetToCellGlobalMap()

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

◆ getFacetToCellMap() [1/2]

FacetToCellMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< 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, Mesh2D< FloatType, IndexType > >::getFacetToVtxGlobalMap ( ) const
inlineinherited

◆ getFacetToVtxMap() [1/2]

FacetToVtxMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< 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, Mesh2D< FloatType, IndexType > >::getMeshTags ( )
inlineinherited

Gets a modifiable reference to the mesh tags.

◆ getMeshTags() [2/2]

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

Gets a constant reference to the mesh tags.

◆ getMetadata() [1/2]

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

Gets a modifiable reference to the mesh metadata.

◆ getMetadata() [2/2]

const auto & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< 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, Mesh2D< FloatType, IndexType > >::getVertexes ( ) const
inlineinherited

Gets a constant reference to the vector of vertices.

◆ getVtxToCellGlobalMap()

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

◆ getVtxToCellMap() [1/2]

VtxToCellMap & vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< 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, Mesh2D< 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::Mesh2D< FloatType, IndexType >::nEntity ( std::size_t dim) const
inlineconstexpr

Returns the total number of entities of a given dimension.

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

◆ nLocEntity()

IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< 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, Mesh2D< 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, Mesh2D< 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, Mesh2D< 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, Mesh2D< 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::Mesh2D< FloatType, IndexType >::serialize ( Archive & ar,
const unsigned int  )
inline

Serializes the mesh data by calling the base class's serialization.

Parameters
arThe archive object to write to or read from.

◆ subMesh()

template<typename FloatType, typename IndexType>
Mesh2D< FloatType, IndexType > vulpes::geometry::Mesh2D< FloatType, IndexType >::subMesh ( const std::vector< IndexType > & cell_ids) const

Creates a new mesh from a subset of cells of the current mesh.

Parameters
cell_idsA vector of cell indices to include in the new mesh.
Returns
A new Mesh2D object containing only the specified cells.

◆ operator==

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

Checks if two 2D meshes are identical by comparing their base class data.

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

Member Data Documentation

◆ is_manifold

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

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

◆ m_cell_to_facet

CellToFacetMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< 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, Mesh2D< FloatType, IndexType > >::m_dual_graph
protectedinherited

Maps each cell to the list of its boundary facets.

◆ m_facet_to_cell

FacetToCellMap vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< 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, Mesh2D< FloatType, IndexType > >::m_mesh_tags
protectedinherited

Stores global metadata for the mesh.

◆ m_metadata

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

◆ m_vertexes

std::vector<SelfPoint> vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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, Mesh2D< FloatType, IndexType > >::m_vtx_to_cell
protectedinherited

Stores all tags associated with the mesh.

◆ outer_dim

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

The dimension of the embedding space.

◆ self_dim

IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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

template<typename FloatType, typename IndexType>
IndexType vulpes::geometry::Mesh2D< FloatType, IndexType >::UNDEF = static_cast<IndexType>(-1)
inlinestaticconstexpr

◆ vtx_per_face

IndexType vulpes::geometry::MeshBase< FloatType, IndexType, OuterDim, SelfDim, Mesh2D< 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: