TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <TrianglesMeshReader.hpp>

Inheritance diagram for TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >:

Inheritance graph
[legend]
Collaboration diagram for TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TrianglesMeshReader (std::string pathBaseName, unsigned orderOfElements=1, unsigned orderOfBoundaryElements=1)
unsigned GetNumElements () const
unsigned GetNumNodes () const
unsigned GetNumFaces () const
unsigned GetNumEdges () const
unsigned GetNumElementAttributes () const
unsigned GetNumFaceAttributes () const
void Reset ()
std::vector< double > GetNextNode ()
ElementData GetNextElementData ()
ElementData GetNextFaceData ()
ElementData GetNextEdgeData ()

Private Member Functions

void OpenFiles ()
void OpenNodeFile ()
void OpenElementsFile ()
void OpenFacesFile ()
void ReadHeaders ()
void CloseFiles ()
void GetNextLineFromStream (std::ifstream &fileStream, std::string &rRawLine)
std::string GetMeshFileBaseName ()

Private Attributes

bool mIndexFromZero
std::string mFilesBaseName
std::ifstream mNodesFile
std::ifstream mElementsFile
std::ifstream mFacesFile
unsigned mNumNodes
unsigned mNumElements
unsigned mNumFaces
unsigned mNodesRead
unsigned mElementsRead
unsigned mFacesRead
unsigned mBoundaryFacesRead
unsigned mNumNodeAttributes
unsigned mMaxNodeBdyMarker
unsigned mNumElementNodes
unsigned mNumElementAttributes
unsigned mNumFaceAttributes
unsigned mOrderOfElements
unsigned mOrderOfBoundaryElements
unsigned mNodesPerElement
unsigned mNodesPerBoundaryElement


Detailed Description

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

Concrete version of the AbstractCachedMeshReader class. Once constructed the public methods of the AbstractCachedMeshReader (std::vector<double> GetNextNode(); etc) can be called to interrogate the data.

Definition at line 45 of file TrianglesMeshReader.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::TrianglesMeshReader ( std::string  pathBaseName,
unsigned  orderOfElements = 1,
unsigned  orderOfBoundaryElements = 1 
) [inline]

Constructor.

Parameters:
pathBaseName the base name of the files from which to read the mesh data
orderOfElements the order of each element: 1 for linear, 2 for quadratic (defaults to 1)
orderOfBoundaryElements the order of each boundary element: 1 for linear, 2 for quadratic (defaults to 1. May or may not be different to orderOfElements (Note tetgen with the -o2 flag creates quadratic elements but doesn't create quadratic faces, hence the need for this third parameter)

Definition at line 44 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerBoundaryElement, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfBoundaryElements, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfElements, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles(), and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().


Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements (  )  const [inline, virtual]

Returns the number of elements in the mesh

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 91 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes (  )  const [inline, virtual]

Returns the number of nodes in the mesh

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 97 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< 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 103 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< 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 109 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes (  )  const [inline, virtual]

Returns the number of attributes in the mesh

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 115 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaceAttributes (  )  const [inline, virtual]

Returns the number of attributes in the mesh

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 121 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaceAttributes.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset (  )  [inline, virtual]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< double > TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode (  )  [inline, virtual]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData (  )  [inline, virtual]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData (  )  [inline, virtual]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextEdgeData (  )  [inline]

Returns a vector of the nodes of each edge in turn (synonym of GetNextFace()).

Definition at line 292 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles (  )  [inline, private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenNodeFile (  )  [inline, private]

Open node file.

Todo:
Change name to OpenNodesFile for consistency with OpenElementsFile and OpenFacesFile? (#991)

Definition at line 306 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mFilesBaseName, and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesFile.

Referenced by TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles(), and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenElementsFile (  )  [inline, private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFacesFile (  )  [inline, private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders (  )  [inline, private]

Read the header from each mesh file.

Todo:
: rename std::stringstream variables

Definition at line 387 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextLineFromStream(), TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mBoundaryFacesRead, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsFile, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mFacesFile, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mFacesRead, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mMaxNodeBdyMarker, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesFile, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementNodes, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaceAttributes, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodeAttributes, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfElements, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFacesFile(), and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenNodeFile().

Referenced by TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset(), and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::TrianglesMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles (  )  [inline, private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextLineFromStream ( std::ifstream &  fileStream,
std::string &  rRawLine 
) [inline, private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::GetMeshFileBaseName (  )  [inline, private, virtual]

Get method for mFilesBaseName.

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 521 of file TrianglesMeshReader.cpp.

References TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mFilesBaseName.


Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mFilesBaseName [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::ifstream TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesFile [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::ifstream TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsFile [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::ifstream TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mFacesFile [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesRead [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsRead [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mFacesRead [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mBoundaryFacesRead [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodeAttributes [private]

Is the number of attributes stored at each node.

Definition at line 66 of file TrianglesMeshReader.hpp.

Referenced by TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mMaxNodeBdyMarker [private]

Is the maximum node boundary marker.

Definition at line 67 of file TrianglesMeshReader.hpp.

Referenced by TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementNodes [private]

Is the number of nodes per element.

Definition at line 68 of file TrianglesMeshReader.hpp.

Referenced by TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaceAttributes [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfElements [private]

The order of each element (1 for linear, 2 for quadratic).

Definition at line 72 of file TrianglesMeshReader.hpp.

Referenced by TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders(), and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::TrianglesMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfBoundaryElements [private]

The order of each element (1 for linear, 2 for quadratic).

Definition at line 73 of file TrianglesMeshReader.hpp.

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

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement [private]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerBoundaryElement [private]


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

Generated on Tue Aug 4 16:11:50 2009 for Chaste by  doxygen 1.5.5