Chaste Release::3.1
PottsMeshReader< SPACE_DIM > Class Template Reference

#include <PottsMeshReader.hpp>

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

List of all members.

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

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-based meshes. So far implemented in 2D only.

Definition at line 62 of file PottsMeshReader.hpp.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
pathBaseNamethe base name for results files

Definition at line 42 of file PottsMeshReader.cpp.

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

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

Destructor.

Definition at line 141 of file PottsMeshReader.hpp.


Member Function Documentation

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

Close node and element files.

Definition at line 242 of file PottsMeshReader.cpp.

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 132 of file PottsMeshReader.cpp.

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

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 74 of file PottsMeshReader.cpp.

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

template<unsigned SPACE_DIM>
void PottsMeshReader< 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 249 of file PottsMeshReader.cpp.

References EXCEPTION.

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 102 of file PottsMeshReader.cpp.

References EXCEPTION.

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 68 of file PottsMeshReader.cpp.

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 56 of file PottsMeshReader.cpp.

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 84 of file PottsMeshReader.cpp.

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 62 of file PottsMeshReader.cpp.

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

Open element file.

Definition at line 199 of file PottsMeshReader.cpp.

References EXCEPTION.

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

Open node and element files.

Definition at line 180 of file PottsMeshReader.cpp.

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

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

Open node file.

Definition at line 187 of file PottsMeshReader.cpp.

References EXCEPTION.

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 213 of file PottsMeshReader.cpp.

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

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

Reset pointers to beginning.

Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 91 of file PottsMeshReader.cpp.


Member Data Documentation

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.

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.

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.

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

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

Definition at line 76 of file PottsMeshReader.hpp.

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.

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.

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.

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

Number of elements in the mesh.

Definition at line 82 of file PottsMeshReader.hpp.

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.

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: