39 CEPS_ABORT (
"Impossible to read meshes with main dimension 0 or >3");
128 "Mesh reader created with filename "
140 "Must call initialize() beforehand"
143 "index start > index end"
146 "index start or index end larger than number of nodes"
154 "Must call initialize() beforehand"
157 "index start > index end"
160 "Cannot read cells from index #" << indexStart << std::endl
161 <<
" to index #" << indexEnd <<
" in file " <<
m_fileName
#define CEPS_ABORT(message)
Stops the execution with a message. If testing is enabled, only throws a runtime_error.
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
std::basic_string< CepsChar > CepsString
C++ format string.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
int32_t CepsInt
Need 32 bit integer.
Base class that regroups common reader functionalities.
CepsString m_fileName
file to open
CepsInt m_nodesBegin
line start of nodes
CepsUInt m_nbAttrPerCell
attributes per cell
CepsUInt getNbCellsRead() const
Number of cells that have been read until now.
virtual CepsInt getNbAttributesPerCell() const
Number of attributes per cell.
CepsUInt getNbNodes() const
Number of nodes of current mesh.
CepsBool m_initialized
Flag to ensure call of initializeReader()
void checkCanReadNodes(CepsUInt indexStart, CepsUInt indexEnd) const
Aborts if passed indices are wrong.
MeshReader()=delete
Deleted default constructor.
CepsUInt m_nbNodesPerBdryCell
nb nodes per boundary cell
CepsBool m_quads
Reader for quadratic cells.
CepsUInt m_bdryCellsRead
Keeps track of already read boundary cells.
~MeshReader() override
Destructor.
CepsUInt m_nbNodesPerCell
nb nodes per cell
CepsUInt getNbBdryCells() const
Number of boundary cell of current mesh.
virtual CepsInt getNbAttributesPerBdryCell() const
Number of attributes per boundary cell.
CepsUInt m_nbBdryCells
number of boundary cells in mesh, appropriate for dimension
CepsUInt getNbCells() const
Number of cell of current mesh.
CepsUInt m_nbAttrPerBdryCell
attributes per boundary cell
CepsUInt m_cellsRead
Keeps track of already read cells.
CepsUInt m_nbAttrPerNode
attributes per node
virtual CepsInt getNbAttributesPerNode() const
Number of attributes per node.
virtual CepsBool checkExtension() const
Stop if extension is not ok, extension must be defined in child classes.
CepsInt m_cellsBegin
line start of cells
CepsUInt m_expectedDim
Expected dimension of mesh.
CepsUInt m_nbCellsTotal
number of all cells in file
CepsInt m_bdryCellsBegin
line start of boundary cells
CepsString m_extension
File name extension.
CepsUInt m_nbNodes
number of nodes in mesh
CepsUInt getNbBdryCellsRead() const
Number of boundary cells that have been read.
CepsUInt m_nbCells
number of cells in mesh, appropriate for dimension
void checkCanReadCells(CepsUInt indexStart, CepsUInt indexEnd) const
Aborts if passed indices are wrong.
CepsString getDir(const CepsString &str)
Get a substring of s, from beginning of s to the last '/' character. Example: "/home/someone/file....
CepsString getFilename(const CepsString &str)
Returns a substring corresponding to the string after the last '/' character. Example: "/home/someone...
CepsString getExtension(const CepsString &str)
Returns the extension of a file, if any.
CepsBool fileExists(const CepsString &fileName, const CepsString &directory)