Public Member Functions | Private Member Functions | Private Attributes
Sundance::TriangleMeshReader Class Reference

TriangleMeshReader reads a mesh stored in Shewchuk's Triangle format. More...

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

List of all members.

Public Member Functions

 TriangleMeshReader (const std::string &filename, const MeshType &meshType, const MPIComm &comm=MPIComm::world())
 TriangleMeshReader (const ParameterList &params)
 Construct from a ParameterList.
virtual ~TriangleMeshReader ()
 virtual dtor
virtual Mesh fillMesh () const
 Create a mesh.
virtual std::string description () const
 Print a short descriptive std::string.
virtual RCP< MeshSourceBasegetRcp ()
 Return a ref count pointer to self.

Private Member Functions

void readParallelInfo (Array< int > &ptGID, Array< int > &ptOwner, Array< int > &elemGID, Array< int > &elemOwner) const
Mesh readNodes (Array< int > &ptGID, Array< int > &ptOwner) const
void readSides (Mesh &mesh) const
void readElems (Mesh &mesh, const Array< int > &nodeGID, Array< int > &elemGID, Array< int > &elemOwner) const

Private Attributes

std::string nodeFilename_
std::string elemFilename_
std::string parFilename_
std::string sideFilename_
int offset_

Detailed Description

TriangleMeshReader reads a mesh stored in Shewchuk's Triangle format.

This format is documented at the Triangle homepage. This reader expects to find node information in .node files and element information in .ele files. The filename constructor argument is the stem of the filenames, and so that a reader constructed with filename joe will look for node and element data in joe.node and joe.ele respectively. Node and element attributes are read if present, and can be accessed with the getAttributes() method of MeshSource.

Parallel extensions

We have extended the Triangle format to deal with distributed meshes. A TriangleMeshReader is constructed with an MPIComm object, and if that communicator has more than one processor the mesh is assumed to be split into files, one for each processor. Data on mesh "joe" for the nnn-th processor will be found in the files

The .node.nnn and .ele.nnn files contain the node and element data for the part of the mesh seen by the nnn-th processor. The node and element numberings given in those two files are local indexes. The .par.nnn contains node and element ownership information for the part of the mesh seen by the nnn-th processor.


A .par file is formatted as follows:

Definition at line 89 of file SundanceTriangleMeshReader.hpp.


Constructor & Destructor Documentation

TriangleMeshReader::TriangleMeshReader ( const std::string &  filename,
const MeshType meshType,
const MPIComm &  comm = MPIComm::world() 
)
TriangleMeshReader::TriangleMeshReader ( const ParameterList &  params)
virtual Sundance::TriangleMeshReader::~TriangleMeshReader ( ) [inline, virtual]

virtual dtor

Definition at line 101 of file SundanceTriangleMeshReader.hpp.


Member Function Documentation

virtual std::string Sundance::TriangleMeshReader::description ( ) const [inline, virtual]

Print a short descriptive std::string.

Reimplemented from Sundance::MeshSourceBase.

Definition at line 108 of file SundanceTriangleMeshReader.hpp.

References Sundance::MeshReaderBase::filename().

Mesh TriangleMeshReader::fillMesh ( ) const [virtual]

Create a mesh.

Implements Sundance::MeshSourceBase.

Definition at line 77 of file SundanceTriangleMeshReader.cpp.

References readElems(), readNodes(), readParallelInfo(), and readSides().

virtual RCP<MeshSourceBase> Sundance::TriangleMeshReader::getRcp ( ) [inline, virtual]

Return a ref count pointer to self.

Implements Sundance::Handleable< MeshSourceBase >.

Definition at line 113 of file SundanceTriangleMeshReader.hpp.

void TriangleMeshReader::readElems ( Mesh mesh,
const Array< int > &  nodeGID,
Array< int > &  elemGID,
Array< int > &  elemOwner 
) const [private]
Mesh TriangleMeshReader::readNodes ( Array< int > &  ptGID,
Array< int > &  ptOwner 
) const [private]
void TriangleMeshReader::readParallelInfo ( Array< int > &  ptGID,
Array< int > &  ptOwner,
Array< int > &  elemGID,
Array< int > &  elemOwner 
) const [private]
void TriangleMeshReader::readSides ( Mesh mesh) const [private]

Member Data Documentation

Definition at line 137 of file SundanceTriangleMeshReader.hpp.

Referenced by readElems(), and TriangleMeshReader().

Definition at line 134 of file SundanceTriangleMeshReader.hpp.

Referenced by readNodes(), and TriangleMeshReader().

int Sundance::TriangleMeshReader::offset_ [mutable, private]

Definition at line 146 of file SundanceTriangleMeshReader.hpp.

Referenced by readElems(), and readNodes().

Definition at line 143 of file SundanceTriangleMeshReader.hpp.

Referenced by readSides(), and TriangleMeshReader().

Site Contact