CEPS  24.01
Cardiac ElectroPhysiology Simulator
GeometryReader Class Reference

Detailed Description

Regroups all geometrical data readers and prepare for partitionning.

This class eases the reading process by managing the readers.

A global ordering is followed for reading these files, as all the cells from all meshes are concatenated into a single structure:

Volumic are listed first, then surfacic, then cable. For each mesh, non-boundary cells are placed before boundary cells. For example, with 2 volumic meshes and 1 cable mesh:

  • mesh0 volumic non-boundary cells
  • mesh0 volumic boundary cells
  • mesh1 volumic non-boundary cells
  • mesh1 volumic boundary cells
  • mesh2 cable non-boundary cells
  • mesh2 cable boundary cells

This is the ordering that will be used by the partitioners, so understanding that is important.

Definition at line 82 of file GeometryReader.hpp.

#include <GeometryReader.hpp>

Public Member Functions

 GeometryReader (const CepsVector< CepsString > &volumicMeshes, const CepsVector< CepsString > &surfacicMeshes, const CepsVector< CepsString > &cableMeshes, const CepsString &coupledNodesFile="")
 Constructor. Actually runs the reading routines. More...
 
 ~GeometryReader ()
 Destructor. More...
 
void getCellOffsetsPerMeshType (CepsUInt cellOffsets[4])
 Fills array with cell offsets for each mesh type. More...
 
void getCellOffsetPerMesh (CepsVector< CepsUInt > &offsets)
 Fills vector with cell offset for each mesh. More...
 
void getNodeOffsetsPerMeshType (CepsUInt offsets[4])
 Fills array with node offsets for each mesh type. More...
 
void getNodeOffsetPerMesh (CepsVector< CepsUInt > &offsets)
 Fills vector with cell offset for each mesh. More...
 
CepsUInt getNbNodes ()
 All meshes number of nodes. More...
 
CepsUInt getNbCells ()
 All meshes number of cells. More...
 
CepsUInt getNbBdryCells ()
 All meshes number of boundary cells. More...
 
CepsUInt readNodes (CepsUInt indexStart, CepsUInt nbNodesToRead, CepsVector< CepsReal > &coords, CepsVector< CepsAttribute > &attr, CepsVector< CepsUInt > &attrOffset, CepsUInt &attrSize)
 Reads nbNodesToRead nodes, using global indices. More...
 
CepsUInt readCells (CepsUInt indexStart, CepsUInt nbCellsToRead, CepsVector< CepsNodeGlobalIndex > &nodeIndices, CepsVector< CepsUInt > &nodeIndicesOffset, CepsVector< CepsAttribute > &attr, CepsVector< CepsUInt > &attrOffset, CepsVector< CepsChar > &isBoundary, CepsUInt &eindSize, CepsUInt &attrSize)
 Reads nbCellsToRead cells, using global indices. More...
 
const CepsMultiMap< CepsNodeGlobalIndex, CepsNodeGlobalIndex > & getCoupledNodes ()
 Returns the hashtable of coupled nodes. More...
 

Protected Attributes

CepsUInt m_nbMeshes
 Number of meshes to read. More...
 
MeshReader ** m_readers
 Array (dimension x type) holding the readers on all meshes. More...
 
CepsVector< CepsStringm_meshFileNames
 File names of each mesh. More...
 
CepsUIntm_readerType
 Type of mesh being read. More...
 
CepsBool m_hasCoupledNodes
 Flag to activate coupled nodes. More...
 
CepsMultiMap< CepsNodeGlobalIndex, CepsNodeGlobalIndexm_coupledNodes
 Edges linking meshes. More...
 
CepsUIntm_meshNbNodes
 Number of nodes in each mesh. More...
 
CepsUIntm_nodeOffsets
 GeomNode offsets for each mesh. More...
 
CepsUIntm_meshNbCells
 Number of cells in each mesh. More...
 
CepsUIntm_meshNbBdryCells
 Number of boundary cells in each mesh. More...
 
CepsUIntm_cellOffsets
 Cell offsets for each mesh (bdry included) More...
 
CepsUInt m_totalNbNodes
 Total # of nodes across all meshes. More...
 
CepsUInt m_totalNbCells
 Total # of cells across all meshes. More...
 
CepsUInt m_totalNbBdryCells
 Total # of boundary cells across all meshes. More...
 

Private Member Functions

MeshReadergetMeshReaderFor (const CepsString &meshName, CepsInt index, CepsUInt dim)
 Initializes a mesh reader depending on the mesh file extension. More...
 
void initializeDataStructures ()
 Reads each mesh in order. More...
 
void readCoupledNodes (const CepsString &fileName)
 Get coupled nodes list using CoupledNodesReader. More...
 
CepsUInt computeNumberOfNodeIndices (CepsUInt nbCells[3], CepsUInt nbBoundary[3])
 Returns the number of nodes given numbers of cells and boundary cells. More...
 

Constructor & Destructor Documentation

◆ GeometryReader()

GeometryReader::GeometryReader ( const CepsVector< CepsString > &  volumicMeshes,
const CepsVector< CepsString > &  surfacicMeshes,
const CepsVector< CepsString > &  cableMeshes,
const CepsString coupledNodesFile = "" 
)

Constructor. Actually runs the reading routines.

nullptr value can be passed as argument if there are no such meshes.

Parameters
volumicMeshespointer on a vector holding the volumic meshes file names
surfacicMeshespointer on a vector holding the surfacic meshes file names
cableMeshespointer on a vector holding the cable meshes file names
[in]coupledNodesFilestring on file name of the connections file. empty string if no connections

Definition at line 33 of file GeometryReader.cpp.

◆ ~GeometryReader()

GeometryReader::~GeometryReader ( )

Destructor.

Definition at line 95 of file GeometryReader.cpp.

Member Function Documentation

◆ computeNumberOfNodeIndices()

CepsUInt GeometryReader::computeNumberOfNodeIndices ( CepsUInt  nbCells[3],
CepsUInt  nbBoundary[3] 
)
private

Returns the number of nodes given numbers of cells and boundary cells.

Definition at line 532 of file GeometryReader.cpp.

◆ getCellOffsetPerMesh()

void GeometryReader::getCellOffsetPerMesh ( CepsVector< CepsUInt > &  offsets)

Fills vector with cell offset for each mesh.

Definition at line 126 of file GeometryReader.cpp.

◆ getCellOffsetsPerMeshType()

void GeometryReader::getCellOffsetsPerMeshType ( CepsUInt  cellOffsets[4])

Fills array with cell offsets for each mesh type.

Definition at line 112 of file GeometryReader.cpp.

◆ getCoupledNodes()

const CepsMultiMap< CepsNodeGlobalIndex, CepsNodeGlobalIndex > & GeometryReader::getCoupledNodes ( )

Returns the hashtable of coupled nodes.

Definition at line 450 of file GeometryReader.cpp.

◆ getMeshReaderFor()

MeshReader * GeometryReader::getMeshReaderFor ( const CepsString meshName,
CepsInt  index,
CepsUInt  dim 
)
private

Initializes a mesh reader depending on the mesh file extension.

Given mesh name is path/baseName, without extension. Routine checks for meshName.pvtu (if VTK), meshName.vtk (if VTK), meshName.mesh, meshName.ele

Definition at line 456 of file GeometryReader.cpp.

◆ getNbBdryCells()

CepsUInt GeometryReader::getNbBdryCells ( )

All meshes number of boundary cells.

Definition at line 174 of file GeometryReader.cpp.

◆ getNbCells()

CepsUInt GeometryReader::getNbCells ( )

All meshes number of cells.

Definition at line 168 of file GeometryReader.cpp.

◆ getNbNodes()

CepsUInt GeometryReader::getNbNodes ( )

All meshes number of nodes.

Definition at line 162 of file GeometryReader.cpp.

◆ getNodeOffsetPerMesh()

void GeometryReader::getNodeOffsetPerMesh ( CepsVector< CepsUInt > &  offsets)

Fills vector with cell offset for each mesh.

Definition at line 152 of file GeometryReader.cpp.

◆ getNodeOffsetsPerMeshType()

void GeometryReader::getNodeOffsetsPerMeshType ( CepsUInt  offsets[4])

Fills array with node offsets for each mesh type.

Definition at line 139 of file GeometryReader.cpp.

◆ initializeDataStructures()

void GeometryReader::initializeDataStructures ( )
private

Reads each mesh in order.

Must be called prior to any other reading.

Sets the numbers of cells, boundary cells and nodes.

Definition at line 496 of file GeometryReader.cpp.

◆ readCells()

CepsUInt GeometryReader::readCells ( CepsUInt  indexStart,
CepsUInt  nbCellsToRead,
CepsVector< CepsNodeGlobalIndex > &  nodeIndices,
CepsVector< CepsUInt > &  nodeIndicesOffset,
CepsVector< CepsAttribute > &  attr,
CepsVector< CepsUInt > &  attrOffset,
CepsVector< CepsChar > &  isBoundary,
CepsUInt eindSize,
CepsUInt attrSize 
)

Reads nbCellsToRead cells, using global indices.

Parameters
[in]indexStartstart index of cells to read
[in]nbCellsToReadthe number of cells to read
[out]nodeIndicesarray that will hold the node indices of each cell
[out]nodeIndicesOffsetoffsets in nodeIndices array for each cell
[out]attrarray that will hold the cell attributes for each cell.
[out]attrOffsetarray that references the offset for each cell in attr.
[out]isBoundaryarray indicating if one cell is a boundary or not
[out]eindSizethe total size of eind array
[out]attrSizethe total size of attr array

Definition at line 288 of file GeometryReader.cpp.

◆ readCoupledNodes()

void GeometryReader::readCoupledNodes ( const CepsString fileName)
private

Get coupled nodes list using CoupledNodesReader.

Definition at line 512 of file GeometryReader.cpp.

◆ readNodes()

CepsUInt GeometryReader::readNodes ( CepsUInt  indexStart,
CepsUInt  nbNodesToRead,
CepsVector< CepsReal > &  coords,
CepsVector< CepsAttribute > &  attr,
CepsVector< CepsUInt > &  attrOffset,
CepsUInt attrSize 
)

Reads nbNodesToRead nodes, using global indices.

Parameters
[in]indexStartstart index of node to read
[in]nbNodesToReadthe number of nodes to read
[out]coordsarray that will hold the node coordinates.
[out]attrarray that will hold the node attributes for each node.
[out]attrOffsetarray that references the offset for each node in attr.
[out]attrSizeattr array size

Definition at line 180 of file GeometryReader.cpp.

Field Documentation

◆ m_cellOffsets

CepsUInt* GeometryReader::m_cellOffsets
protected

Cell offsets for each mesh (bdry included)

Definition at line 233 of file GeometryReader.hpp.

◆ m_coupledNodes

CepsMultiMap<CepsNodeGlobalIndex, CepsNodeGlobalIndex> GeometryReader::m_coupledNodes
protected

Edges linking meshes.

Definition at line 226 of file GeometryReader.hpp.

◆ m_hasCoupledNodes

CepsBool GeometryReader::m_hasCoupledNodes
protected

Flag to activate coupled nodes.

Definition at line 225 of file GeometryReader.hpp.

◆ m_meshFileNames

CepsVector<CepsString> GeometryReader::m_meshFileNames
protected

File names of each mesh.

Definition at line 221 of file GeometryReader.hpp.

◆ m_meshNbBdryCells

CepsUInt* GeometryReader::m_meshNbBdryCells
protected

Number of boundary cells in each mesh.

Definition at line 232 of file GeometryReader.hpp.

◆ m_meshNbCells

CepsUInt* GeometryReader::m_meshNbCells
protected

Number of cells in each mesh.

Definition at line 231 of file GeometryReader.hpp.

◆ m_meshNbNodes

CepsUInt* GeometryReader::m_meshNbNodes
protected

Number of nodes in each mesh.

Definition at line 229 of file GeometryReader.hpp.

◆ m_nbMeshes

CepsUInt GeometryReader::m_nbMeshes
protected

Number of meshes to read.

Definition at line 217 of file GeometryReader.hpp.

◆ m_nodeOffsets

CepsUInt* GeometryReader::m_nodeOffsets
protected

GeomNode offsets for each mesh.

Definition at line 230 of file GeometryReader.hpp.

◆ m_readers

MeshReader** GeometryReader::m_readers
protected

Array (dimension x type) holding the readers on all meshes.

Definition at line 220 of file GeometryReader.hpp.

◆ m_readerType

CepsUInt* GeometryReader::m_readerType
protected

Type of mesh being read.

Definition at line 222 of file GeometryReader.hpp.

◆ m_totalNbBdryCells

CepsUInt GeometryReader::m_totalNbBdryCells
protected

Total # of boundary cells across all meshes.

Definition at line 238 of file GeometryReader.hpp.

◆ m_totalNbCells

CepsUInt GeometryReader::m_totalNbCells
protected

Total # of cells across all meshes.

Definition at line 237 of file GeometryReader.hpp.

◆ m_totalNbNodes

CepsUInt GeometryReader::m_totalNbNodes
protected

Total # of nodes across all meshes.

Definition at line 236 of file GeometryReader.hpp.


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