PottsMeshReader< SPACE_DIM > Class Template Reference

#include <PottsMeshReader.hpp>

Inherits AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Collaboration diagram for PottsMeshReader< SPACE_DIM >:
Collaboration graph
[legend]

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 55 of file PottsMeshReader.hpp.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
pathBaseName the base name for results files

Definition at line 35 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 134 of file PottsMeshReader.hpp.


Member Function Documentation

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

Close node and element files.

Definition at line 235 of file PottsMeshReader.cpp.

References PottsMeshReader< SPACE_DIM >::mElementsFile, and PottsMeshReader< SPACE_DIM >::mNodesFile.

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

template<unsigned SPACE_DIM>
ElementData PottsMeshReader< SPACE_DIM >::GetNextElementData (  )  [inline, virtual]
template<unsigned SPACE_DIM>
ElementData PottsMeshReader< SPACE_DIM >::GetNextFaceData (  )  [inline, 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 67 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 
) [inline, private]

Get the next line from a given file stream.

Parameters:
fileStream the file stream
rawLine the raw line (may contain comments)

Definition at line 242 of file PottsMeshReader.cpp.

References EXCEPTION.

Referenced by PottsMeshReader< SPACE_DIM >::GetNextElementData(), PottsMeshReader< SPACE_DIM >::GetNextNode(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().

template<unsigned SPACE_DIM>
std::vector< double > PottsMeshReader< SPACE_DIM >::GetNextNode (  )  [inline, virtual]
template<unsigned SPACE_DIM>
unsigned PottsMeshReader< SPACE_DIM >::GetNumElementAttributes (  )  const [inline, virtual]
Returns:
the number of attributes in the mesh

Reimplemented from AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 61 of file PottsMeshReader.cpp.

References PottsMeshReader< SPACE_DIM >::mNumElementAttributes.

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

Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 49 of file PottsMeshReader.cpp.

References PottsMeshReader< SPACE_DIM >::mNumElements.

template<unsigned SPACE_DIM>
unsigned PottsMeshReader< SPACE_DIM >::GetNumFaces (  )  const [inline, 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 77 of file PottsMeshReader.cpp.

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

Implements AbstractMeshReader< SPACE_DIM, SPACE_DIM >.

Definition at line 55 of file PottsMeshReader.cpp.

References PottsMeshReader< SPACE_DIM >::mNumNodes.

template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::OpenElementsFile (  )  [inline, private]
template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::OpenFiles (  )  [inline, private]
template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::OpenNodeFile (  )  [inline, private]
template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::ReadHeaders (  )  [inline, private]
template<unsigned SPACE_DIM>
void PottsMeshReader< SPACE_DIM >::Reset (  )  [inline, virtual]

Member Data Documentation

template<unsigned SPACE_DIM>
std::ifstream PottsMeshReader< SPACE_DIM >::mElementsFile [private]
template<unsigned SPACE_DIM>
unsigned PottsMeshReader< SPACE_DIM >::mElementsRead [private]

Number of elements read in by the reader.

Definition at line 81 of file PottsMeshReader.hpp.

Referenced by PottsMeshReader< SPACE_DIM >::GetNextElementData(), and PottsMeshReader< SPACE_DIM >::Reset().

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

The base name for mesh files.

Definition at line 60 of file PottsMeshReader.hpp.

Referenced by PottsMeshReader< SPACE_DIM >::OpenElementsFile(), and PottsMeshReader< SPACE_DIM >::OpenNodeFile().

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

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

Definition at line 69 of file PottsMeshReader.hpp.

Referenced by PottsMeshReader< SPACE_DIM >::GetNextElementData(), PottsMeshReader< SPACE_DIM >::GetNextNode(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().

template<unsigned SPACE_DIM>
std::ifstream PottsMeshReader< SPACE_DIM >::mNodesFile [private]
template<unsigned SPACE_DIM>
unsigned PottsMeshReader< SPACE_DIM >::mNodesRead [private]

Number of nodes read in by the reader.

Definition at line 78 of file PottsMeshReader.hpp.

Referenced by PottsMeshReader< SPACE_DIM >::GetNextNode(), and PottsMeshReader< SPACE_DIM >::Reset().

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

Number of elements in the mesh.

Definition at line 75 of file PottsMeshReader.hpp.

Referenced by PottsMeshReader< SPACE_DIM >::GetNumElements(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().

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

Is the number of attributes stored at each node.

Definition at line 84 of file PottsMeshReader.hpp.

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

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

Number of nodes in the mesh.

Definition at line 72 of file PottsMeshReader.hpp.

Referenced by PottsMeshReader< SPACE_DIM >::GetNumNodes(), and PottsMeshReader< SPACE_DIM >::ReadHeaders().


The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:07:20 2011 for Chaste by  doxygen 1.6.3