Chaste  Release::2017.1
AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <AbstractCachedMeshReader.hpp>

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

Public Member Functions

 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 ()
 

Protected Member Functions

std::vector< std::string > GetRawDataFromFile (const std::string &rFileName)
 

Protected Attributes

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 AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >

Abstract mesh reader class, for readers which read and cache the entire mesh in internal storage, for the mesh to use for constructing itself. Concrete readers which will read large, memory-intensive, meshes should inherit from AbstractMeshReader, not this class.

Definition at line 51 of file AbstractCachedMeshReader.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::AbstractCachedMeshReader ( )

Constructor

Definition at line 46 of file AbstractCachedMeshReader.cpp.

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::GetMaxNodeIndex ( )
Returns
the maximum node index. Used in testing to check that output nodes are always indexed from zero even if they are input indexed from one.

Definition at line 104 of file AbstractCachedMeshReader.cpp.

References AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementData.

Referenced by AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::~AbstractCachedMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::GetMinNodeIndex ( )
Returns
the minimum node index. Used in testing to check that output nodes are always indexed from zero even if they are input indexed from one.

Definition at line 128 of file AbstractCachedMeshReader.cpp.

References AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementData.

Referenced by AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::~AbstractCachedMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData ( )
virtual
Returns
a vector of the nodes of each element in turn, starting with element 0 the first time it is called followed by elements 1, 2, ... , mNumElements-1.

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 169 of file AbstractCachedMeshReader.cpp.

References ElementData::AttributeValue, EXCEPTION, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementData, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mpElementIterator, and ElementData::NodeIndices.

Referenced by AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::~AbstractCachedMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData ( )
virtual
Returns
a vector of the nodes of each face in turn, starting with face 0 the first time it is called followed by faces 1, 2, ... , mNumFaces-1.

Is a synonum of GetNextEdge(). The two functions can be used interchangeably, i.e. they use the same iterator.

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 196 of file AbstractCachedMeshReader.cpp.

References ElementData::AttributeValue, EXCEPTION, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mFaceData, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mpFaceIterator, and ElementData::NodeIndices.

Referenced by AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::~AbstractCachedMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< double > AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode ( )
virtual
Returns
a vector of the coordinates of each node in turn, starting with node 0 the first time it is called followed by nodes 1, 2, ... , mNumNodes-1.

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 152 of file AbstractCachedMeshReader.cpp.

References EXCEPTION, AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeData, and AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mpNodeIterator.

Referenced by AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::~AbstractCachedMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements ( ) const
virtual
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaces ( ) const
virtual
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes ( ) const
virtual
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::string > AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::GetRawDataFromFile ( const std::string &  rFileName)
protected

Reads an input file rFileName, removes comments (indicated by a #) and blank lines and returns a vector of strings. Each string corresponds to one line of the input file.

Returns
a vector of strings
Parameters
rFileNamethe name of the file to read from, relative to the output directory

Definition at line 58 of file AbstractCachedMeshReader.cpp.

References EXCEPTION.

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::vector<unsigned> > AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementData
protected
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<std::string> AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementRawData
protected

Contents of element input file with comments removed

Definition at line 62 of file AbstractCachedMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::vector<unsigned> > AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mFaceData
protected
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<std::string> AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mFaceRawData
protected

Contents of face (or edge) input file with comments removed

Definition at line 63 of file AbstractCachedMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero
protected

True if input data is numbered from zero, false otherwise

Definition at line 73 of file AbstractCachedMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mMaxFaceBdyMarker
protected

Is the maximum face (or edge) boundary marker

Definition at line 59 of file AbstractCachedMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mMaxNodeBdyMarker
protected

Is the maximum node boundary marker

Definition at line 56 of file AbstractCachedMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::vector<double> > AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeData
protected
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<std::string> AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeRawData
protected

Contents of node input file with comments removed

Definition at line 61 of file AbstractCachedMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes
protected

Is the number of attributes stored for each element

Definition at line 58 of file AbstractCachedMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementNodes
protected

Is the number of nodes per element

Definition at line 57 of file AbstractCachedMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodeAttributes
protected

Is the number of attributes stored at each node

Definition at line 55 of file AbstractCachedMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::vector<unsigned> >::iterator AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mpElementIterator
protected
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::vector<unsigned> >::iterator AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mpFaceIterator
protected
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< std::vector<double> >::iterator AbstractCachedMeshReader< ELEMENT_DIM, SPACE_DIM >::mpNodeIterator
protected

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