Chaste  Release::3.4
VertexMeshReader< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <VertexMeshReader.hpp>

+ Inheritance diagram for VertexMeshReader< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for VertexMeshReader< 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< doubleGetNextNode ()
 
ElementData GetNextElementData ()
 
VertexElementData GetNextElementDataWithFaces ()
 
- Public Member Functions inherited from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >
virtual unsigned GetNumCableElements () const
 
virtual unsigned GetNumFaceAttributes () const
 
virtual unsigned GetNumCableElementAttributes () const
 
virtual std::vector< doubleGetNodeAttributes ()
 
unsigned GetNumEdges () const
 
virtual ElementData GetNextCableElementData ()
 
ElementData GetNextEdgeData ()
 
virtual std::vector< doubleGetNode (unsigned index)
 
virtual ElementData GetElementData (unsigned index)
 
virtual ElementData GetFaceData (unsigned index)
 
ElementData GetEdgeData (unsigned index)
 
virtual std::vector< unsignedGetContainingElementIndices (unsigned index)
 
virtual std::string GetMeshFileBaseName ()
 
virtual unsigned GetOrderOfElements ()
 
virtual unsigned GetOrderOfBoundaryElements ()
 
virtual bool GetReadContainingElementOfBoundaryElement ()
 
virtual bool IsFileFormatBinary ()
 
virtual bool HasNclFile ()
 
virtual bool HasNodePermutation ()
 
virtual const std::vector
< unsigned > & 
rGetNodePermutation ()
 
ElementIterator GetElementIteratorBegin ()
 
ElementIterator GetElementIteratorBegin (const std::set< unsigned > &rIndices)
 
ElementIterator GetElementIteratorEnd ()
 
NodeIterator GetNodeIteratorBegin ()
 
NodeIterator GetNodeIteratorBegin (const std::set< unsigned > &rIndices)
 
NodeIterator GetNodeIteratorEnd ()
 

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
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class VertexMeshReader< ELEMENT_DIM, SPACE_DIM >

A mesh reader class for vertex-based meshes. So far implemented in 2D only.

Definition at line 63 of file VertexMeshReader.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::VertexMeshReader ( std::string  pathBaseName)

Constructor.

Parameters
pathBaseNamethe 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().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::~VertexMeshReader ( )
inline

Destructor.

Definition at line 142 of file VertexMeshReader.hpp.

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles ( )
private

Close node and element files.

Definition at line 325 of file VertexMeshReader.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData ( )
virtual
Returns
the nodes of each element (and any attribute information, if there is any) in turn.

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 139 of file VertexMeshReader.cpp.

References ElementData::AttributeValue, EXCEPTION, and ElementData::NodeIndices.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElementData VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementDataWithFaces ( )
Returns
the nodes of each element (and any attribute information, if there is any) in turn, then its faces. This method should only be called in 3D.
Todo:
Store face orientations? (#1076/#1377)

Definition at line 186 of file VertexMeshReader.cpp.

References ElementData::AttributeValue, VertexElementData::AttributeValue, EXCEPTION, VertexElementData::Faces, VertexElementData::NodeIndices, and ElementData::NodeIndices.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData ( )
virtual
Returns
a vector of the nodes of each face in turn.
Todo:
Implement this method (#1076, #1377)

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 81 of file VertexMeshReader.cpp.

References ElementData::AttributeValue, and ElementData::NodeIndices.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextLineFromStream ( std::ifstream &  fileStream,
std::string &  rawLine 
)
private

Get the next line from a given file stream.

Parameters
fileStreamthe file stream
rawLinethe raw line (may contain comments)

Definition at line 332 of file VertexMeshReader.cpp.

References EXCEPTION.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< double > VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode ( )
virtual
Returns
the coordinates of each node in turn.

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 109 of file VertexMeshReader.cpp.

References EXCEPTION.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumEdges ( ) const
Returns
the number of edges in the mesh (synonym of GetNumFaces())
Todo:
Implement this method (#1076)

Definition at line 91 of file VertexMeshReader.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes ( ) const
virtual
Returns
the number of attributes in the mesh

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 68 of file VertexMeshReader.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements ( ) const
virtual
Returns
the number of elements in the mesh.

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 56 of file VertexMeshReader.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaces ( ) const
virtual
Returns
the number of faces in the mesh (synonym of GetNumEdges()).
Todo:
Implement this method (#1076)

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 74 of file VertexMeshReader.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes ( ) const
virtual
Returns
the number of nodes in the mesh.

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 62 of file VertexMeshReader.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenElementsFile ( )
private

Open element file.

Definition at line 282 of file VertexMeshReader.cpp.

References EXCEPTION.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles ( )
private

Open node and element files.

Definition at line 263 of file VertexMeshReader.cpp.

Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::VertexMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenNodeFile ( )
private

Open node file.

Definition at line 270 of file VertexMeshReader.cpp.

References EXCEPTION.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders ( )
private

Read the file headers to determine node and element numbers and attributes.

Definition at line 296 of file VertexMeshReader.cpp.

Referenced by VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::VertexMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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.

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::ifstream VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsFile
private

The elements file for the mesh.

Definition at line 74 of file VertexMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsRead
private

Number of elements read in by the reader.

Definition at line 89 of file VertexMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mFilesBaseName
private

The base name for mesh files.

Definition at line 68 of file VertexMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero
private

True if input data are numbered from zero, false otherwise.

Definition at line 77 of file VertexMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::ifstream VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesFile
private

The nodes file for the mesh.

Definition at line 71 of file VertexMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesRead
private

Number of nodes read in by the reader.

Definition at line 86 of file VertexMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements
private

Number of elements in the mesh.

Definition at line 83 of file VertexMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes
private

Number of nodes in the mesh.

Definition at line 80 of file VertexMeshReader.hpp.


The documentation for this class was generated from the following files: