CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
Abstract base class that encapsulates primary functionalities of each mesh reader.
The pure virtual functions (that must be defined by child class) will do the actual parsing.
Definition at line 41 of file MeshReader.hpp.
#include <MeshReader.hpp>
Public Member Functions | |
MeshReader ()=delete | |
Deleted default constructor. More... | |
MeshReader (const CepsString &mesh, const CepsUInt &dim, CepsBool quads=false) | |
Constructor with full file name, and intended dimension of mesh. More... | |
~MeshReader () override | |
Destructor. More... | |
CepsUInt | getNbCellsRead () const |
Number of cells that have been read until now. More... | |
CepsUInt | getNbBdryCellsRead () const |
Number of boundary cells that have been read. More... | |
CepsUInt | getNbNodes () const |
Number of nodes of current mesh. More... | |
CepsUInt | getNbCells () const |
Number of cell of current mesh. More... | |
CepsUInt | getNbBdryCells () const |
Number of boundary cell of current mesh. More... | |
virtual CepsInt | getNbAttributesPerNode () const |
Number of attributes per node. More... | |
virtual CepsInt | getNbAttributesPerCell () const |
Number of attributes per cell. More... | |
virtual CepsInt | getNbAttributesPerBdryCell () const |
Number of attributes per boundary cell. More... | |
virtual void | initialize ()=0 |
The routine MUST set the number of nodes and cells. More... | |
virtual void | readNodes (CepsUInt indexStart, CepsUInt indexEnd, CepsUInt nodeOffset, CepsVector< CepsReal > &coords, CepsVector< CepsAttribute > &attr, CepsVector< CepsUInt > &attrPtr)=0 |
Reads several nodes in mesh file. More... | |
virtual void | readCells (CepsUInt indexStart, CepsUInt indexEnd, CepsUInt nodeOffset, CepsUInt cellOffset, CepsVector< CepsNodeGlobalIndex > &nodeIndices, CepsVector< CepsUInt > &nodeIndicesPtr, CepsVector< CepsAttribute > &cellAttr, CepsVector< CepsUInt > &cellAttrPtr, CepsVector< CepsChar > &isBoundaryCell)=0 |
Reads several cells in mesh file. More... | |
Public Member Functions inherited from FileReader | |
FileReader () | |
Alternative constructor. More... | |
FileReader (const CepsString &fileName) | |
Default constructor. More... | |
FileReader (const FileReader &that) | |
Copy constructor. More... | |
FileReader & | operator= (const FileReader &that) |
Copy constructor. More... | |
virtual | ~FileReader () |
Destructor. Calls FileReader::close. More... | |
void | setFileName (const CepsString &fileName) |
Set file to read. More... | |
virtual CepsBool | open () |
Opens the designated file in read mode. More... | |
virtual void | close () |
Close the file. More... | |
virtual CepsBool | good () |
true if stream is still readable More... | |
void | reset () |
Set file stream to the beginning of the file. More... | |
CepsUInt | find (const CepsString &pattern) |
Advance stream until pattern is found. More... | |
CepsBool | findNext (const CepsString &pattern) |
Advance stream until pattern is found. More... | |
CepsUInt | findNextOf (const CepsVector< CepsString > &patterns) |
Advance stream until one of patterns is found. More... | |
CepsString | getFileName () |
Name of parsed file. More... | |
CepsUInt | skipLines (CepsUInt nbLines) |
Skip given number of lines. More... | |
void | oneLine (CepsString &line) |
Get one line from the stream. More... | |
template<typename T > | |
FileReader & | operator>> (T &var) |
Reading operator. More... | |
CepsInt | lineIndex (const CepsString &word) |
Index of first line starting with word, search starting from the current stream position. More... | |
CepsUInt | checkEOF () |
Checks if the reader reached end of file. More... | |
Protected Member Functions | |
virtual void | getNextCell (CepsUInt cellId, CepsUInt fileCellId, CepsUInt nodeOffset, CepsVector< CepsNodeGlobalIndex > &nodeIndices, CepsVector< CepsUInt > &nodeIndicesPtr, CepsVector< CepsAttribute > &cellAttr, CepsVector< CepsUInt > &cellAttrPtr, CepsVector< CepsChar > &isBoundaryCell, CepsBool boundaryFlag)=0 |
Reads a single cell in mesh file. More... | |
virtual CepsBool | checkExtension () const |
Stop if extension is not ok, extension must be defined in child classes. More... | |
void | checkCanReadNodes (CepsUInt indexStart, CepsUInt indexEnd) const |
Aborts if passed indices are wrong. More... | |
void | checkCanReadCells (CepsUInt indexStart, CepsUInt indexEnd) const |
Aborts if passed indices are wrong. More... | |
Protected Attributes | |
CepsString | m_extension |
File name extension. More... | |
CepsUInt | m_expectedDim |
Expected dimension of mesh. More... | |
CepsBool | m_quads |
Reader for quadratic cells. More... | |
CepsBool | m_initialized |
Flag to ensure call of initializeReader() More... | |
CepsUInt | m_cellsRead |
Keeps track of already read cells. More... | |
CepsUInt | m_nbNodesPerCell |
nb nodes per cell More... | |
CepsUInt | m_bdryCellsRead |
Keeps track of already read boundary cells. More... | |
CepsUInt | m_nbNodesPerBdryCell |
nb nodes per boundary cell More... | |
CepsInt | m_nodesBegin |
line start of nodes More... | |
CepsUInt | m_nbNodes |
number of nodes in mesh More... | |
CepsInt | m_cellsBegin |
line start of cells More... | |
CepsUInt | m_nbCells |
number of cells in mesh, appropriate for dimension More... | |
CepsUInt | m_nbCellsTotal |
number of all cells in file More... | |
CepsInt | m_bdryCellsBegin |
line start of boundary cells More... | |
CepsUInt | m_nbBdryCells |
number of boundary cells in mesh, appropriate for dimension More... | |
CepsUInt | m_nbAttrPerNode |
attributes per node More... | |
CepsUInt | m_nbAttrPerCell |
attributes per cell More... | |
CepsUInt | m_nbAttrPerBdryCell |
attributes per boundary cell More... | |
Protected Attributes inherited from FileReader | |
CepsString | m_fileName |
file to open More... | |
std::ifstream | m_file |
stream More... | |
|
delete |
Deleted default constructor.
MeshReader::MeshReader | ( | const CepsString & | mesh, |
const CepsUInt & | dim, | ||
CepsBool | quads = false |
||
) |
Constructor with full file name, and intended dimension of mesh.
Definition at line 32 of file MeshReader.cpp.
|
override |
Destructor.
Definition at line 71 of file MeshReader.cpp.
Aborts if passed indices are wrong.
Definition at line 151 of file MeshReader.cpp.
Aborts if passed indices are wrong.
Definition at line 137 of file MeshReader.cpp.
|
protectedvirtual |
Stop if extension is not ok, extension must be defined in child classes.
Definition at line 123 of file MeshReader.cpp.
|
virtual |
Number of attributes per boundary cell.
Definition at line 117 of file MeshReader.cpp.
|
virtual |
Number of attributes per cell.
Definition at line 111 of file MeshReader.cpp.
|
virtual |
Number of attributes per node.
Definition at line 105 of file MeshReader.cpp.
CepsUInt MeshReader::getNbBdryCells | ( | ) | const |
Number of boundary cell of current mesh.
Definition at line 99 of file MeshReader.cpp.
CepsUInt MeshReader::getNbBdryCellsRead | ( | ) | const |
Number of boundary cells that have been read.
Definition at line 81 of file MeshReader.cpp.
CepsUInt MeshReader::getNbCells | ( | ) | const |
Number of cell of current mesh.
Definition at line 93 of file MeshReader.cpp.
CepsUInt MeshReader::getNbCellsRead | ( | ) | const |
Number of cells that have been read until now.
Definition at line 75 of file MeshReader.cpp.
CepsUInt MeshReader::getNbNodes | ( | ) | const |
Number of nodes of current mesh.
Definition at line 87 of file MeshReader.cpp.
|
protectedpure virtual |
Reads a single cell in mesh file.
cellId | ID of the cell in the array to fill (offset) |
fileCellId | ID in the file (for error message) |
nodeOffset | number of nodes already read in other meshes (out array shift) |
nodeIndices | array of node indices in each cell |
nodeIndicesPtr | array of cell positions in nodeIndices array |
cellAttr | array of cell attributes |
cellAttrPtr | array of positions in cellAttr array |
isBoundaryCell | array of boundary flags |
boundaryFlag | tells if this cell is on boundary |
Implemented in VtkMeshReader, TetgenMeshReader, MeditMeshReader, and GmshMeshReader.
|
pure virtual |
The routine MUST set the number of nodes and cells.
Implemented in VtkMeshReader, TetgenMeshReader, MeditMeshReader, and GmshMeshReader.
|
pure virtual |
Reads several cells in mesh file.
indexStart | in file index of where to start reading |
indexEnd | in file index of where to stop reading (+1) |
nodeOffset | number of nodes already read in other meshes (out array shift) |
cellOffset | number of cells already read in other meshes (out array shift) |
nodeIndices | array of node indices in each cell |
nodeIndicesPtr | array of cell positions in nodeIndices array |
cellAttr | array of cell attributes |
cellAttrPtr | array of positions in cellAttr array |
isBoundaryCell | array of boundary flags |
Implemented in VtkMeshReader, TetgenMeshReader, MeditMeshReader, and GmshMeshReader.
|
pure virtual |
Reads several nodes in mesh file.
indexStart | in file index of where to start reading |
indexEnd | in file index of where to stop reading (+1) |
nodeOffset | number of nodes already read in other meshes (equiv. shift in arrays to fill) |
coords | array of coordinates |
attr | array of node attributes |
attrPtr | array of positions in attributes array |
Implemented in VtkMeshReader, TetgenMeshReader, MeditMeshReader, and GmshMeshReader.
|
protected |
line start of boundary cells
Definition at line 190 of file MeshReader.hpp.
|
protected |
Keeps track of already read boundary cells.
Definition at line 180 of file MeshReader.hpp.
|
protected |
line start of cells
Definition at line 186 of file MeshReader.hpp.
|
protected |
Keeps track of already read cells.
Definition at line 178 of file MeshReader.hpp.
|
protected |
Expected dimension of mesh.
Definition at line 174 of file MeshReader.hpp.
|
protected |
File name extension.
Definition at line 172 of file MeshReader.hpp.
|
protected |
Flag to ensure call of initializeReader()
Definition at line 176 of file MeshReader.hpp.
|
protected |
attributes per boundary cell
Definition at line 195 of file MeshReader.hpp.
|
protected |
attributes per cell
Definition at line 194 of file MeshReader.hpp.
|
protected |
attributes per node
Definition at line 193 of file MeshReader.hpp.
|
protected |
number of boundary cells in mesh, appropriate for dimension
Definition at line 191 of file MeshReader.hpp.
|
protected |
number of cells in mesh, appropriate for dimension
Definition at line 187 of file MeshReader.hpp.
|
protected |
number of all cells in file
Definition at line 188 of file MeshReader.hpp.
|
protected |
number of nodes in mesh
Definition at line 184 of file MeshReader.hpp.
|
protected |
nb nodes per boundary cell
Definition at line 181 of file MeshReader.hpp.
|
protected |
nb nodes per cell
Definition at line 179 of file MeshReader.hpp.
|
protected |
line start of nodes
Definition at line 183 of file MeshReader.hpp.
|
protected |
Reader for quadratic cells.
Definition at line 175 of file MeshReader.hpp.