Public Member Functions | |
MeshSourceBase (const MeshType &meshType, int verbosity, const MPIComm &comm) | |
MeshSourceBase (const ParameterList ¶ms) | |
virtual | ~MeshSourceBase () |
Mesh | getMesh () const |
Extraction of attributes | |
void | getAttributes (RCP< Array< Array< double > > > &nodeAttributes, RCP< Array< Array< double > > > &elemAttributes) const |
Printable interface | |
virtual void | print (std::ostream &os) const |
Describable interface | |
virtual std::string | description () const |
const MPIComm & | comm () const |
Protected Member Functions | |
int | myRank () const |
int | nProc () const |
virtual Mesh | fillMesh () const =0 |
Mesh | createMesh (int dim) const |
RCP< Array< Array< double > > > & | nodeAttributes () const |
RCP< Array< Array< double > > > & | elemAttributes () const |
Private Attributes | |
Mesh | cachedMesh_ |
bool | hasCachedMesh_ |
MeshType | meshType_ |
MPIComm | comm_ |
RCP< Array< Array< double > > > | elemAttributes_ |
RCP< Array< Array< double > > > | nodeAttributes_ |
Mesh sources are constructed with a MPI communicator. If the communicator has more than one processor, the mesh created will be distributed.
The only method you will need to override is
virtual Mesh fillMesh() const
See the PartitionedLineMesher source code for a very simple example of how to write a mesh source subtype.
Optionally, you can override the description() method to provide more informative descriptive output than the std::string "MeshSourceBase[unknown subtype]".
Definition at line 79 of file SundanceMeshSourceBase.hpp.
Construct with a mesh type and MPI communicator
Definition at line 13 of file SundanceMeshSourceBase.cpp.
MeshSourceBase::MeshSourceBase | ( | const ParameterList & | params | ) |
Construct from a parameter list
Definition at line 26 of file SundanceMeshSourceBase.cpp.
virtual Sundance::MeshSourceBase::~MeshSourceBase | ( | ) | [inline, virtual] |
virtual dtor
Definition at line 95 of file SundanceMeshSourceBase.hpp.
const MPIComm& Sundance::MeshSourceBase::comm | ( | ) | const [inline] |
access to the MPI communicator
Definition at line 122 of file SundanceMeshSourceBase.hpp.
References comm_.
Referenced by Sundance::PartitionedLineMesher::fillMesh(), myRank(), nProc(), and Sundance::PartitionedRectangleMesher::PartitionedRectangleMesher().
Mesh MeshSourceBase::createMesh | ( | int | dim | ) | const [protected] |
createMesh() physically allocates the mesh object
Definition at line 64 of file SundanceMeshSourceBase.cpp.
References cachedMesh_, comm_, Sundance::MeshType::createEmptyMesh(), hasCachedMesh_, meshType_, Playa::Handle< PointerType >::ptr(), and Playa::ObjectWithVerbosity::verb().
Referenced by Sundance::PeanoMesher3D::fillMesh(), Sundance::PeanoMesher2D::fillMesh(), Sundance::PartitionedRectangleMesher::fillMesh(), Sundance::PartitionedLineMesher::fillMesh(), Sundance::OneTetMesher::fillMesh(), Sundance::OneTriangleMesher::fillMesh(), Sundance::HNMesher3D::fillMesh(), Sundance::HNMesher2D::fillMesh(), Sundance::ExodusNetCDFMeshReader::fillMesh(), Sundance::ExodusMeshReader::fillMesh(), Sundance::BamgMeshReader::readMesh(), and Sundance::TriangleMeshReader::readNodes().
virtual std::string Sundance::MeshSourceBase::description | ( | ) | const [inline, virtual] |
Print to a stream
Reimplemented in Sundance::BamgMeshReader, Sundance::ExodusMeshReader, Sundance::ExodusNetCDFMeshReader, Sundance::HNMesher2D, Sundance::HNMesher3D, Sundance::OneTriangleMesher, Sundance::OneTetMesher, Sundance::PartitionedLineMesher, Sundance::PartitionedRectangleMesher, Sundance::PeanoMesher2D, Sundance::PeanoMesher3D, Sundance::PeriodicLineMesher, and Sundance::TriangleMeshReader.
Definition at line 118 of file SundanceMeshSourceBase.hpp.
Referenced by print().
RCP<Array<Array<double> > >& Sundance::MeshSourceBase::elemAttributes | ( | ) | const [inline, protected] |
internal access to the element attributes
Definition at line 147 of file SundanceMeshSourceBase.hpp.
References elemAttributes_.
Referenced by Sundance::ExodusMeshReader::fillMesh(), Sundance::TriangleMeshReader::readElems(), and Sundance::BamgMeshReader::readMesh().
virtual Mesh Sundance::MeshSourceBase::fillMesh | ( | ) | const [protected, pure virtual] |
Fill a mesh object with data from the source. Subclass implementors will need to provide a fillMesh() for their subclass. Implementors should use the createMesh() method for the allocation of the new mesh.
Implemented in Sundance::BamgMeshReader, Sundance::ExodusMeshReader, Sundance::ExodusNetCDFMeshReader, Sundance::HNMesher2D, Sundance::HNMesher3D, Sundance::OneTriangleMesher, Sundance::OneTetMesher, Sundance::PartitionedLineMesher, Sundance::PartitionedRectangleMesher, Sundance::PeanoMesher2D, Sundance::PeanoMesher3D, Sundance::PeriodicLineMesher, and Sundance::TriangleMeshReader.
Referenced by getMesh().
void MeshSourceBase::getAttributes | ( | RCP< Array< Array< double > > > & | nodeAttributes, | |
RCP< Array< Array< double > > > & | elemAttributes | |||
) | const |
Definition at line 57 of file SundanceMeshSourceBase.cpp.
Mesh MeshSourceBase::getMesh | ( | ) | const |
Get a mesh from the source. If a mesh has already been created, this method will return the cached mesh, otherwise it will build on with a call to fillMesh()
Definition at line 37 of file SundanceMeshSourceBase.cpp.
References cachedMesh_, fillMesh(), hasCachedMesh_, Sundance::Mesh::numCells(), Sundance::Mesh::spatialDim(), and Playa::ObjectWithVerbosity::verb().
int Sundance::MeshSourceBase::myRank | ( | ) | const [inline, protected] |
Get processor rank
Definition at line 129 of file SundanceMeshSourceBase.hpp.
References comm(), and Playa::MPIComm::getRank().
Referenced by Sundance::BamgMeshReader::BamgMeshReader(), Sundance::ExodusMeshReader::ExodusMeshReader(), Sundance::PartitionedRectangleMesher::fillMesh(), Sundance::PartitionedLineMesher::fillMesh(), Sundance::TriangleMeshReader::readParallelInfo(), Sundance::ExodusMeshReader::readParallelInfo(), Sundance::BamgMeshReader::readParallelInfo(), and Sundance::TriangleMeshReader::TriangleMeshReader().
RCP<Array<Array<double> > >& Sundance::MeshSourceBase::nodeAttributes | ( | ) | const [inline, protected] |
internal access to the node attributes
Definition at line 143 of file SundanceMeshSourceBase.hpp.
References nodeAttributes_.
Referenced by Sundance::ExodusMeshReader::fillMesh(), Sundance::BamgMeshReader::readMesh(), and Sundance::TriangleMeshReader::readNodes().
int Sundance::MeshSourceBase::nProc | ( | ) | const [inline, protected] |
Get number of processors
Definition at line 131 of file SundanceMeshSourceBase.hpp.
References comm(), and Playa::MPIComm::getNProc().
Referenced by Sundance::BamgMeshReader::BamgMeshReader(), Sundance::ExodusMeshReader::ExodusMeshReader(), Sundance::ExodusNetCDFMeshReader::ExodusNetCDFMeshReader(), Sundance::PartitionedRectangleMesher::fillMesh(), Sundance::PartitionedLineMesher::fillMesh(), Sundance::ExodusMeshReader::fillMesh(), Sundance::TriangleMeshReader::readElems(), Sundance::TriangleMeshReader::readNodes(), Sundance::TriangleMeshReader::readParallelInfo(), Sundance::ExodusMeshReader::readParallelInfo(), Sundance::BamgMeshReader::readParallelInfo(), and Sundance::TriangleMeshReader::TriangleMeshReader().
virtual void Sundance::MeshSourceBase::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print to a stream
Implements Playa::Printable.
Definition at line 112 of file SundanceMeshSourceBase.hpp.
References description().
Mesh Sundance::MeshSourceBase::cachedMesh_ [mutable, private] |
Definition at line 155 of file SundanceMeshSourceBase.hpp.
Referenced by createMesh(), and getMesh().
MPIComm Sundance::MeshSourceBase::comm_ [private] |
RCP<Array<Array<double> > > Sundance::MeshSourceBase::elemAttributes_ [mutable, private] |
bool Sundance::MeshSourceBase::hasCachedMesh_ [mutable, private] |
Definition at line 158 of file SundanceMeshSourceBase.hpp.
Referenced by createMesh(), and getMesh().
MeshType Sundance::MeshSourceBase::meshType_ [private] |
RCP<Array<Array<double> > > Sundance::MeshSourceBase::nodeAttributes_ [mutable, private] |