#include <VertexMeshReader.hpp>
Inherits AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Public Member Functions | |
VertexMeshReader (std::string pathBaseName) | |
~VertexMeshReader () | |
unsigned | GetNumElements () const |
unsigned | GetNumNodes () const |
unsigned | GetNumElementAttributes () const |
unsigned | GetNumFaces () const |
ElementData | GetNextFaceData () |
unsigned | GetNumEdges () const |
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 vertex-based meshes. So far implemented in 2D only.
Definition at line 44 of file VertexMeshReader.hpp.
VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::VertexMeshReader | ( | std::string | pathBaseName | ) | [inline] |
Constructor.
pathBaseName | the base name for results files |
Definition at line 35 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::~VertexMeshReader | ( | ) | [inline] |
Destructor.
Definition at line 123 of file VertexMeshReader.hpp.
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles | ( | ) | [inline, private] |
Close node and element files.
Definition at line 244 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsFile, and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesFile.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().
ElementData VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData | ( | ) | [inline, virtual] |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 134 of file VertexMeshReader.cpp.
References ElementData::AttributeValue, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextLineFromStream(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsFile, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsRead, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes, and ElementData::NodeIndices.
ElementData VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData | ( | ) | [inline, virtual] |
Returns a vector of the nodes of each face in turn.
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 74 of file VertexMeshReader.cpp.
References ElementData::AttributeValue, and ElementData::NodeIndices.
void VertexMeshReader< ELEMENT_DIM, 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 251 of file VertexMeshReader.cpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
std::vector< double > VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode | ( | ) | [inline, virtual] |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 102 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextLineFromStream(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesFile, and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesRead.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumEdges | ( | ) | const [inline, virtual] |
Returns the number of edges in the mesh (synonym of GetNumFaces())
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 84 of file VertexMeshReader.cpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes | ( | ) | const [inline, virtual] |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 61 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements | ( | ) | const [inline, virtual] |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 49 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaces | ( | ) | const [inline, virtual] |
Returns the number of faces in the mesh (synonym of GetNumEdges()).
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 67 of file VertexMeshReader.cpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes | ( | ) | const [inline, virtual] |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 55 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes.
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenElementsFile | ( | ) | [inline, private] |
Open element file.
Definition at line 201 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsFile, and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mFilesBaseName.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles().
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles | ( | ) | [inline, private] |
Open node and element files.
Definition at line 182 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenElementsFile(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenNodeFile().
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::VertexMeshReader().
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenNodeFile | ( | ) | [inline, private] |
Open node file.
Definition at line 189 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mFilesBaseName, and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesFile.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders | ( | ) | [inline, private] |
Read the file headers to determine node and element numbers and attributes.
Definition at line 215 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextLineFromStream(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsFile, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesFile, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodeAttributes, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes, and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenNodeFile().
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::VertexMeshReader().
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset | ( | ) | [inline, virtual] |
Reset pointers to beginning.
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 91 of file VertexMeshReader.cpp.
References VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsRead, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesRead, VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
std::ifstream VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsFile [private] |
The elements file for the mesh.
Definition at line 55 of file VertexMeshReader.hpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenElementsFile(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsRead [private] |
Number of elements read in by the reader.
Definition at line 70 of file VertexMeshReader.hpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().
std::string VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mFilesBaseName [private] |
The base name for mesh files.
Definition at line 49 of file VertexMeshReader.hpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenElementsFile(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenNodeFile().
bool VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero [private] |
True if input data is numbered from zero, false otherwise.
Definition at line 58 of file VertexMeshReader.hpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
std::ifstream VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesFile [private] |
The nodes file for the mesh.
Definition at line 52 of file VertexMeshReader.hpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenNodeFile(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesRead [private] |
Number of nodes read in by the reader.
Definition at line 67 of file VertexMeshReader.hpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes [private] |
Is the number of attributes stored for each element.
Definition at line 76 of file VertexMeshReader.hpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements [private] |
Number of elements in the mesh.
Definition at line 64 of file VertexMeshReader.hpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodeAttributes [private] |
Is the number of attributes stored at each node.
Definition at line 73 of file VertexMeshReader.hpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes [private] |
Number of nodes in the mesh.
Definition at line 61 of file VertexMeshReader.hpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().