www.mooseframework.org
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
SetupMeshAction Class Reference

#include <SetupMeshAction.h>

Inheritance diagram for SetupMeshAction:
[legend]

Public Member Functions

 SetupMeshAction (InputParameters params)
 
virtual void act () override
 Method to add objects to the simulation or perform other setup tasks. More...
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type) override
 Method to add a relationship manager for the objects being added to the system. More...
 
InputParametersgetObjectParams ()
 Retreive the parameters of the object to be created by this action. More...
 
const InputParametersgetObjectParams () const
 Constant version of retreiving the parameters of the object to be created by this action. More...
 
const std::string & getMooseObjectType () const
 Return the object type to be created. More...
 
void timedAct ()
 The method called externally that causes the action to act() More...
 
const std::string & name () const
 The name of the action. More...
 
const std::string & type () const
 
InputParametersparameters ()
 
const InputParametersparameters () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
template<typename T >
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 Verifies that the requested parameter exists and is not NULL and returns it to the caller. More...
 
bool isParamValid (const std::string &name) const
 
void appendTask (const std::string &task)
 
template<typename... Args>
void paramError (const std::string &param, Args... args)
 Emits an error prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void paramWarning (const std::string &param, Args... args)
 Emits a warning prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void paramInfo (const std::string &param, Args... args)
 Emits an informational message prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
std::string getBaseName () const
 Deprecated name methods, use name() More...
 
std::string getShortName () const
 DEPRECATED METHODS. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Member Functions

PerfID registerTimedSection (const std::string &section_name, const unsigned int level)
 Call to register a named section for timing. More...
 

Protected Attributes

std::string _type
 The Object type that is being created. More...
 
InputParameters _moose_object_pars
 The parameters for the object to be created. More...
 
InputParameters _pars
 Input parameters for the action. More...
 
std::string _registered_identifier
 
std::string _name
 The name of the action. More...
 
std::string _action_type
 
MooseApp_app
 The MOOSE application this is associated with. More...
 
Factory_factory
 The Factory associated with the MooseApp. More...
 
ActionFactory_action_factory
 Builds Actions. More...
 
std::string _specific_task_name
 This member will only be populated if this Action instance is only designed to handle one task. More...
 
std::set< std::string > _all_tasks
 A list of all the tasks that this Action will satisfy. More...
 
ActionWarehouse_awh
 Reference to ActionWarehouse where we store object build by actions. More...
 
const std::string & _current_task
 The current action (even though we have seperate instances for each action) More...
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 Convenience reference to a problem this action works on. More...
 
PerfID _act_timer
 Timers. More...
 
const InputParameters_pg_params
 Params. More...
 
PerfGraph_perf_graph
 The performance graph to add to. More...
 
std::string _prefix
 A prefix to use for all sections. More...
 

Private Member Functions

void setupMesh (MooseMesh *mesh)
 

Detailed Description

Definition at line 22 of file SetupMeshAction.h.

Constructor & Destructor Documentation

◆ SetupMeshAction()

SetupMeshAction::SetupMeshAction ( InputParameters  params)

Definition at line 88 of file SetupMeshAction.C.

88 : MooseObjectAction(params) {}
MooseObjectAction(InputParameters params)

Member Function Documentation

◆ act()

void SetupMeshAction::act ( )
overridevirtual

Method to add objects to the simulation or perform other setup tasks.

Implements Action.

Definition at line 165 of file SetupMeshAction.C.

166 {
167  // Create the mesh object and tell it to build itself
168  if (_current_task == "setup_mesh")
169  {
170  // switch non-file meshes to be a file-mesh if using a pre-split mesh configuration.
171  if (_app.isUseSplit())
172  {
173  auto split_file = _app.parameters().get<std::string>("split_file");
174 
175  // Get the split_file extension, if there is one, and use that to decide
176  // between .cpr and .cpa
177  std::string split_file_ext;
178  auto pos = split_file.rfind(".");
179  if (pos != std::string::npos)
180  split_file_ext = split_file.substr(pos + 1, std::string::npos);
181 
182  // If split_file already has the .cpr or .cpa extension, we go with
183  // that, otherwise we strip off the extension and append ".cpr".
184  if (split_file != "" && split_file_ext != "cpr" && split_file_ext != "cpa")
185  split_file = MooseUtils::stripExtension(split_file) + ".cpr";
186 
187  if (_type != "FileMesh")
188  {
189  if (split_file == "")
190  {
191  if (_app.processor_id() == 0)
192  mooseError(
193  "Cannot use split mesh for a non-file mesh without specifying --split-file on "
194  "command line");
195  }
196 
197  _type = "FileMesh";
198  auto new_pars = validParams<FileMesh>();
199 
200  // Keep existing parameters where possible
202 
203  new_pars.set<MeshFileName>("file") = split_file;
204  new_pars.set<MooseApp *>("_moose_app") = _moose_object_pars.get<MooseApp *>("_moose_app");
205  _moose_object_pars = new_pars;
206  }
207  else
208  {
209  if (split_file != "")
210  _moose_object_pars.set<MeshFileName>("file") = split_file;
211  else
212  _moose_object_pars.set<MeshFileName>("file") =
213  MooseUtils::stripExtension(_moose_object_pars.get<MeshFileName>("file")) + ".cpr";
214  }
215  }
216 
218  if (isParamValid("displacements") && getParam<bool>("use_displaced_mesh"))
220  }
221  else if (_current_task == "init_mesh")
222  {
223  _mesh->init();
224 
225  if (isParamValid("displacements") && getParam<bool>("use_displaced_mesh"))
226  {
227  // Initialize the displaced mesh
228  _displaced_mesh->init();
229 
230  std::vector<std::string> displacements = getParam<std::vector<std::string>>("displacements");
231  if (displacements.size() < _displaced_mesh->dimension())
232  mooseError(
233  "Number of displacements must be greater than or equal to the dimension of the mesh!");
234  }
235 
236  setupMesh(_mesh.get());
237 
238  if (_displaced_mesh)
239  setupMesh(_displaced_mesh.get());
240  }
241 }
bool isParamValid(const std::string &name) const
Definition: Action.h:101
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
InputParameters & parameters()
Get the parameters of the object.
Definition: MooseApp.h:85
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for MOOSE-based applications.
Definition: MooseApp.h:58
std::string stripExtension(const std::string &s)
Removes any file extension from the fiven string s (i.e.
Definition: MooseUtils.C:277
Factory & _factory
The Factory associated with the MooseApp.
Definition: Action.h:173
std::shared_ptr< MooseMesh > & _displaced_mesh
Definition: Action.h:200
bool isUseSplit() const
Whether or not we are running with pre-split (distributed mesh)
Definition: MooseApp.C:870
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:72
const std::string & _current_task
The current action (even though we have seperate instances for each action)
Definition: Action.h:197
void applyParameters(const InputParameters &common, std::vector< std::string > exclude=std::vector< std::string >())
Method for applying common parameters.
void setupMesh(MooseMesh *mesh)
std::shared_ptr< MooseMesh > & _mesh
Definition: Action.h:199
std::string _type
The Object type that is being created.
InputParameters validParams< FileMesh >()
Definition: FileMesh.C:24
InputParameters _moose_object_pars
The parameters for the object to be created.
processor_id_type processor_id()
Definition: MooseApp.h:281
MooseApp & _app
The MOOSE application this is associated with.
Definition: Action.h:170

◆ addRelationshipManagers()

void MooseObjectAction::addRelationshipManagers ( Moose::RelationshipManagerType  when_type)
overridevirtualinherited

Method to add a relationship manager for the objects being added to the system.

Relationship managers have to be added relatively early. In many cases before the Action::act() method is called.

Parameters
when_typeThe parameter indicating the normal time for adding either Geometric or Algebraic RelationshipManagers. It may not always be possible to add your RelationshipManager as early as you'd like. In these cases, your DistributedMesh may consume more memory during the problem setup.

This method is always called twice. Once to attempt adding early RMs and once to add late RMs. For generic MooseObjects, we'd like to add RMs as early as possible, but we'll have to be careful not to add them twice!

Reimplemented from Action.

Definition at line 46 of file MooseObjectAction.C.

47 {
48  const auto & buildable_types = _moose_object_pars.getBuildableRelationshipManagerTypes();
49 
50  for (const auto & buildable_type : buildable_types)
51  {
57  auto new_name = name() + '_' + buildable_type.first + "_rm";
58  if (_app.hasRelationshipManager(new_name))
59  continue;
60 
61  auto rm_params = _factory.getValidParams(buildable_type.first);
63  rm_params.set<MooseMesh *>("mesh") = _mesh.get();
64  rm_params.set<Moose::RelationshipManagerType>("rm_type") = buildable_type.second;
65 
66  if (rm_params.areAllRequiredParamsValid())
67  {
68  auto rm_obj = _factory.create<RelationshipManager>(buildable_type.first, new_name, rm_params);
69 
70  // Delete the resources created on behalf of the RM if it ends up not being added to the App.
71  if (!_app.addRelationshipManager(rm_obj))
73  }
74  }
75 }
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
RelationshipManagerType
Main types of Relationship Managers.
Definition: MooseTypes.h:569
const std::string & name() const
The name of the action.
Definition: Action.h:62
if(nl->nonlinearSolver() ->matvec &&nl->nonlinearSolver() ->residual_and_jacobian_object)
InputParameters getValidParams(const std::string &name)
Get valid parameters for the object.
Definition: Factory.C:67
bool hasRelationshipManager(const std::string &name) const
Returns a Boolean indicating whether a RelationshipManater exists with the same name.
Definition: MooseApp.C:1698
Factory & _factory
The Factory associated with the MooseApp.
Definition: Action.h:173
bool addRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Transfers ownership of a RelationshipManager to the application for lifetime management.
Definition: MooseApp.C:1708
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:72
void applyParameters(const InputParameters &common, std::vector< std::string > exclude=std::vector< std::string >())
Method for applying common parameters.
void releaseSharedObjects(const MooseObject &moose_object, THREAD_ID tid=0)
Releases any shared resources created as a side effect of creating an object through the Factory::cre...
Definition: Factory.C:166
std::shared_ptr< MooseMesh > & _mesh
Definition: Action.h:199
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
InputParameters _moose_object_pars
The parameters for the object to be created.
MooseApp & _app
The MOOSE application this is associated with.
Definition: Action.h:170
const std::vector< std::pair< std::string, Moose::RelationshipManagerType > > & getBuildableRelationshipManagerTypes() const
Returns the list of buildable (or required) RelationshipManager object types for this object...

◆ appendTask()

void Action::appendTask ( const std::string &  task)
inlineinherited

Definition at line 103 of file Action.h.

103 { _all_tasks.insert(task); }
std::set< std::string > _all_tasks
A list of all the tasks that this Action will satisfy.
Definition: Action.h:191

◆ getAllTasks()

const std::set<std::string>& Action::getAllTasks ( ) const
inlineinherited

Definition at line 79 of file Action.h.

Referenced by AddKernelAction::act().

79 { return _all_tasks; }
std::set< std::string > _all_tasks
A list of all the tasks that this Action will satisfy.
Definition: Action.h:191

◆ getBaseName()

std::string Action::getBaseName ( ) const
inherited

Deprecated name methods, use name()

Definition at line 100 of file Action.C.

101 {
102  mooseDeprecated("getBaseName() is deprecated.");
103  return MooseUtils::baseName(_name);
104 }
std::string _name
The name of the action.
Definition: Action.h:164
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:237
std::string baseName(const std::string &name)
Function for string the information before the final / in a parser block.
Definition: MooseUtils.C:366

◆ getCheckedPointerParam()

template<typename T >
T Action::getCheckedPointerParam ( const std::string &  name,
const std::string &  error_string = "" 
) const
inlineinherited

Verifies that the requested parameter exists and is not NULL and returns it to the caller.

The template parameter must be a pointer or an error will be thrown.

Definition at line 96 of file Action.h.

97  {
98  return parameters().getCheckedPointerParam<T>(name, error_string);
99  }
const std::string & name() const
The name of the action.
Definition: Action.h:62
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
InputParameters & parameters()
Definition: Action.h:74

◆ getMooseObjectType()

const std::string& MooseObjectAction::getMooseObjectType ( ) const
inlineinherited

Return the object type to be created.

Definition at line 42 of file MooseObjectAction.h.

Referenced by CommonOutputAction::hasConsole().

42 { return _type; }
std::string _type
The Object type that is being created.

◆ getObjectParams() [1/2]

InputParameters& MooseObjectAction::getObjectParams ( )
inlineinherited

Retreive the parameters of the object to be created by this action.

Definition at line 32 of file MooseObjectAction.h.

Referenced by CreateProblemDefaultAction::act(), MaterialOutputAction::act(), CommonOutputAction::create(), AddVariableAction::createInitialConditionAction(), MooseApp::getCheckpointDirectories(), CommonOutputAction::hasConsole(), ActionWarehouse::printInputFile(), and Parser::walkRaw().

32 { return _moose_object_pars; }
InputParameters _moose_object_pars
The parameters for the object to be created.

◆ getObjectParams() [2/2]

const InputParameters& MooseObjectAction::getObjectParams ( ) const
inlineinherited

Constant version of retreiving the parameters of the object to be created by this action.

Definition at line 37 of file MooseObjectAction.h.

37 { return _moose_object_pars; }
InputParameters _moose_object_pars
The parameters for the object to be created.

◆ getParam()

template<typename T >
const T & Action::getParam ( const std::string &  name) const
inherited

Retrieve a parameter for the object.

Parameters
nameThe name of the parameter
Returns
The value of the parameter

Definition at line 211 of file Action.h.

Referenced by CreateDisplacedProblemAction::act(), AddPeriodicBCAction::act(), AddPeriodicBCAction::autoTranslationBoundaries(), DynamicObjectRegistrationAction::DynamicObjectRegistrationAction(), and MooseApp::getCheckpointDirectories().

212 {
213  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
214 }
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const std::string & name() const
The name of the action.
Definition: Action.h:62
InputParameters _pars
Input parameters for the action.
Definition: Action.h:158

◆ getShortName()

std::string Action::getShortName ( ) const
inherited

DEPRECATED METHODS.

Definition at line 93 of file Action.C.

94 {
95  mooseDeprecated("getShortName() is deprecated.");
97 }
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:360
std::string _name
The name of the action.
Definition: Action.h:164
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:237

◆ isParamValid()

bool Action::isParamValid ( const std::string &  name) const
inlineinherited

Definition at line 101 of file Action.h.

Referenced by CopyNodalVarsAction::act(), SetAdaptivityOptionsAction::act(), act(), CreateDisplacedProblemAction::act(), AddAuxVariableAction::act(), AddVariableAction::act(), AddVariableAction::addVariable(), AddPeriodicBCAction::autoTranslationBoundaries(), DynamicObjectRegistrationAction::DynamicObjectRegistrationAction(), and setupMesh().

101 { return _pars.isParamValid(name); }
const std::string & name() const
The name of the action.
Definition: Action.h:62
InputParameters _pars
Input parameters for the action.
Definition: Action.h:158
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ name()

const std::string& Action::name ( ) const
inlineinherited

◆ paramError()

template<typename... Args>
void Action::paramError ( const std::string &  param,
Args...  args 
)
inlineinherited

Emits an error prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message.

If this object's parameters were not created directly by the Parser, then this function falls back to the normal behavior of mooseError - only printing a message using the given args.

Definition at line 112 of file Action.h.

113  {
114  auto prefix = param + ": ";
115  if (!_pars.inputLocation(param).empty())
116  prefix = _pars.inputLocation(param) + ": (" + _pars.paramFullpath(param) + "):\n";
117  mooseError(prefix, args...);
118  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
InputParameters _pars
Input parameters for the action.
Definition: Action.h:158
const std::string & inputLocation(const std::string &param) const
Get/set a string representing the location in the input text the parameter originated from (i...
const std::string & paramFullpath(const std::string &param) const
Get/set a string representing the full HIT parameter path from the input file (e.g.

◆ parameters() [1/2]

InputParameters& Action::parameters ( )
inlineinherited

Definition at line 74 of file Action.h.

Referenced by Action::getCheckedPointerParam(), GlobalParamsAction::remove(), GlobalParamsAction::setDoubleIndexParam(), GlobalParamsAction::setScalarParam(), and GlobalParamsAction::setVectorParam().

74 { return _pars; }
InputParameters _pars
Input parameters for the action.
Definition: Action.h:158

◆ parameters() [2/2]

const InputParameters& Action::parameters ( ) const
inlineinherited

Definition at line 75 of file Action.h.

75 { return _pars; }
InputParameters _pars
Input parameters for the action.
Definition: Action.h:158

◆ paramInfo()

template<typename... Args>
void Action::paramInfo ( const std::string &  param,
Args...  args 
)
inlineinherited

Emits an informational message prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message.

If this object's parameters were not created directly by the Parser, then this function falls back to the normal behavior of mooseInfo - only printing a message using the given args.

Definition at line 143 of file Action.h.

144  {
145  auto prefix = param + ": ";
146  if (!_pars.inputLocation(param).empty())
147  prefix = _pars.inputLocation(param) + ": (" + _pars.paramFullpath(param) + "):\n";
148  mooseInfo(prefix, args...);
149  }
void mooseInfo(Args &&... args)
Emit an informational message with the given stringified, concatenated args.
Definition: MooseError.h:253
InputParameters _pars
Input parameters for the action.
Definition: Action.h:158
const std::string & inputLocation(const std::string &param) const
Get/set a string representing the location in the input text the parameter originated from (i...
const std::string & paramFullpath(const std::string &param) const
Get/set a string representing the full HIT parameter path from the input file (e.g.

◆ paramWarning()

template<typename... Args>
void Action::paramWarning ( const std::string &  param,
Args...  args 
)
inlineinherited

Emits a warning prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message.

If this object's parameters were not created directly by the Parser, then this function falls back to the normal behavior of mooseWarning - only printing a message using the given args.

Definition at line 127 of file Action.h.

128  {
129  auto prefix = param + ": ";
130  if (!_pars.inputLocation(param).empty())
131  prefix = _pars.inputLocation(param) + ": (" + _pars.paramFullpath(param) + "):\n";
132  mooseWarning(prefix, args...);
133  }
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:220
InputParameters _pars
Input parameters for the action.
Definition: Action.h:158
const std::string & inputLocation(const std::string &param) const
Get/set a string representing the location in the input text the parameter originated from (i...
const std::string & paramFullpath(const std::string &param) const
Get/set a string representing the full HIT parameter path from the input file (e.g.

◆ registerTimedSection()

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level 
)
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
Returns
The ID of the section - use when starting timing

Definition at line 50 of file PerfGraphInterface.C.

51 {
52  if (_prefix != "")
53  return _perf_graph.registerSection(_prefix + "::" + section_name, level);
54  else
55  return _perf_graph.registerSection(section_name, level);
56 }
PerfGraph & _perf_graph
The performance graph to add to.
std::string _prefix
A prefix to use for all sections.
PerfID registerSection(const std::string &section_name, unsigned int level)
Registers a named section of code.
Definition: PerfGraph.C:41

◆ setupMesh()

void SetupMeshAction::setupMesh ( MooseMesh mesh)
private

Definition at line 91 of file SetupMeshAction.C.

Referenced by act().

92 {
93  std::vector<BoundaryName> ghosted_boundaries =
94  getParam<std::vector<BoundaryName>>("ghosted_boundaries");
95 
96  for (const auto & bnd_name : ghosted_boundaries)
97  mesh->addGhostedBoundary(mesh->getBoundaryID(bnd_name));
98 
99  if (isParamValid("ghosted_boundaries_inflation"))
100  {
101  std::vector<Real> ghosted_boundaries_inflation =
102  getParam<std::vector<Real>>("ghosted_boundaries_inflation");
103  mesh->setGhostedBoundaryInflation(ghosted_boundaries_inflation);
104  }
105 
106  mesh->ghostGhostedBoundaries();
107 
108  if (getParam<bool>("second_order"))
109  mesh->getMesh().all_second_order(true);
110 
111 #ifdef LIBMESH_ENABLE_AMR
112  unsigned int level = getParam<unsigned int>("uniform_refine");
113 
114  // Did they specify extra refinement levels on the command-line?
115  level += _app.getParam<unsigned int>("refinements");
116 
117  mesh->setUniformRefineLevel(level);
118 #endif // LIBMESH_ENABLE_AMR
119 
120  // Add entity names to the mesh
121  if (_pars.isParamValid("block_id") && _pars.isParamValid("block_name"))
122  {
123  std::vector<SubdomainID> ids = getParam<std::vector<SubdomainID>>("block_id");
124  std::vector<SubdomainName> names = getParam<std::vector<SubdomainName>>("block_name");
125  std::set<SubdomainName> seen_it;
126 
127  if (ids.size() != names.size())
128  mooseError("You must supply the same number of block ids and names parameters");
129 
130  for (unsigned int i = 0; i < ids.size(); ++i)
131  {
132  if (seen_it.find(names[i]) != seen_it.end())
133  mooseError("The following dynamic block name is not unique: " + names[i]);
134  seen_it.insert(names[i]);
135  mesh->setSubdomainName(ids[i], names[i]);
136  }
137  }
138  if (_pars.isParamValid("boundary_id") && _pars.isParamValid("boundary_name"))
139  {
140  std::vector<BoundaryID> ids = getParam<std::vector<BoundaryID>>("boundary_id");
141  std::vector<BoundaryName> names = getParam<std::vector<BoundaryName>>("boundary_name");
142  std::set<SubdomainName> seen_it;
143 
144  if (ids.size() != names.size())
145  mooseError("You must supply the same number of boundary ids and names parameters");
146 
147  for (unsigned int i = 0; i < ids.size(); ++i)
148  {
149  if (seen_it.find(names[i]) != seen_it.end())
150  mooseError("The following dynamic boundary name is not unique: " + names[i]);
151  mesh->setBoundaryName(ids[i], names[i]);
152  seen_it.insert(names[i]);
153  }
154  }
155 
156  if (getParam<bool>("construct_side_list_from_node_list"))
157  mesh->getMesh().get_boundary_info().build_side_list_from_node_list();
158 
159  // Here we can override the partitioning for special cases
160  if (getParam<bool>("skip_partitioning"))
161  mesh->getMesh().skip_partitioning(getParam<bool>("skip_partitioning"));
162 }
bool isParamValid(const std::string &name) const
Definition: Action.h:101
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
InputParameters _pars
Input parameters for the action.
Definition: Action.h:158
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
void setSubdomainName(SubdomainID subdomain_id, SubdomainName name)
This method returns a writable reference to a subdomain name based on the id parameter.
Definition: MooseMesh.C:1154
void setBoundaryName(BoundaryID boundary_id, BoundaryName name)
This method returns a writable reference to a boundary name based on the id parameter.
Definition: MooseMesh.C:1166
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:903
void setGhostedBoundaryInflation(const std::vector< Real > &inflation)
This sets the inflation amount for the bounding box for each partition for use in ghosting boundaries...
Definition: MooseMesh.C:2324
void addGhostedBoundary(BoundaryID boundary_id)
This will add the boundary ids to be ghosted to this processor.
Definition: MooseMesh.C:2318
void ghostGhostedBoundaries()
Actually do the ghosting of boundaries that need to be ghosted to this processor. ...
Definition: MooseMesh.C:2400
MooseApp & _app
The MOOSE application this is associated with.
Definition: Action.h:170
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
Definition: MooseMesh.C:1043
void setUniformRefineLevel(unsigned int)
Set uniform refinement level.
Definition: MooseMesh.C:2312
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ specificTaskName()

const std::string& Action::specificTaskName ( ) const
inlineinherited

Definition at line 77 of file Action.h.

77 { return _specific_task_name; }
std::string _specific_task_name
This member will only be populated if this Action instance is only designed to handle one task...
Definition: Action.h:184

◆ timedAct()

void Action::timedAct ( )
inherited

The method called externally that causes the action to act()

Definition at line 83 of file Action.C.

84 {
85  TIME_SECTION(_act_timer);
86  act();
87 }
PerfID _act_timer
Timers.
Definition: Action.h:206
virtual void act()=0
Method to add objects to the simulation or perform other setup tasks.

◆ type()

const std::string& Action::type ( ) const
inlineinherited

Member Data Documentation

◆ _act_timer

PerfID Action::_act_timer
protectedinherited

Timers.

Definition at line 206 of file Action.h.

Referenced by Action::timedAct().

◆ _action_factory

ActionFactory& Action::_action_factory
protectedinherited

◆ _action_type

std::string Action::_action_type
protectedinherited

Definition at line 167 of file Action.h.

Referenced by Action::type().

◆ _all_tasks

std::set<std::string> Action::_all_tasks
protectedinherited

A list of all the tasks that this Action will satisfy.

Note: That this is not populated at construction time. However, all tasks will be added prior to act().

Definition at line 191 of file Action.h.

Referenced by Action::appendTask(), and Action::getAllTasks().

◆ _app

MooseApp& Action::_app
protectedinherited

◆ _awh

ActionWarehouse& Action::_awh
protectedinherited

◆ _console

const ConsoleStream ConsoleStreamInterface::_console
inherited

An instance of helper class to write streams to the Console objects.

Definition at line 32 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), SetupRecoverFileBaseAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), SimplePredictor::apply(), FEProblemBase::backupMultiApps(), FEProblemBase::checkProblemIntegrity(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInterpolationDT(), FEProblemBase::computeResidualTags(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), AB2PredictorCorrector::converged(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppVectorPostprocessorTransfer::execute(), MultiAppCopyTransfer::execute(), Steady::execute(), MultiAppDTKUserObjectTransfer::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), FEProblemBase::FEProblemBase(), ElementQualityChecker::finalize(), FEProblemBase::finishMultiAppStep(), MultiApp::globalAppToLocal(), InversePowerMethod::init(), NonlinearEigen::init(), Steady::init(), FEProblemBase::initialAdaptMesh(), FEProblemBase::initialSetup(), EigenExecutionerBase::inversePowerIteration(), Transient::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseObject::mooseDeprecated(), MooseObject::mooseInfo(), MooseObject::mooseWarning(), PerfGraphOutput::output(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), ActionWarehouse::printActionDependencySets(), EigenExecutionerBase::printEigenvalue(), MaterialPropertyDebugOutput::printMaterialMap(), SolutionTimeAdaptiveDT::rejectStep(), DT2::rejectStep(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), NonlinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), LStableDirk4::solve(), AStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), Transient::solveStep(), DT2::step(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

◆ _current_task

const std::string& Action::_current_task
protectedinherited

◆ _displaced_mesh

std::shared_ptr<MooseMesh>& Action::_displaced_mesh
protectedinherited

◆ _factory

Factory& Action::_factory
protectedinherited

◆ _mesh

std::shared_ptr<MooseMesh>& Action::_mesh
protectedinherited

◆ _moose_object_pars

InputParameters MooseObjectAction::_moose_object_pars
protectedinherited

◆ _name

std::string Action::_name
protectedinherited

◆ _pars

InputParameters Action::_pars
protectedinherited

◆ _perf_graph

PerfGraph& PerfGraphInterface::_perf_graph
protectedinherited

The performance graph to add to.

Definition at line 66 of file PerfGraphInterface.h.

Referenced by PerfGraphData::getValue(), and PerfGraphInterface::registerTimedSection().

◆ _pg_params

const InputParameters* PerfGraphInterface::_pg_params
protectedinherited

Params.

Definition at line 63 of file PerfGraphInterface.h.

◆ _prefix

std::string PerfGraphInterface::_prefix
protectedinherited

A prefix to use for all sections.

Definition at line 69 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::registerTimedSection().

◆ _problem

std::shared_ptr<FEProblemBase>& Action::_problem
protectedinherited

Convenience reference to a problem this action works on.

Definition at line 203 of file Action.h.

Referenced by AddADKernelAction::act(), AddBCAction::act(), CreateExecutionerAction::act(), AddTransferAction::act(), AddScalarKernelAction::act(), AddICAction::act(), AddConstraintAction::act(), AddKernelAction::act(), AddPostprocessorAction::act(), SetupDampersAction::act(), AddVectorPostprocessorAction::act(), AddADMaterialAction::act(), AddMarkerAction::act(), InitProblemAction::act(), AddDiracKernelAction::act(), CopyNodalVarsAction::act(), AddIndicatorAction::act(), AddDamperAction::act(), AddInterfaceKernelAction::act(), AddDGKernelAction::act(), AddMultiAppAction::act(), CheckIntegrityAction::act(), AddBoundsVectorsAction::act(), AddMaterialAction::act(), AddElementalFieldAction::act(), AddNodalKernelAction::act(), SetAdaptivityOptionsAction::act(), AddUserObjectAction::act(), AddInitialConditionAction::act(), CreateProblemAction::act(), CreateProblemDefaultAction::act(), AddFieldSplitAction::act(), SetupDebugAction::act(), AdaptivityAction::act(), AddFunctionAction::act(), AddDistributionAction::act(), CreateDisplacedProblemAction::act(), SetupPreconditionerAction::act(), SetupPredictorAction::act(), SetupTimeIntegratorAction::act(), SetupTimeStepperAction::act(), SetupResidualDebugAction::act(), MaterialDerivativeTestAction::act(), SetupQuadratureAction::act(), AddSamplerAction::act(), AddAuxVariableAction::act(), AddExternalAuxVariableAction::act(), AddOutputAction::act(), AddPeriodicBCAction::act(), MaterialOutputAction::act(), AddControlAction::act(), AddNodalNormalsAction::act(), SetupPostprocessorDataAction::act(), AddVariableAction::addVariable(), AddPeriodicBCAction::autoTranslationBoundaries(), CheckOutputAction::checkMaterialOutput(), AddVariableAction::getSubdomainIDs(), and AddPeriodicBCAction::setPeriodicVars().

◆ _registered_identifier

std::string Action::_registered_identifier
protectedinherited

Definition at line 161 of file Action.h.

◆ _specific_task_name

std::string Action::_specific_task_name
protectedinherited

This member will only be populated if this Action instance is only designed to handle one task.

This happens when an Action is registered with several pieces of syntax in which case separate instances are built to handle the different incoming parameter values.

Definition at line 184 of file Action.h.

Referenced by Action::specificTaskName().

◆ _type

std::string MooseObjectAction::_type
protectedinherited

The documentation for this class was generated from the following files: