CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
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:
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< CepsString > | m_meshFileNames |
File names of each mesh. More... | |
CepsUInt * | m_readerType |
Type of mesh being read. More... | |
CepsBool | m_hasCoupledNodes |
Flag to activate coupled nodes. More... | |
CepsMultiMap< CepsNodeGlobalIndex, CepsNodeGlobalIndex > | m_coupledNodes |
Edges linking meshes. More... | |
CepsUInt * | m_meshNbNodes |
Number of nodes in each mesh. More... | |
CepsUInt * | m_nodeOffsets |
GeomNode offsets for each mesh. More... | |
CepsUInt * | m_meshNbCells |
Number of cells in each mesh. More... | |
CepsUInt * | m_meshNbBdryCells |
Number of boundary cells in each mesh. More... | |
CepsUInt * | m_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 | |
MeshReader * | getMeshReaderFor (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... | |
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.
volumicMeshes | pointer on a vector holding the volumic meshes file names | |
surfacicMeshes | pointer on a vector holding the surfacic meshes file names | |
cableMeshes | pointer on a vector holding the cable meshes file names | |
[in] | coupledNodesFile | string on file name of the connections file. empty string if no connections |
Definition at line 33 of file GeometryReader.cpp.
GeometryReader::~GeometryReader | ( | ) |
Destructor.
Definition at line 95 of file GeometryReader.cpp.
|
private |
Returns the number of nodes given numbers of cells and boundary cells.
Definition at line 532 of file GeometryReader.cpp.
void GeometryReader::getCellOffsetPerMesh | ( | CepsVector< CepsUInt > & | offsets | ) |
Fills vector with cell offset for each mesh.
Definition at line 126 of file GeometryReader.cpp.
void GeometryReader::getCellOffsetsPerMeshType | ( | CepsUInt | cellOffsets[4] | ) |
Fills array with cell offsets for each mesh type.
Definition at line 112 of file GeometryReader.cpp.
const CepsMultiMap< CepsNodeGlobalIndex, CepsNodeGlobalIndex > & GeometryReader::getCoupledNodes | ( | ) |
Returns the hashtable of coupled nodes.
Definition at line 450 of file GeometryReader.cpp.
|
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.
CepsUInt GeometryReader::getNbBdryCells | ( | ) |
All meshes number of boundary cells.
Definition at line 174 of file GeometryReader.cpp.
CepsUInt GeometryReader::getNbCells | ( | ) |
All meshes number of cells.
Definition at line 168 of file GeometryReader.cpp.
CepsUInt GeometryReader::getNbNodes | ( | ) |
All meshes number of nodes.
Definition at line 162 of file GeometryReader.cpp.
void GeometryReader::getNodeOffsetPerMesh | ( | CepsVector< CepsUInt > & | offsets | ) |
Fills vector with cell offset for each mesh.
Definition at line 152 of file GeometryReader.cpp.
void GeometryReader::getNodeOffsetsPerMeshType | ( | CepsUInt | offsets[4] | ) |
Fills array with node offsets for each mesh type.
Definition at line 139 of file GeometryReader.cpp.
|
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.
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.
[in] | indexStart | start index of cells to read |
[in] | nbCellsToRead | the number of cells to read |
[out] | nodeIndices | array that will hold the node indices of each cell |
[out] | nodeIndicesOffset | offsets in nodeIndices array for each cell |
[out] | attr | array that will hold the cell attributes for each cell. |
[out] | attrOffset | array that references the offset for each cell in attr. |
[out] | isBoundary | array indicating if one cell is a boundary or not |
[out] | eindSize | the total size of eind array |
[out] | attrSize | the total size of attr array |
Definition at line 288 of file GeometryReader.cpp.
|
private |
Get coupled nodes list using CoupledNodesReader.
Definition at line 512 of file GeometryReader.cpp.
CepsUInt GeometryReader::readNodes | ( | CepsUInt | indexStart, |
CepsUInt | nbNodesToRead, | ||
CepsVector< CepsReal > & | coords, | ||
CepsVector< CepsAttribute > & | attr, | ||
CepsVector< CepsUInt > & | attrOffset, | ||
CepsUInt & | attrSize | ||
) |
Reads nbNodesToRead nodes, using global indices.
[in] | indexStart | start index of node to read |
[in] | nbNodesToRead | the number of nodes to read |
[out] | coords | array that will hold the node coordinates. |
[out] | attr | array that will hold the node attributes for each node. |
[out] | attrOffset | array that references the offset for each node in attr. |
[out] | attrSize | attr array size |
Definition at line 180 of file GeometryReader.cpp.
|
protected |
Cell offsets for each mesh (bdry included)
Definition at line 233 of file GeometryReader.hpp.
|
protected |
Edges linking meshes.
Definition at line 226 of file GeometryReader.hpp.
|
protected |
Flag to activate coupled nodes.
Definition at line 225 of file GeometryReader.hpp.
|
protected |
File names of each mesh.
Definition at line 221 of file GeometryReader.hpp.
|
protected |
Number of boundary cells in each mesh.
Definition at line 232 of file GeometryReader.hpp.
|
protected |
Number of cells in each mesh.
Definition at line 231 of file GeometryReader.hpp.
|
protected |
Number of nodes in each mesh.
Definition at line 229 of file GeometryReader.hpp.
|
protected |
Number of meshes to read.
Definition at line 217 of file GeometryReader.hpp.
|
protected |
GeomNode offsets for each mesh.
Definition at line 230 of file GeometryReader.hpp.
|
protected |
Array (dimension x type) holding the readers on all meshes.
Definition at line 220 of file GeometryReader.hpp.
|
protected |
Type of mesh being read.
Definition at line 222 of file GeometryReader.hpp.
|
protected |
Total # of boundary cells across all meshes.
Definition at line 238 of file GeometryReader.hpp.
|
protected |
Total # of cells across all meshes.
Definition at line 237 of file GeometryReader.hpp.
|
protected |
Total # of nodes across all meshes.
Definition at line 236 of file GeometryReader.hpp.