www.mooseframework.org
MeshModifier.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "MooseObject.h"
13 #include "Restartable.h"
14 
15 // Forward declarations
16 class MeshModifier;
17 class MooseMesh;
18 
19 template <>
21 
25 class MeshModifier : public MooseObject, public Restartable
26 {
27 public:
34 
41  void modifyMesh(MooseMesh * mesh, MooseMesh * displaced_mesh);
42 
46  std::vector<std::string> & getDependencies() { return _depends_on; }
47 
48 protected:
53  virtual void initialize() {}
54 
59  virtual void modify() = 0;
60 
65  void modifyMeshHelper(MooseMesh * mesh);
66 
69 
70 private:
72  std::vector<std::string> _depends_on;
73 
75  const bool _force_prepare;
76 };
77 
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:46
A class for creating restricted objects.
Definition: Restartable.h:29
const bool _force_prepare
Flag to determine if the mesh should be prepared after this modifier is run.
Definition: MeshModifier.h:75
MeshModifiers are objects that can modify or add to an existing mesh.
Definition: MeshModifier.h:25
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:53
MooseMesh * _mesh_ptr
Pointer to the mesh.
Definition: MeshModifier.h:68
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
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:43
MeshModifier(const InputParameters &parameters)
Constructor.
Definition: MeshModifier.C:33
std::vector< std::string > _depends_on
A list of modifiers that are required to run before this modifier may run.
Definition: MeshModifier.h:72
InputParameters validParams< MeshModifier >()
Definition: MeshModifier.C:15
void modifyMeshHelper(MooseMesh *mesh)
Utility for performing the same operation on both undiplaced and displaced meshes.
Definition: MeshModifier.C:56