CEPS  24.01
Cardiac ElectroPhysiology Simulator
Mesh Class Reference

Detailed Description

Geometrical information of 1,2 or 3D distributed cells.

A mesh holds geometrical data distributed on the different process. Each process has a part of the global mesh data.

Templated on _Dim, which refers to the dimension of the mesh: volumes (3), surfaces (2) or cables (1).

Cells are separated between regular cells and boundary cells of dimension _Dim-1.

Nodes are separated between owned nodes (local to the process) and halo nodes (shared by one or more other processes). Same goes with cells, which can be shared or not. Ownership of cells is determined by the ownership of the first node of the cell's nodes list.

Definition at line 56 of file Mesh.hpp.

#include <Mesh.hpp>

Public Member Functions

 Mesh (CepsUInt dim)
 Default constructor. More...
 
 ~Mesh ()
 Destructor. More...
 
CepsUInt getDimension () const
 Geometrical dimension. More...
 
void addCell (GeomCell *cell)
 Add an cell to the mesh. More...
 
void addBoundaryCell (GeomCell *boundaryCell)
 Add a boundary cell to the mesh. More...
 
void addNode (GeomNode *node)
 Add a node to the mesh. More...
 
void addHaloNode (GeomNode *node)
 Add a halo node to the mesh. More...
 
void refreshCells ()
 Forces re-evaluation of each cell structure (boundary elmts included). More...
 
void setNbCells (CepsUInt n)
 Set the total number of cells of this mesh. More...
 
void setNbBoundaryCells (CepsUInt n)
 Set the total number of boundary cells of this mesh. More...
 
void setNbNodes (CepsUInt n)
 Set the total number of nodes of this mesh. More...
 
GeomNodegetNode (CepsNodeGlobalIndex globalIndex) const
 Get node referenced by global index. More...
 
GeomNodegetHaloNode (CepsNodeGlobalIndex geomIndex) const
 Get node referenced by geom index. More...
 
GeomNodegetNodeOrHaloNode (CepsNodeGlobalIndex geomIndex) const
 Get node referenced by geom index. More...
 
CepsInt getLocalIndexOfCell (CepsCellGlobalIndex geomIndex) const
 Geom global to local mapping for cells. More...
 
CepsInt getLocalIndexOfBoundaryCell (CepsCellGlobalIndex geomIndex) const
 Geom global to local mapping for boundary cells. More...
 
GeomCellgetCell (CepsCellGlobalIndex geomIndex) const
 pointer on requested cell, nullptr if not owned More...
 
GeomCellgetBoundaryCell (CepsCellGlobalIndex geomIndex) const
 pointer on requested boundary cell, nullptr if not owned More...
 
const CepsVector< GeomCell * > & getCells ()
 CepsVector of cells stored on this process. More...
 
const CepsVector< GeomCell * > & getBoundaryCells ()
 CepsVector of boundary cells stored on this process. More...
 
const CepsVector< GeomNode * > & getOwnedNodes ()
 CepsVector of local nodes stored on this process. More...
 
const CepsVector< GeomNode * > & getHaloNodes ()
 CepsVector of halo nodes stored on this process. More...
 
CepsUInt getNbCells () const
 Total number of non-boundary cells of the mesh. More...
 
CepsUInt getNbBoundaryCells () const
 Total number of boundary cells of the mesh. More...
 
CepsUInt getNbNodes () const
 Total number of nodes of the mesh. More...
 
CepsUInt getLocalNbCells () const
 Number of non-boundary cells stored on this process. More...
 
CepsUInt getLocalNbBoundaryCells () const
 Number of boundary cells stored on this process. More...
 
CepsUInt getLocalNbNodes () const
 Number of nodes stored on this process. More...
 
CepsUInt getLocalNbHaloNodes () const
 Number of halo nodes stored on this process. More...
 
CepsUInt getMaxNodeConnectivity ()
 Local maximum node connectivity (nb of adjacent nodes) More...
 
CepsReal getMaxCellDiameter () const
 Maximum size of cells. More...
 
void setGeometry (Geometry *geom)
 Link geometry. More...
 
GeometrygetGeometry () const
 Geometry this mesh is tied too. More...
 
void scale (CepsReal scaleFactor)
 Each node coordinate is scaled by scaleFactor. More...
 

Protected Member Functions

CepsUInt computeMaxNodeConnectivity ()
 Locally computes the maximum node connectivity (nb of adjacent nodes) More...
 
CepsHash getNodeHash (GeomNode *n)
 gets an identifier for the node (here its global index) More...
 
CepsHash getCellHash (GeomCell *c)
 gets an identifier for the node, (here its global index) More...
 

Protected Attributes

CepsUInt m_dim
 Dimension of the cells. More...
 
Geometrym_geom
 Link to geometry. More...
 
CepsUInt m_nbCells
 whole mesh cells count More...
 
CepsUInt m_nbBoundaryCells
 whole mesh boundary cells count More...
 
CepsUInt m_nbNodes
 whole mesh nodes count More...
 
CepsBool m_connectivityComputed
 computation flag More...
 
CepsReal m_maxCellDiameter
 Largest cell size. More...
 
LocalGlobalMapping< GeomCell * > m_cells
 Cells of main dimension. More...
 
LocalGlobalMapping< GeomCell * > m_bCells
 Boundary cells (dim-1) More...
 
LocalGlobalMapping< GeomNode * > m_ownedNodes
 Nodes of that proc. More...
 
LocalGlobalMapping< GeomNode * > m_haloNodes
 Nodes in halo. More...
 
CepsUInt m_maxNodeConnectivity
 maximum nb adjacent nodes. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Mesh &m)
 Displays some info on the mesh. More...
 

Constructor & Destructor Documentation

◆ Mesh()

Mesh::Mesh ( CepsUInt  dim)
explicit

Default constructor.

Definition at line 33 of file Mesh.cpp.

◆ ~Mesh()

Mesh::~Mesh ( )

Destructor.

Definition at line 45 of file Mesh.cpp.

Member Function Documentation

◆ addBoundaryCell()

void Mesh::addBoundaryCell ( GeomCell boundaryCell)

Add a boundary cell to the mesh.

Definition at line 87 of file Mesh.cpp.

◆ addCell()

void Mesh::addCell ( GeomCell cell)

Add an cell to the mesh.

Definition at line 65 of file Mesh.cpp.

◆ addHaloNode()

void Mesh::addHaloNode ( GeomNode node)

Add a halo node to the mesh.

Definition at line 120 of file Mesh.cpp.

◆ addNode()

void Mesh::addNode ( GeomNode node)

Add a node to the mesh.

Definition at line 106 of file Mesh.cpp.

◆ computeMaxNodeConnectivity()

CepsUInt Mesh::computeMaxNodeConnectivity ( )
protected

Locally computes the maximum node connectivity (nb of adjacent nodes)

Definition at line 319 of file Mesh.cpp.

◆ getBoundaryCell()

GeomCell * Mesh::getBoundaryCell ( CepsCellGlobalIndex  geomIndex) const

pointer on requested boundary cell, nullptr if not owned

Definition at line 198 of file Mesh.cpp.

◆ getBoundaryCells()

const CepsVector< GeomCell * > & Mesh::getBoundaryCells ( )

CepsVector of boundary cells stored on this process.

Definition at line 210 of file Mesh.cpp.

◆ getCell()

GeomCell * Mesh::getCell ( CepsCellGlobalIndex  geomIndex) const

pointer on requested cell, nullptr if not owned

Definition at line 192 of file Mesh.cpp.

◆ getCellHash()

CepsHash Mesh::getCellHash ( GeomCell c)
protected

gets an identifier for the node, (here its global index)

Definition at line 313 of file Mesh.cpp.

◆ getCells()

const CepsVector< GeomCell * > & Mesh::getCells ( )

CepsVector of cells stored on this process.

Definition at line 204 of file Mesh.cpp.

◆ getDimension()

CepsUInt Mesh::getDimension ( ) const

Geometrical dimension.

Definition at line 59 of file Mesh.cpp.

◆ getGeometry()

Geometry * Mesh::getGeometry ( ) const

Geometry this mesh is tied too.

Definition at line 290 of file Mesh.cpp.

◆ getHaloNode()

GeomNode * Mesh::getHaloNode ( CepsNodeGlobalIndex  geomIndex) const

Get node referenced by geom index.

Returns
nullptr if calling process does not have the node as a halo node.

Definition at line 168 of file Mesh.cpp.

◆ getHaloNodes()

const CepsVector< GeomNode * > & Mesh::getHaloNodes ( )

CepsVector of halo nodes stored on this process.

Definition at line 222 of file Mesh.cpp.

◆ getLocalIndexOfBoundaryCell()

CepsInt Mesh::getLocalIndexOfBoundaryCell ( CepsCellGlobalIndex  geomIndex) const

Geom global to local mapping for boundary cells.

Returns
-1 if not found

Definition at line 186 of file Mesh.cpp.

◆ getLocalIndexOfCell()

CepsInt Mesh::getLocalIndexOfCell ( CepsCellGlobalIndex  geomIndex) const

Geom global to local mapping for cells.

Returns
-1 if not found

Definition at line 180 of file Mesh.cpp.

◆ getLocalNbBoundaryCells()

CepsUInt Mesh::getLocalNbBoundaryCells ( ) const

Number of boundary cells stored on this process.

Definition at line 252 of file Mesh.cpp.

◆ getLocalNbCells()

CepsUInt Mesh::getLocalNbCells ( ) const

Number of non-boundary cells stored on this process.

Definition at line 246 of file Mesh.cpp.

◆ getLocalNbHaloNodes()

CepsUInt Mesh::getLocalNbHaloNodes ( ) const

Number of halo nodes stored on this process.

Definition at line 264 of file Mesh.cpp.

◆ getLocalNbNodes()

CepsUInt Mesh::getLocalNbNodes ( ) const

Number of nodes stored on this process.

Definition at line 258 of file Mesh.cpp.

◆ getMaxCellDiameter()

CepsReal Mesh::getMaxCellDiameter ( ) const

Maximum size of cells.

Definition at line 278 of file Mesh.cpp.

◆ getMaxNodeConnectivity()

CepsUInt Mesh::getMaxNodeConnectivity ( )

Local maximum node connectivity (nb of adjacent nodes)

Definition at line 270 of file Mesh.cpp.

◆ getNbBoundaryCells()

CepsUInt Mesh::getNbBoundaryCells ( ) const

Total number of boundary cells of the mesh.

Definition at line 234 of file Mesh.cpp.

◆ getNbCells()

CepsUInt Mesh::getNbCells ( ) const

Total number of non-boundary cells of the mesh.

Definition at line 228 of file Mesh.cpp.

◆ getNbNodes()

CepsUInt Mesh::getNbNodes ( ) const

Total number of nodes of the mesh.

Definition at line 240 of file Mesh.cpp.

◆ getNode()

GeomNode * Mesh::getNode ( CepsNodeGlobalIndex  globalIndex) const

Get node referenced by global index.

Returns
nullptr if calling process does not own the node.

Definition at line 162 of file Mesh.cpp.

◆ getNodeHash()

CepsHash Mesh::getNodeHash ( GeomNode n)
protected

gets an identifier for the node (here its global index)

Definition at line 307 of file Mesh.cpp.

◆ getNodeOrHaloNode()

GeomNode * Mesh::getNodeOrHaloNode ( CepsNodeGlobalIndex  geomIndex) const

Get node referenced by geom index.

Returns
nullptr if calling process does not have the node

Definition at line 174 of file Mesh.cpp.

◆ getOwnedNodes()

const CepsVector< GeomNode * > & Mesh::getOwnedNodes ( )

CepsVector of local nodes stored on this process.

Definition at line 216 of file Mesh.cpp.

◆ refreshCells()

void Mesh::refreshCells ( )

Forces re-evaluation of each cell structure (boundary elmts included).

Definition at line 135 of file Mesh.cpp.

◆ scale()

void Mesh::scale ( CepsReal  scaleFactor)

Each node coordinate is scaled by scaleFactor.

Definition at line 296 of file Mesh.cpp.

◆ setGeometry()

void Mesh::setGeometry ( Geometry geom)

Link geometry.

Definition at line 284 of file Mesh.cpp.

◆ setNbBoundaryCells()

void Mesh::setNbBoundaryCells ( CepsUInt  n)

Set the total number of boundary cells of this mesh.

This should be the same across all processes. The mesh reader is supposed to give us the correct amount of cells.

Definition at line 151 of file Mesh.cpp.

◆ setNbCells()

void Mesh::setNbCells ( CepsUInt  n)

Set the total number of cells of this mesh.

This should be the same across all processes. The mesh reader is supposed to give us the correct amount of cells.

Definition at line 145 of file Mesh.cpp.

◆ setNbNodes()

void Mesh::setNbNodes ( CepsUInt  n)

Set the total number of nodes of this mesh.

This should be the same across all processes.

Definition at line 156 of file Mesh.cpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Mesh m 
)
friend

Displays some info on the mesh.

Definition at line 333 of file Mesh.cpp.

Field Documentation

◆ m_bCells

LocalGlobalMapping<GeomCell*> Mesh::m_bCells
protected

Boundary cells (dim-1)

Definition at line 258 of file Mesh.hpp.

◆ m_cells

LocalGlobalMapping<GeomCell*> Mesh::m_cells
protected

Cells of main dimension.

Definition at line 257 of file Mesh.hpp.

◆ m_connectivityComputed

CepsBool Mesh::m_connectivityComputed
protected

computation flag

Definition at line 249 of file Mesh.hpp.

◆ m_dim

CepsUInt Mesh::m_dim
protected

Dimension of the cells.

Definition at line 243 of file Mesh.hpp.

◆ m_geom

Geometry* Mesh::m_geom
protected

Link to geometry.

Definition at line 245 of file Mesh.hpp.

◆ m_haloNodes

LocalGlobalMapping<GeomNode*> Mesh::m_haloNodes
protected

Nodes in halo.

Definition at line 260 of file Mesh.hpp.

◆ m_maxCellDiameter

CepsReal Mesh::m_maxCellDiameter
protected

Largest cell size.

Definition at line 250 of file Mesh.hpp.

◆ m_maxNodeConnectivity

CepsUInt Mesh::m_maxNodeConnectivity
protected

maximum nb adjacent nodes.

Definition at line 262 of file Mesh.hpp.

◆ m_nbBoundaryCells

CepsUInt Mesh::m_nbBoundaryCells
protected

whole mesh boundary cells count

Definition at line 247 of file Mesh.hpp.

◆ m_nbCells

CepsUInt Mesh::m_nbCells
protected

whole mesh cells count

Definition at line 246 of file Mesh.hpp.

◆ m_nbNodes

CepsUInt Mesh::m_nbNodes
protected

whole mesh nodes count

Definition at line 248 of file Mesh.hpp.

◆ m_ownedNodes

LocalGlobalMapping<GeomNode*> Mesh::m_ownedNodes
protected

Nodes of that proc.

Definition at line 259 of file Mesh.hpp.


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