Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
PottsMeshReader< SPACE_DIM > Class Template Reference

#include <PottsMeshReader.hpp>

+ Inheritance diagram for PottsMeshReader< SPACE_DIM >:
+ Collaboration diagram for PottsMeshReader< SPACE_DIM >:

Public Member Functions

 PottsMeshReader (std::string pathBaseName)
 
 ~PottsMeshReader ()
 
unsigned GetNumElements () const
 
unsigned GetNumNodes () const
 
unsigned GetNumElementAttributes () const
 
unsigned GetNumFaces () const
 
ElementData GetNextFaceData ()
 
void Reset ()
 
std::vector< doubleGetNextNode ()
 
ElementData GetNextElementData ()
 
- Public Member Functions inherited from AbstractMeshReader< SPACE_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 SPACE_DIM>
class PottsMeshReader< SPACE_DIM >

A mesh reader class for Potts meshes. So far implemented in 2D only.

Definition at line 62 of file PottsMeshReader.hpp.

Constructor & Destructor Documentation

◆ PottsMeshReader()

template<unsigned SPACE_DIM>
PottsMeshReader< SPACE_DIM >::PottsMeshReader ( std::string  pathBaseName)

Constructor.

Parameters
pathBaseNamethe base name for results files

Definition at line 39 of file PottsMeshReader.cpp.

References PottsMeshReader< SPACE_DIM >::OpenFiles(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().

◆ ~PottsMeshReader()

template<unsigned SPACE_DIM>
PottsMeshReader< SPACE_DIM >::~PottsMeshReader ( )
inline

Destructor.

Definition at line 141 of file PottsMeshReader.hpp.

Member Function Documentation

◆ CloseFiles()

template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::CloseFiles ( )
private

Close node and element files.

Definition at line 239 of file PottsMeshReader.cpp.

◆ GetNextElementData()

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

Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 129 of file PottsMeshReader.cpp.

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

◆ GetNextFaceData()

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

Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 71 of file PottsMeshReader.cpp.

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

◆ GetNextLineFromStream()

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

Returns (via rawLine) the next line from a given file stream.

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

Definition at line 246 of file PottsMeshReader.cpp.

References EXCEPTION.

◆ GetNextNode()

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

Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 99 of file PottsMeshReader.cpp.

References EXCEPTION.

◆ GetNumElementAttributes()

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

Reimplemented from AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 65 of file PottsMeshReader.cpp.

◆ GetNumElements()

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

Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 53 of file PottsMeshReader.cpp.

◆ GetNumFaces()

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

Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 81 of file PottsMeshReader.cpp.

◆ GetNumNodes()

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

Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 59 of file PottsMeshReader.cpp.

◆ OpenElementsFile()

template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::OpenElementsFile ( )
private

Open element file.

Definition at line 196 of file PottsMeshReader.cpp.

References EXCEPTION.

◆ OpenFiles()

template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::OpenFiles ( )
private

Open node and element files.

Definition at line 177 of file PottsMeshReader.cpp.

Referenced by PottsMeshReader< SPACE_DIM >::PottsMeshReader().

◆ OpenNodeFile()

template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::OpenNodeFile ( )
private

Open node file.

Definition at line 184 of file PottsMeshReader.cpp.

References EXCEPTION.

◆ ReadHeaders()

template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::ReadHeaders ( )
private

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

Definition at line 210 of file PottsMeshReader.cpp.

Referenced by PottsMeshReader< SPACE_DIM >::PottsMeshReader().

◆ Reset()

template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::Reset ( )
virtual

Reset pointers to beginning.

Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 88 of file PottsMeshReader.cpp.

Member Data Documentation

◆ mElementsFile

template<unsigned SPACE_DIM>
std::ifstream PottsMeshReader< SPACE_DIM >::mElementsFile
private

The elements file for the mesh.

Definition at line 73 of file PottsMeshReader.hpp.

◆ mElementsRead

template<unsigned SPACE_DIM>
unsigned PottsMeshReader< SPACE_DIM >::mElementsRead
private

Number of elements read in by the reader.

Definition at line 88 of file PottsMeshReader.hpp.

◆ mFilesBaseName

template<unsigned SPACE_DIM>
std::string PottsMeshReader< SPACE_DIM >::mFilesBaseName
private

The base name for mesh files.

Definition at line 67 of file PottsMeshReader.hpp.

◆ mIndexFromZero

template<unsigned SPACE_DIM>
bool PottsMeshReader< SPACE_DIM >::mIndexFromZero
private

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

Definition at line 76 of file PottsMeshReader.hpp.

◆ mNodesFile

template<unsigned SPACE_DIM>
std::ifstream PottsMeshReader< SPACE_DIM >::mNodesFile
private

The nodes file for the mesh.

Definition at line 70 of file PottsMeshReader.hpp.

◆ mNodesRead

template<unsigned SPACE_DIM>
unsigned PottsMeshReader< SPACE_DIM >::mNodesRead
private

Number of nodes read in by the reader.

Definition at line 85 of file PottsMeshReader.hpp.

◆ mNumElementAttributes

template<unsigned SPACE_DIM>
unsigned PottsMeshReader< SPACE_DIM >::mNumElementAttributes
private

Is the number of attributes stored for each element.

Definition at line 94 of file PottsMeshReader.hpp.

◆ mNumElements

template<unsigned SPACE_DIM>
unsigned PottsMeshReader< SPACE_DIM >::mNumElements
private

Number of elements in the mesh.

Definition at line 82 of file PottsMeshReader.hpp.

◆ mNumNodeAttributes

template<unsigned SPACE_DIM>
unsigned PottsMeshReader< SPACE_DIM >::mNumNodeAttributes
private

Is the number of attributes stored at each node.

Definition at line 91 of file PottsMeshReader.hpp.

◆ mNumNodes

template<unsigned SPACE_DIM>
unsigned PottsMeshReader< SPACE_DIM >::mNumNodes
private

Number of nodes in the mesh.

Definition at line 79 of file PottsMeshReader.hpp.


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