Chaste Release::3.1
|
#include <VertexMeshReader.hpp>
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 () |
VertexElementData | GetNextElementDataWithFaces () |
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 63 of file VertexMeshReader.hpp.
VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::VertexMeshReader | ( | std::string | pathBaseName | ) |
Constructor.
pathBaseName | the base name for results files |
Definition at line 42 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 142 of file VertexMeshReader.hpp.
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles | ( | ) | [private] |
Close node and element files.
Definition at line 331 of file VertexMeshReader.cpp.
ElementData VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData | ( | ) | [virtual] |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 139 of file VertexMeshReader.cpp.
References ElementData::AttributeValue, EXCEPTION, and ElementData::NodeIndices.
VertexElementData VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementDataWithFaces | ( | ) |
Definition at line 188 of file VertexMeshReader.cpp.
References VertexElementData::AttributeValue, ElementData::AttributeValue, EXCEPTION, VertexElementData::Faces, ElementData::NodeIndices, and VertexElementData::NodeIndices.
ElementData VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData | ( | ) | [virtual] |
Returns a vector of the nodes of each face in turn.
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 81 of file VertexMeshReader.cpp.
References ElementData::AttributeValue, and ElementData::NodeIndices.
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextLineFromStream | ( | std::ifstream & | fileStream, |
std::string & | rawLine | ||
) | [private] |
Get the next line from a given file stream.
fileStream | the file stream |
rawLine | the raw line (may contain comments) |
Definition at line 338 of file VertexMeshReader.cpp.
References EXCEPTION.
std::vector< double > VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode | ( | ) | [virtual] |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 109 of file VertexMeshReader.cpp.
References EXCEPTION.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumEdges | ( | ) | const |
Returns the number of edges in the mesh (synonym of GetNumFaces())
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 91 of file VertexMeshReader.cpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes | ( | ) | const [virtual] |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 68 of file VertexMeshReader.cpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements | ( | ) | const [virtual] |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 56 of file VertexMeshReader.cpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaces | ( | ) | const [virtual] |
Returns the number of faces in the mesh (synonym of GetNumEdges()).
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 74 of file VertexMeshReader.cpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes | ( | ) | const [virtual] |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 62 of file VertexMeshReader.cpp.
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenElementsFile | ( | ) | [private] |
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles | ( | ) | [private] |
Open node and element files.
Definition at line 269 of file VertexMeshReader.cpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::VertexMeshReader().
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenNodeFile | ( | ) | [private] |
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders | ( | ) | [private] |
Read the file headers to determine node and element numbers and attributes.
Definition at line 302 of file VertexMeshReader.cpp.
Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::VertexMeshReader().
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset | ( | ) | [virtual] |
Reset pointers to beginning.
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 98 of file VertexMeshReader.cpp.
std::ifstream VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsFile [private] |
The elements file for the mesh.
Definition at line 74 of file VertexMeshReader.hpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsRead [private] |
Number of elements read in by the reader.
Definition at line 89 of file VertexMeshReader.hpp.
std::string VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mFilesBaseName [private] |
The base name for mesh files.
Definition at line 68 of file VertexMeshReader.hpp.
bool VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero [private] |
True if input data is numbered from zero, false otherwise.
Definition at line 77 of file VertexMeshReader.hpp.
std::ifstream VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesFile [private] |
The nodes file for the mesh.
Definition at line 71 of file VertexMeshReader.hpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesRead [private] |
Number of nodes read in by the reader.
Definition at line 86 of file VertexMeshReader.hpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes [private] |
Is the number of attributes stored for each element.
Definition at line 95 of file VertexMeshReader.hpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements [private] |
Number of elements in the mesh.
Definition at line 83 of file VertexMeshReader.hpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodeAttributes [private] |
Is the number of attributes stored at each node.
Definition at line 92 of file VertexMeshReader.hpp.
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes [private] |
Number of nodes in the mesh.
Definition at line 80 of file VertexMeshReader.hpp.