Public Member Functions | |
| MeshTransformationBase (const MeshType &meshType) | |
| virtual | ~MeshTransformationBase () |
| virtual Mesh | apply (const Mesh &inputMesh) const =0 |
Printable interface | |
| virtual void | print (std::ostream &os) const |
Describable interface | |
| virtual std::string | description () const |
Protected Member Functions | |
| Mesh | createMesh (int dim, const MPIComm &comm) const |
Private Attributes | |
| MeshType | meshType_ |
MeshSourceBase provides the internal interface for mesh filters, i.e., objects that take an input mesh and produce a new mesh. Examples of filter operations are refinement, load balancing, and extrusion from 2D to 3D. The action of a mesh filter should be independent of the internal mesh representation used. To allow user-level specification of the type of internal mesh representation to be used, a MeshTransformationBase is constructed with a MeshType object which acts as a factory to produce empty output meshes.
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 apply(const Mesh& inputMesh) const = 0 which is where you do the filter action and return an output mesh. This method should usually physically create the mesh with a call to createMesh(), ensuring that the correct mesh representation type is created using the MeshType factory with which the filter was constructed.
See the ExtrustionMeshTransformation source code for a very simple example of how to write a mesh filter subtype.
Optionally, you can override the description() method to provide more informative descriptive output than the std::string "MeshTransformationBase[unknown subtype]".
Definition at line 91 of file SundanceMeshTransformationBase.hpp.
| Sundance::MeshTransformationBase::MeshTransformationBase | ( | const MeshType & | meshType | ) | [inline] |
Construct with a mesh type, which specifies the type of mesh to be built when the filter is applied.
Definition at line 100 of file SundanceMeshTransformationBase.hpp.
| virtual Sundance::MeshTransformationBase::~MeshTransformationBase | ( | ) | [inline, virtual] |
virtual dtor
Definition at line 104 of file SundanceMeshTransformationBase.hpp.
| virtual Mesh Sundance::MeshTransformationBase::apply | ( | const Mesh & | inputMesh | ) | const [pure virtual] |
Apply the filter to the given input mesh, producing an output mesh
Implemented in Sundance::ExtrusionMeshTransformation, and Sundance::RefinementTransformation.
| Mesh MeshTransformationBase::createMesh | ( | int | dim, |
| const MPIComm & | comm | ||
| ) | const [protected] |
createMesh() allocates the mesh object with a call to meshType's createMesh() method.
Definition at line 51 of file SundanceMeshTransformationBase.cpp.
References Sundance::MeshType::createEmptyMesh(), and meshType_.
Referenced by Sundance::ExtrusionMeshTransformation::apply().
| virtual std::string Sundance::MeshTransformationBase::description | ( | ) | const [inline, virtual] |
Print to a stream
Reimplemented in Sundance::ExtrusionMeshTransformation.
Definition at line 120 of file SundanceMeshTransformationBase.hpp.
Referenced by print().
| virtual void Sundance::MeshTransformationBase::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print to a stream
Implements Playa::Printable.
Definition at line 114 of file SundanceMeshTransformationBase.hpp.
References description().
Reimplemented in Sundance::RefinementTransformation.
Definition at line 132 of file SundanceMeshTransformationBase.hpp.
Referenced by createMesh().