Public Member Functions | |
| BamgMeshReader (const std::string &filename, const MeshType &meshType, const bool bbAttr, int verbosity=0, const MPIComm &comm=MPIComm::world()) | |
| BamgMeshReader (const ParameterList ¶ms) | |
| virtual | ~BamgMeshReader () |
| virtual Mesh | fillMesh () const |
| virtual std::string | description () const |
| virtual RCP< MeshSourceBase > | getRcp () |
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 | readElems (Mesh &mesh, const Array< int > &nodeGID, Array< int > &elemGID, Array< int > &elemOwner) const |
| Mesh | readMesh (Array< int > &ptGID, Array< int > &ptOwner) const |
Private Attributes | |
| std::string | nodeFilename_ |
| std::string | elemFilename_ |
| std::string | parFilename_ |
| std::string | meshFilename_ |
| std::string | bbFilename_ |
| int | bbAttr_ |
BamgMeshReader reads a mesh stored in Frederic Hecht's g format.
!!The description below is for TriangleMeshReader & needs modification!!
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.
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
joe.node.nnn joe.ele.nnn joe.par.nnn 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:
rank numProcs numPoints ptLID ptGID ptOwnerRank numElems elemLID elemGID elemOwnerRank Definition at line 106 of file SundanceBamgMeshReader.hpp.
| BamgMeshReader::BamgMeshReader | ( | const std::string & | filename, |
| const MeshType & | meshType, | ||
| const bool | bbAttr, | ||
| int | verbosity = 0, |
||
| const MPIComm & | comm = MPIComm::world() |
||
| ) |
Definition at line 52 of file SundanceBamgMeshReader.cpp.
References bbFilename_, elemFilename_, meshFilename_, Sundance::MeshSourceBase::myRank(), nodeFilename_, Sundance::MeshSourceBase::nProc(), parFilename_, SUNDANCE_OUT, Sundance::toString(), and Playa::ObjectWithVerbosity::verb().
| BamgMeshReader::BamgMeshReader | ( | const ParameterList & | params | ) |
Construct from a ParameterList
Definition at line 94 of file SundanceBamgMeshReader.cpp.
References bbFilename_, elemFilename_, meshFilename_, Sundance::MeshSourceBase::myRank(), nodeFilename_, Sundance::MeshSourceBase::nProc(), parFilename_, SUNDANCE_OUT, Sundance::toString(), and Playa::ObjectWithVerbosity::verb().
| virtual Sundance::BamgMeshReader::~BamgMeshReader | ( | ) | [inline, virtual] |
virtual dtor
Definition at line 118 of file SundanceBamgMeshReader.hpp.
| virtual std::string Sundance::BamgMeshReader::description | ( | ) | const [inline, virtual] |
Print a short descriptive std::string
Reimplemented from Sundance::MeshSourceBase.
Definition at line 125 of file SundanceBamgMeshReader.hpp.
References Sundance::MeshReaderBase::filename().
| Mesh BamgMeshReader::fillMesh | ( | ) | const [virtual] |
Create a mesh
Implements Sundance::MeshSourceBase.
Definition at line 131 of file SundanceBamgMeshReader.cpp.
References readMesh(), and readParallelInfo().
| virtual RCP<MeshSourceBase> Sundance::BamgMeshReader::getRcp | ( | ) | [inline, virtual] |
Method for reading a .bb file Return a ref count pointer to self
Implements Playa::Handleable< MeshSourceBase >.
Definition at line 133 of file SundanceBamgMeshReader.hpp.
| void Sundance::BamgMeshReader::readElems | ( | Mesh & | mesh, |
| const Array< int > & | nodeGID, | ||
| Array< int > & | elemGID, | ||
| Array< int > & | elemOwner | ||
| ) | const [private] |
| Mesh BamgMeshReader::readMesh | ( | Array< int > & | ptGID, |
| Array< int > & | ptOwner | ||
| ) | const [private] |
add method that reads both nodes and elements from a single file
Definition at line 282 of file SundanceBamgMeshReader.cpp.
References Sundance::Mesh::addElement(), Sundance::Mesh::addVertex(), Sundance::MeshReaderBase::atof(), Sundance::MeshReaderBase::atoi(), bbAttr_, bbFilename_, Sundance::MeshSourceBase::createMesh(), Sundance::dimension(), Sundance::MeshSourceBase::elemAttributes(), meshFilename_, Sundance::MeshSourceBase::nodeAttributes(), Sundance::MeshReaderBase::openFile(), Sundance::Mesh::spatialDim(), SUNDANCE_OUT, and Playa::ObjectWithVerbosity::verb().
Referenced by fillMesh().
| Mesh Sundance::BamgMeshReader::readNodes | ( | Array< int > & | ptGID, |
| Array< int > & | ptOwner | ||
| ) | const [private] |
| void BamgMeshReader::readParallelInfo | ( | Array< int > & | ptGID, |
| Array< int > & | ptOwner, | ||
| Array< int > & | elemGID, | ||
| Array< int > & | elemOwner | ||
| ) | const [private] |
Definition at line 153 of file SundanceBamgMeshReader.cpp.
References Sundance::MeshReaderBase::atoi(), Sundance::MeshReaderBase::getNextLine(), Sundance::MeshSourceBase::myRank(), Sundance::MeshSourceBase::nProc(), Sundance::MeshReaderBase::openFile(), parFilename_, SUNDANCE_OUT, SUNDANCE_TRACE, and Playa::ObjectWithVerbosity::verb().
Referenced by fillMesh().
int Sundance::BamgMeshReader::bbAttr_ [private] |
number of bb Attributes
Definition at line 173 of file SundanceBamgMeshReader.hpp.
Referenced by readMesh().
std::string Sundance::BamgMeshReader::bbFilename_ [private] |
add a bb filename
Definition at line 170 of file SundanceBamgMeshReader.hpp.
Referenced by BamgMeshReader(), and readMesh().
std::string Sundance::BamgMeshReader::elemFilename_ [private] |
Definition at line 161 of file SundanceBamgMeshReader.hpp.
Referenced by BamgMeshReader().
std::string Sundance::BamgMeshReader::meshFilename_ [private] |
add a mesh filename
Definition at line 167 of file SundanceBamgMeshReader.hpp.
Referenced by BamgMeshReader(), and readMesh().
std::string Sundance::BamgMeshReader::nodeFilename_ [private] |
add method for reading a .bb file
Definition at line 158 of file SundanceBamgMeshReader.hpp.
Referenced by BamgMeshReader().
std::string Sundance::BamgMeshReader::parFilename_ [private] |
Definition at line 164 of file SundanceBamgMeshReader.hpp.
Referenced by BamgMeshReader(), and readParallelInfo().