37 m_nbBoundaryCells (0),
39 m_connectivityComputed (false),
40 m_maxCellDiameter (0.e0),
41 m_maxNodeConnectivity (0)
69 "trying to add a cell of dimension " << c->
getDimension()
70 <<
"\nin a mesh of dimension " <<
m_dim
75 "Cell #" << cID <<
" was already added to the mesh"
91 "trying to add a cell of dimension " << c->
getDimension ()
92 <<
"\nin a mesh of dimension " <<
m_dim
97 "Cell #" << cID <<
" was already added to the mesh"
111 "trying to add node " << nID <<
" that is already added to the mesh"
123 "adding a nullptr node to the mesh"
127 "trying to add node " << nID <<
" that is already added to the mesh"
140 boundaryCell->refresh();
299 node->scale(scaleFactor);
301 node->scale(scaleFactor);
340 os << el->getGlobalIndex () <<
" - nodes : ";
342 os << node->getGlobalIndex () <<
" ";
347 os <<
"Boundary Cells: #" << m.
m_bCells.
size() << std::endl;
350 os << el->getGlobalIndex() <<
" - nodes : ";
352 os << node->getGlobalIndex() <<
" ";
360 os << node->getGlobalIndex() <<
" - coordinates : " << *node << std::endl;
364 os << node->getGlobalIndex() <<
" - coordinates : " << *node << std::endl;
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
#define CEPS_STRING_SEPARATOR
CepsString used as separator.
CepsGlobalIndex CepsCellGlobalIndex
Indices of cells.
CepsSize CepsHash
Hashes for distributed data.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
float CepsReal
Need single precision floating point.
CepsGlobalIndex CepsNodeGlobalIndex
Indices of nodes.
int32_t CepsInt
Need 32 bit integer.
std::ostream & operator<<(std::ostream &os, const Mesh &m)
Displays some info on the mesh.
Abstract class for geometrical cell. On top of index and attributes managament, the cell has informat...
CepsReal getDiameter()
Size of cell.
Base class for nodes used in meshes.
Encapsulates all the geometrical data.
CepsUInt size() const
Number of elements.
const CepsVector< _Type > & all() const
access to data
const CepsLocalIndex & globalToLocal(const CepsGlobalIndex &gId) const
Global index to local index conversion.
_Type & atGlobal(const CepsGlobalIndex &gId, const _Type &def)
Access value with global ID, with default value.
void destroyObjects()
Wipes content, keeps structure.
CepsBool hasGlobal(const CepsGlobalIndex &gId) const
Tells if item with global index gID can be found on this CPU.
void append(const _Type &x, const _Hash &hashValue)
Emplace an element in the map.
Geometrical information of 1,2 or 3D distributed cells.
CepsReal m_maxCellDiameter
Largest cell size.
void addBoundaryCell(GeomCell *boundaryCell)
Add a boundary cell to the mesh.
CepsInt getLocalIndexOfBoundaryCell(CepsCellGlobalIndex geomIndex) const
Geom global to local mapping for boundary cells.
const CepsVector< GeomNode * > & getOwnedNodes()
CepsVector of local nodes stored on this process.
CepsUInt getNbBoundaryCells() const
Total number of boundary cells of the mesh.
CepsUInt getMaxNodeConnectivity()
Local maximum node connectivity (nb of adjacent nodes)
CepsUInt m_nbNodes
whole mesh nodes count
CepsUInt computeMaxNodeConnectivity()
Locally computes the maximum node connectivity (nb of adjacent nodes)
LocalGlobalMapping< GeomNode * > m_haloNodes
Nodes in halo.
CepsUInt getLocalNbCells() const
Number of non-boundary cells stored on this process.
void addHaloNode(GeomNode *node)
Add a halo node to the mesh.
void refreshCells()
Forces re-evaluation of each cell structure (boundary elmts included).
CepsHash getNodeHash(GeomNode *n)
gets an identifier for the node (here its global index)
CepsUInt getNbNodes() const
Total number of nodes of the mesh.
CepsBool m_connectivityComputed
computation flag
CepsUInt getDimension() const
Geometrical dimension.
void setNbCells(CepsUInt n)
Set the total number of cells of this mesh.
void setNbNodes(CepsUInt n)
Set the total number of nodes of this mesh.
GeomNode * getHaloNode(CepsNodeGlobalIndex geomIndex) const
Get node referenced by geom index.
Geometry * getGeometry() const
Geometry this mesh is tied too.
LocalGlobalMapping< GeomCell * > m_bCells
Boundary cells (dim-1)
void scale(CepsReal scaleFactor)
Each node coordinate is scaled by scaleFactor.
const CepsVector< GeomCell * > & getCells()
CepsVector of cells stored on this process.
const CepsVector< GeomNode * > & getHaloNodes()
CepsVector of halo nodes stored on this process.
Mesh(CepsUInt dim)
Default constructor.
CepsUInt m_maxNodeConnectivity
maximum nb adjacent nodes.
CepsUInt getNbCells() const
Total number of non-boundary cells of the mesh.
void addNode(GeomNode *node)
Add a node to the mesh.
void addCell(GeomCell *cell)
Add an cell to the mesh.
CepsHash getCellHash(GeomCell *c)
gets an identifier for the node, (here its global index)
CepsReal getMaxCellDiameter() const
Maximum size of cells.
CepsUInt getLocalNbNodes() const
Number of nodes stored on this process.
Geometry * m_geom
Link to geometry.
CepsUInt getLocalNbBoundaryCells() const
Number of boundary cells stored on this process.
void setGeometry(Geometry *geom)
Link geometry.
GeomCell * getCell(CepsCellGlobalIndex geomIndex) const
pointer on requested cell, nullptr if not owned
LocalGlobalMapping< GeomNode * > m_ownedNodes
Nodes of that proc.
GeomCell * getBoundaryCell(CepsCellGlobalIndex geomIndex) const
pointer on requested boundary cell, nullptr if not owned
CepsUInt getLocalNbHaloNodes() const
Number of halo nodes stored on this process.
GeomNode * getNodeOrHaloNode(CepsNodeGlobalIndex geomIndex) const
Get node referenced by geom index.
CepsUInt m_dim
Dimension of the cells.
void setNbBoundaryCells(CepsUInt n)
Set the total number of boundary cells of this mesh.
CepsUInt m_nbCells
whole mesh cells count
CepsUInt m_nbBoundaryCells
whole mesh boundary cells count
GeomNode * getNode(CepsNodeGlobalIndex globalIndex) const
Get node referenced by global index.
const CepsVector< GeomCell * > & getBoundaryCells()
CepsVector of boundary cells stored on this process.
LocalGlobalMapping< GeomCell * > m_cells
Cells of main dimension.
CepsInt getLocalIndexOfCell(CepsCellGlobalIndex geomIndex) const
Geom global to local mapping for cells.
const CepsUInt & getDimension() const
Get the dimension of the object.
const CepsGlobalIndex & getGlobalIndex() const
Get the index
CepsVector< NodeType * > & getNodes()
Reference to the node pointers array.
const _Type & max(const CepsVector< _Type, _Alloc > &vec)
Returns the maximum of the vector, const version.
void destroyObject(_Type &)
Destroy[delete] any type.