www.mooseframework.org
MeshModifier.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef MESHMODIFIER_H
16 #define MESHMODIFIER_H
17 
18 #include "MooseObject.h"
19 #include "Restartable.h"
20 
21 // Forward declarations
22 class MeshModifier;
23 class MooseMesh;
24 
25 template <>
27 
31 class MeshModifier : public MooseObject, public Restartable
32 {
33 public:
40 
47  void modifyMesh(MooseMesh * mesh, MooseMesh * displaced_mesh);
48 
52  std::vector<std::string> & getDependencies() { return _depends_on; }
53 
54 protected:
59  virtual void initialize() {}
60 
65  virtual void modify() = 0;
66 
71  void modifyMeshHelper(MooseMesh * mesh);
72 
75 
76 private:
78  std::vector<std::string> _depends_on;
79 
81  const bool _force_prepare;
82 };
83 
84 #endif // MESHMODIFIER_H
virtual void modify()=0
Pure virtual modify function MUST be overridden by children classes.
std::vector< std::string > & getDependencies()
Return the MeshModifiers that must run before this MeshModifier.
Definition: MeshModifier.h:52
A class for creating restricted objects.
Definition: Restartable.h:31
const bool _force_prepare
Flag to determine if the mesh should be prepared after this modifier is run.
Definition: MeshModifier.h:81
MeshModifiers are objects that can modify or add to an existing mesh.
Definition: MeshModifier.h:31
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void initialize()
This method is called immediatly before modify to perform any necessary initialization on the modifif...
Definition: MeshModifier.h:59
MooseMesh * _mesh_ptr
Pointer to the mesh.
Definition: MeshModifier.h:74
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:36
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
void modifyMesh(MooseMesh *mesh, MooseMesh *displaced_mesh)
The base method called to trigger modification to the Mesh.
Definition: MeshModifier.C:47
MeshModifier(const InputParameters &parameters)
Constructor.
Definition: MeshModifier.C:37
std::vector< std::string > _depends_on
A list of modifiers that are required to run before this modifier may run.
Definition: MeshModifier.h:78
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
InputParameters validParams< MeshModifier >()
Definition: MeshModifier.C:20
void modifyMeshHelper(MooseMesh *mesh)
Utility for performing the same operation on both undiplaced and displaced meshes.
Definition: MeshModifier.C:60