Chaste  Release::2018.1
MemfemMeshReader< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <MemfemMeshReader.hpp>

+ Inheritance diagram for MemfemMeshReader< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for MemfemMeshReader< ELEMENT_DIM, SPACE_DIM >:

Public Member Functions

 MemfemMeshReader (const std::string &rPathBaseName)
 
virtual ~MemfemMeshReader ()
 
- Public Member Functions inherited from AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >
 AbstractCachedMeshReader ()
 
virtual ~AbstractCachedMeshReader ()
 
unsigned GetNumElements () const
 
unsigned GetNumNodes () const
 
unsigned GetNumFaces () const
 
unsigned GetMaxNodeIndex ()
 
unsigned GetMinNodeIndex ()
 
std::vector< doubleGetNextNode ()
 
void Reset ()
 
ElementData GetNextElementData ()
 
ElementData GetNextFaceData ()
 
- Public Member Functions inherited from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >
virtual unsigned GetNumCableElements () const
 
virtual unsigned GetNumElementAttributes () 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

std::vector< std::vector
< double > > 
TokenizeStringsToDoubles (const std::vector< std::string > &rRawData)
 
std::vector< std::vector
< unsigned > > 
TokenizeStringsToInts (const std::vector< std::string > &rRawData, unsigned dimensionOfObject, bool readHeader)
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >
std::vector< std::string > GetRawDataFromFile (const std::string &rFileName)
 
- Protected Attributes inherited from AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >
unsigned mNumNodeAttributes
 
unsigned mMaxNodeBdyMarker
 
unsigned mNumElementNodes
 
unsigned mNumElementAttributes
 
unsigned mMaxFaceBdyMarker
 
std::vector< std::string > mNodeRawData
 
std::vector< std::string > mElementRawData
 
std::vector< std::string > mFaceRawData
 
std::vector< std::vector
< double > > 
mNodeData
 
std::vector< std::vector
< unsigned > > 
mElementData
 
std::vector< std::vector
< unsigned > > 
mFaceData
 
std::vector< std::vector
< double > >::iterator 
mpNodeIterator
 
std::vector< std::vector
< unsigned > >::iterator 
mpElementIterator
 
std::vector< std::vector
< unsigned > >::iterator 
mpFaceIterator
 
bool mIndexFromZero
 

Detailed Description

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

Concrete version of the AbstractCachedMeshReader class. A MemfemMeshReader takes the base name of a set of Memfem mesh files (ie. the path and name of the files without the suffices). Once constructed the public methods of the AbstractCachedMeshReader (std::vector<double> GetNextNode(); etc) can be called to interrogate the data.

Definition at line 50 of file MemfemMeshReader.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MemfemMeshReader< ELEMENT_DIM, SPACE_DIM >::MemfemMeshReader ( const std::string &  rPathBaseName)

The constructor takes the base name of a set of Memfem mesh files (ie. the path and name of the files without the suffices) and allows the data to be queried.

Typical use: AbstractMeshReader* pMeshReader = new MemfemMeshReader("pdes/tests/meshdata/Memfem_slab");

Parameters
rPathBaseNamethe base name of the files from which to read the mesh data

Definition at line 46 of file MemfemMeshReader.cpp.

References EXCEPTION.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MemfemMeshReader< ELEMENT_DIM, SPACE_DIM >::~MemfemMeshReader ( )
virtual

Destructor.

Definition at line 114 of file MemfemMeshReader.cpp.

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::vector< double > > MemfemMeshReader< ELEMENT_DIM, SPACE_DIM >::TokenizeStringsToDoubles ( const std::vector< std::string > &  rRawData)
private

TokenizeStringsToDoubles is specific to reading node data which came from a Memfem file. Each string is expected to be 3 doubles (representing x,y,z)

Returns
a vector where each item is a vector of doubles which represents position. Indices are implicit in the vector.
Parameters
rRawDatathe node data to be read

Definition at line 118 of file MemfemMeshReader.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::vector< unsigned > > MemfemMeshReader< ELEMENT_DIM, SPACE_DIM >::TokenizeStringsToInts ( const std::vector< std::string > &  rRawData,
unsigned  dimensionOfObject,
bool  readHeader 
)
private

TokenizeStringsToInts is for reading element or boundary face data which came from a Memfem file. Each string is expected to be: 3 or 4 node indices ( 3 indices for a face, 4 for a tetrahedron) a region marker? (if it's an element) NB: Region markers are currently ignored.

Returns
a vector where each item is a vector of ints which represents indices of nodes.
Parameters
rRawDatathe element or boundary face data to be read
dimensionOfObjectthe number of lines of data to be read
readHeaderwhether to read the header

Definition at line 151 of file MemfemMeshReader.cpp.


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