Public Member Functions | Protected Member Functions | Private Attributes
Sundance::MeshReaderBase Class Reference

MeshReaderBase is a base class for mesh sources that get a mesh from a file. More...

Inheritance diagram for Sundance::MeshReaderBase:
Sundance::MeshSourceBase Sundance::Handleable< MeshSourceBase > Sundance::Printable Sundance::Noncopyable Sundance::ObjectWithClassVerbosity< MeshSourceBase > Sundance::DefaultObjectWithVerbosity Sundance::ObjectWithVerbosityBase Sundance::BamgMeshReader Sundance::ExodusMeshReader Sundance::ExodusNetCDFMeshReader Sundance::TriangleMeshReader

List of all members.

Public Member Functions

 MeshReaderBase (const std::string &filename, const MeshType &meshType, const MPIComm &comm)
 Construct with a filename.
 MeshReaderBase (const ParameterList &params)
 Construct from a parameter list.
virtual ~MeshReaderBase ()

Protected Member Functions

const std::string & filename () const
 access to the filename
int atoi (const std::string &x) const
 convert a std::string to its integer value
double atof (const std::string &x) const
 convert a std::string to its double value
bool isEmptyLine (const std::string &x) const
 Determine whether a line is empty.
RCP< std::ifstream > openFile (const std::string &fname, const std::string &description) const
 Open a file "fname" and check for success.
bool getNextLine (std::istream &is, std::string &line, Array< string > &tokens, char comment) const
 Read the next non-empty, non-comment line from a stream.

Private Attributes

std::string filename_
int nVertexVars_
Array< double > vertexVars_

Detailed Description

MeshReaderBase is a base class for mesh sources that get a mesh from a file.

It provides several utilities for parsing lines from mesh files.

Definition at line 47 of file SundanceMeshReaderBase.hpp.


Constructor & Destructor Documentation

Sundance::MeshReaderBase::MeshReaderBase ( const std::string &  filename,
const MeshType meshType,
const MPIComm &  comm 
) [inline]

Construct with a filename.

Definition at line 51 of file SundanceMeshReaderBase.hpp.

MeshReaderBase::MeshReaderBase ( const ParameterList &  params)

Construct from a parameter list.

Definition at line 14 of file SundanceMeshReaderBase.cpp.

References filename_.

virtual Sundance::MeshReaderBase::~MeshReaderBase ( ) [inline, virtual]

Definition at line 61 of file SundanceMeshReaderBase.hpp.


Member Function Documentation

double MeshReaderBase::atof ( const std::string &  x) const [protected]
int MeshReaderBase::atoi ( const std::string &  x) const [protected]
const std::string& Sundance::MeshReaderBase::filename ( ) const [inline, protected]
bool MeshReaderBase::getNextLine ( std::istream &  is,
std::string &  line,
Array< string > &  tokens,
char  comment 
) const [protected]

Read the next non-empty, non-comment line from a stream.

Parameters:
isthe stream from which to get the line
lineupon return, filled in with the line that was read
tokensarray of space-separated tokens in the line
commenta character indicating that everything after it is a comment

Definition at line 46 of file SundanceMeshReaderBase.cpp.

References isEmptyLine(), SUNDANCE_OUT, and Sundance::DefaultObjectWithVerbosity::verb().

Referenced by Sundance::ExodusNetCDFMeshReader::fillMesh(), Sundance::TriangleMeshReader::readElems(), Sundance::TriangleMeshReader::readNodes(), Sundance::TriangleMeshReader::readParallelInfo(), Sundance::ExodusMeshReader::readParallelInfo(), Sundance::BamgMeshReader::readParallelInfo(), and Sundance::TriangleMeshReader::readSides().

bool MeshReaderBase::isEmptyLine ( const std::string &  x) const [protected]

Determine whether a line is empty.

Definition at line 41 of file SundanceMeshReaderBase.cpp.

Referenced by getNextLine().

RCP< std::ifstream > MeshReaderBase::openFile ( const std::string &  fname,
const std::string &  description 
) const [protected]

Member Data Documentation

std::string Sundance::MeshReaderBase::filename_ [private]

Definition at line 96 of file SundanceMeshReaderBase.hpp.

Referenced by filename(), and MeshReaderBase().

Definition at line 97 of file SundanceMeshReaderBase.hpp.

Array<double> Sundance::MeshReaderBase::vertexVars_ [mutable, private]

Definition at line 98 of file SundanceMeshReaderBase.hpp.

Site Contact