#include <PottsMeshReader.hpp>
Inherits AbstractMeshReader< SPACE_DIM, SPACE_DIM >.
Public Member Functions | |
PottsMeshReader (std::string pathBaseName) | |
~PottsMeshReader () | |
unsigned | GetNumElements () const |
unsigned | GetNumNodes () const |
unsigned | GetNumElementAttributes () const |
unsigned | GetNumFaces () const |
ElementData | GetNextFaceData () |
void | Reset () |
std::vector< double > | GetNextNode () |
ElementData | GetNextElementData () |
Private Member Functions | |
void | OpenFiles () |
void | OpenNodeFile () |
void | OpenElementsFile () |
void | ReadHeaders () |
void | CloseFiles () |
void | GetNextLineFromStream (std::ifstream &fileStream, std::string &rawLine) |
Private Attributes | |
std::string | mFilesBaseName |
std::ifstream | mNodesFile |
std::ifstream | mElementsFile |
bool | mIndexFromZero |
unsigned | mNumNodes |
unsigned | mNumElements |
unsigned | mNodesRead |
unsigned | mElementsRead |
unsigned | mNumNodeAttributes |
unsigned | mNumElementAttributes |
A mesh reader class for potts-based meshes. So far implemented in 2D only.
Definition at line 55 of file PottsMeshReader.hpp.
PottsMeshReader< SPACE_DIM >::PottsMeshReader | ( | std::string | pathBaseName | ) | [inline] |
Constructor.
pathBaseName | the base name for results files |
Definition at line 35 of file PottsMeshReader.cpp.
References PottsMeshReader< SPACE_DIM >::OpenFiles(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().
PottsMeshReader< SPACE_DIM >::~PottsMeshReader | ( | ) | [inline] |
Destructor.
Definition at line 134 of file PottsMeshReader.hpp.
void PottsMeshReader< SPACE_DIM >::CloseFiles | ( | ) | [inline, private] |
Close node and element files.
Definition at line 235 of file PottsMeshReader.cpp.
References PottsMeshReader< SPACE_DIM >::mElementsFile, and PottsMeshReader< SPACE_DIM >::mNodesFile.
Referenced by PottsMeshReader< SPACE_DIM >::Reset().
ElementData PottsMeshReader< SPACE_DIM >::GetNextElementData | ( | ) | [inline, virtual] |
Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.
Definition at line 125 of file PottsMeshReader.cpp.
References ElementData::AttributeValue, EXCEPTION, PottsMeshReader< SPACE_DIM >::GetNextLineFromStream(), PottsMeshReader< SPACE_DIM >::mElementsFile, PottsMeshReader< SPACE_DIM >::mElementsRead, PottsMeshReader< SPACE_DIM >::mIndexFromZero, PottsMeshReader< SPACE_DIM >::mNumElementAttributes, and ElementData::NodeIndices.
ElementData PottsMeshReader< SPACE_DIM >::GetNextFaceData | ( | ) | [inline, virtual] |
Returns a vector of the nodes of each face in turn.
Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.
Definition at line 67 of file PottsMeshReader.cpp.
References ElementData::AttributeValue, and ElementData::NodeIndices.
void PottsMeshReader< SPACE_DIM >::GetNextLineFromStream | ( | std::ifstream & | fileStream, | |
std::string & | rawLine | |||
) | [inline, private] |
Get the next line from a given file stream.
fileStream | the file stream | |
rawLine | the raw line (may contain comments) |
Definition at line 242 of file PottsMeshReader.cpp.
References EXCEPTION.
Referenced by PottsMeshReader< SPACE_DIM >::GetNextElementData(), PottsMeshReader< SPACE_DIM >::GetNextNode(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().
std::vector< double > PottsMeshReader< SPACE_DIM >::GetNextNode | ( | ) | [inline, virtual] |
Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.
Definition at line 95 of file PottsMeshReader.cpp.
References EXCEPTION, PottsMeshReader< SPACE_DIM >::GetNextLineFromStream(), PottsMeshReader< SPACE_DIM >::mIndexFromZero, PottsMeshReader< SPACE_DIM >::mNodesFile, and PottsMeshReader< SPACE_DIM >::mNodesRead.
unsigned PottsMeshReader< SPACE_DIM >::GetNumElementAttributes | ( | ) | const [inline, virtual] |
Reimplemented from AbstractMeshReader< SPACE_DIM, SPACE_DIM >.
Definition at line 61 of file PottsMeshReader.cpp.
References PottsMeshReader< SPACE_DIM >::mNumElementAttributes.
unsigned PottsMeshReader< SPACE_DIM >::GetNumElements | ( | ) | const [inline, virtual] |
Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.
Definition at line 49 of file PottsMeshReader.cpp.
References PottsMeshReader< SPACE_DIM >::mNumElements.
unsigned PottsMeshReader< SPACE_DIM >::GetNumFaces | ( | ) | const [inline, virtual] |
Returns the number of faces in the mesh (synonym of GetNumEdges()).
Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.
Definition at line 77 of file PottsMeshReader.cpp.
unsigned PottsMeshReader< SPACE_DIM >::GetNumNodes | ( | ) | const [inline, virtual] |
Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.
Definition at line 55 of file PottsMeshReader.cpp.
References PottsMeshReader< SPACE_DIM >::mNumNodes.
void PottsMeshReader< SPACE_DIM >::OpenElementsFile | ( | ) | [inline, private] |
Open element file.
Definition at line 192 of file PottsMeshReader.cpp.
References EXCEPTION, PottsMeshReader< SPACE_DIM >::mElementsFile, and PottsMeshReader< SPACE_DIM >::mFilesBaseName.
Referenced by PottsMeshReader< SPACE_DIM >::OpenFiles().
void PottsMeshReader< SPACE_DIM >::OpenFiles | ( | ) | [inline, private] |
Open node and element files.
Definition at line 173 of file PottsMeshReader.cpp.
References PottsMeshReader< SPACE_DIM >::OpenElementsFile(), and PottsMeshReader< SPACE_DIM >::OpenNodeFile().
Referenced by PottsMeshReader< SPACE_DIM >::PottsMeshReader(), and PottsMeshReader< SPACE_DIM >::Reset().
void PottsMeshReader< SPACE_DIM >::OpenNodeFile | ( | ) | [inline, private] |
Open node file.
Definition at line 180 of file PottsMeshReader.cpp.
References EXCEPTION, PottsMeshReader< SPACE_DIM >::mFilesBaseName, and PottsMeshReader< SPACE_DIM >::mNodesFile.
Referenced by PottsMeshReader< SPACE_DIM >::OpenFiles(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().
void PottsMeshReader< SPACE_DIM >::ReadHeaders | ( | ) | [inline, private] |
Read the file headers to determine node and element numbers and attributes.
Definition at line 206 of file PottsMeshReader.cpp.
References PottsMeshReader< SPACE_DIM >::GetNextLineFromStream(), PottsMeshReader< SPACE_DIM >::mElementsFile, PottsMeshReader< SPACE_DIM >::mIndexFromZero, PottsMeshReader< SPACE_DIM >::mNodesFile, PottsMeshReader< SPACE_DIM >::mNumElementAttributes, PottsMeshReader< SPACE_DIM >::mNumElements, PottsMeshReader< SPACE_DIM >::mNumNodeAttributes, PottsMeshReader< SPACE_DIM >::mNumNodes, and PottsMeshReader< SPACE_DIM >::OpenNodeFile().
Referenced by PottsMeshReader< SPACE_DIM >::PottsMeshReader(), and PottsMeshReader< SPACE_DIM >::Reset().
void PottsMeshReader< SPACE_DIM >::Reset | ( | ) | [inline, virtual] |
Reset pointers to beginning.
Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.
Definition at line 84 of file PottsMeshReader.cpp.
References PottsMeshReader< SPACE_DIM >::CloseFiles(), PottsMeshReader< SPACE_DIM >::mElementsRead, PottsMeshReader< SPACE_DIM >::mNodesRead, PottsMeshReader< SPACE_DIM >::OpenFiles(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().
std::ifstream PottsMeshReader< SPACE_DIM >::mElementsFile [private] |
The elements file for the mesh.
Definition at line 66 of file PottsMeshReader.hpp.
Referenced by PottsMeshReader< SPACE_DIM >::CloseFiles(), PottsMeshReader< SPACE_DIM >::GetNextElementData(), PottsMeshReader< SPACE_DIM >::OpenElementsFile(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().
unsigned PottsMeshReader< SPACE_DIM >::mElementsRead [private] |
Number of elements read in by the reader.
Definition at line 81 of file PottsMeshReader.hpp.
Referenced by PottsMeshReader< SPACE_DIM >::GetNextElementData(), and PottsMeshReader< SPACE_DIM >::Reset().
std::string PottsMeshReader< SPACE_DIM >::mFilesBaseName [private] |
The base name for mesh files.
Definition at line 60 of file PottsMeshReader.hpp.
Referenced by PottsMeshReader< SPACE_DIM >::OpenElementsFile(), and PottsMeshReader< SPACE_DIM >::OpenNodeFile().
bool PottsMeshReader< SPACE_DIM >::mIndexFromZero [private] |
True if input data is numbered from zero, false otherwise.
Definition at line 69 of file PottsMeshReader.hpp.
Referenced by PottsMeshReader< SPACE_DIM >::GetNextElementData(), PottsMeshReader< SPACE_DIM >::GetNextNode(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().
std::ifstream PottsMeshReader< SPACE_DIM >::mNodesFile [private] |
The nodes file for the mesh.
Definition at line 63 of file PottsMeshReader.hpp.
Referenced by PottsMeshReader< SPACE_DIM >::CloseFiles(), PottsMeshReader< SPACE_DIM >::GetNextNode(), PottsMeshReader< SPACE_DIM >::OpenNodeFile(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().
unsigned PottsMeshReader< SPACE_DIM >::mNodesRead [private] |
Number of nodes read in by the reader.
Definition at line 78 of file PottsMeshReader.hpp.
Referenced by PottsMeshReader< SPACE_DIM >::GetNextNode(), and PottsMeshReader< SPACE_DIM >::Reset().
unsigned PottsMeshReader< SPACE_DIM >::mNumElementAttributes [private] |
Is the number of attributes stored for each element.
Definition at line 87 of file PottsMeshReader.hpp.
Referenced by PottsMeshReader< SPACE_DIM >::GetNextElementData(), PottsMeshReader< SPACE_DIM >::GetNumElementAttributes(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().
unsigned PottsMeshReader< SPACE_DIM >::mNumElements [private] |
Number of elements in the mesh.
Definition at line 75 of file PottsMeshReader.hpp.
Referenced by PottsMeshReader< SPACE_DIM >::GetNumElements(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().
unsigned PottsMeshReader< SPACE_DIM >::mNumNodeAttributes [private] |
Is the number of attributes stored at each node.
Definition at line 84 of file PottsMeshReader.hpp.
Referenced by PottsMeshReader< SPACE_DIM >::ReadHeaders().
unsigned PottsMeshReader< SPACE_DIM >::mNumNodes [private] |
Number of nodes in the mesh.
Definition at line 72 of file PottsMeshReader.hpp.
Referenced by PottsMeshReader< SPACE_DIM >::GetNumNodes(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().