www.mooseframework.org
SetupMeshCompleteAction.C
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 
16 #include "MooseMesh.h"
17 #include "Moose.h"
18 #include "Adaptivity.h"
19 #include "MooseApp.h"
20 
21 template <>
24 {
26  return params;
27 }
28 
30 
31 bool
33 {
34  bool prepared = mesh->prepared();
35 
36  if (!prepared)
37  mesh->prepare();
38 
39  // Clear the modifiers, they are not used again during the simulation after the mesh has been
40  // completed
42 
43  return prepared;
44 }
45 
46 void
48 {
49  if (!_mesh)
50  mooseError("No mesh file was supplied and no generation block was provided");
51 
52  if (_current_task == "execute_mesh_modifiers")
53  {
55  }
56  else if (_current_task == "uniform_refine_mesh")
57  {
64  if (_app.setFileRestart() == false && _app.isRecovering() == false)
65  {
67 
68  if (_displaced_mesh)
70  }
71  }
72  else
73  {
74  // Prepare the mesh (may occur multiple times)
75  completeSetup(_mesh.get());
76 
77  if (_displaced_mesh)
79  }
80 }
bool & setFileRestart()
This method is here so we can determine whether or not we need to use a separate reader to read the m...
Definition: MooseApp.h:271
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:608
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
SetupMeshCompleteAction(InputParameters params)
InputParameters validParams< SetupMeshCompleteAction >()
void executeMeshModifiers()
Execute and clear the Mesh Modifiers data structure.
Definition: MooseApp.C:1160
bool completeSetup(MooseMesh *mesh)
Base class for actions.
Definition: Action.h:39
static void uniformRefine(MooseMesh *mesh)
Performs uniform refinement of the passed Mesh object.
Definition: Adaptivity.C:205
std::shared_ptr< MooseMesh > & _displaced_mesh
Definition: Action.h:128
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
const std::string & _current_task
The current action (even though we have seperate instances for each action)
Definition: Action.h:125
void clearMeshModifiers()
Clear all mesh modifers.
Definition: MooseApp.C:1208
void prepare(bool force=false)
Calls prepare_for_use() if force=true on the underlying Mesh object, then communicates various bounda...
Definition: MooseMesh.C:311
virtual void act() override
std::shared_ptr< MooseMesh > & _mesh
Definition: Action.h:127
MooseApp & _app
The MOOSE application this is associated with.
Definition: Action.h:98
bool prepared() const
Setter/getter for the _is_prepared flag.
Definition: MooseMesh.C:2086
InputParameters validParams< Action >()
Definition: Action.C:23