38 params.
addParam<std::vector<std::string>>(
40 "Adds user-defined labels for accessing object parameters via control logic.");
52 (parameters.getObjectType() !=
"" ?
std::string(
"::") + parameters.getObjectType()
54 (parameters.getObjectName() !=
"" ?
std::string(
"::") + parameters.getObjectName()
56 (parameters.isParamValid(
"task") && parameters.get<
std::string>(
"task") !=
""
57 ?
std::string(
"::") + parameters.get<
std::string>(
"task")
60 _registered_identifier(isParamValid(
"registered_identifier")
61 ? getParam<
std::string>(
"registered_identifier")
63 _specific_task_name(_pars.isParamValid(
"task") ? getParam<
std::string>(
"task") :
""),
65 _current_task(_awh.getCurrentTaskName()),
67 _displaced_mesh(_awh.displacedMesh()),
68 _problem(_awh.problemBase()),
69 _act_timer(registerTimedSection(
"act", 4))
72 mooseError(
"This object was not constructed using the ActionFactory, which is not supported.");
80 const auto parallel_verify = [libmesh_dbg_var(
this)](
const bool libmesh_dbg_var(before))
84 if (!
comm().verify(value.size()) || !
comm().verify(value))
86 before ?
"before" :
"after",
92 parallel_verify(
true);
96 parallel_verify(
false);
109 static unsigned int unique_object_id = 0;
111 auto new_name = moose_object_pars.
getBase() +
'_' +
name() +
'_' + rm_name +
"_" +
117 rm_params.set<std::string>(
"for_whom") =
name();
120 if (rm_input_parameter_func)
121 rm_input_parameter_func(moose_object_pars, rm_params);
125 if (!rm_params.areAllRequiredParamsValid())
126 mooseError(
"Missing required parameters for RelationshipManager " + rm_name +
" for object " +
155 for (
const auto & buildable_type : buildable_types)
157 auto & rm_name = std::get<0>(buildable_type);
158 auto & rm_type = std::get<1>(buildable_type);
159 auto rm_input_parameter_func = std::get<2>(buildable_type);
162 input_rm_type, moose_object_pars, rm_name, rm_type, rm_input_parameter_func) ||
177 const std::string & param_name,
181 if (!to_hit_node || to_hit_node->isRoot())
183 if (
const auto hit_node = from_params.
getHitNode(param_name))
185 else if (
const auto hit_node = from_params.
getHitNode())
const InputParameters * currentlyConstructing() const
Storage for action instances.
bool addRelationshipManager(Moose::RelationshipManagerType input_rm_type, const InputParameters &moose_object_pars, std::string rm_name, Moose::RelationshipManagerType rm_type, Moose::RelationshipManagerInputParameterCallback rm_input_parameter_func, Moose::RMSystemType sys_type=Moose::RMSystemType::NONE)
Method for adding a single relationship manager.
void associateWithParameter(const std::string ¶m_name, InputParameters ¶ms) const
Associates the object's parameters params with the input location from this Action's parameter with t...
static const std::string unique_action_name_param
The name of the parameter that contains the unique action name.
std::shared_ptr< MooseMesh > & _mesh
Action(const InputParameters ¶meters)
static InputParameters validParams()
MooseApp & _app
The MOOSE application this is associated with.
void timedAct()
The method called externally that causes the action to act()
bool addRelationshipManagers(Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
Method to add a relationship manager for the objects being added to the system.
virtual void act()=0
Method to add objects to the simulation or perform other setup tasks.
const std::string & _current_task
The current action (even though we have separate instances for each action)
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters ¶meters, THREAD_ID tid=0, bool print_deprecated=true)
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
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...
bool addRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Transfers ownership of a RelationshipManager to the application for lifetime management.
ActionFactory & getActionFactory()
Retrieve a writable reference to the ActionFactory associated with this App.
const InputParameters & parameters() const
Get the parameters of the object.
std::string typeAndName() const
Get the class's combined type and name; useful in error handling.
const std::string & name() const
Get the name of the class.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
static InputParameters validParams()
Parameters that are processed directly by the Parser and are valid anywhere in the input.
Base class shared by both Action and MooseObject.
static InputParameters validParams()
Factory & _factory
The Factory associated with the MooseApp.
Interface for objects interacting with the PerfGraph.
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
An interface that allows the marking of invalid solutions during a solve.
const Parallel::Communicator & comm() const
std::function< void(const InputParameters &, InputParameters &)> RelationshipManagerInputParameterCallback
The type for the callback to set RelationshipManager parameters.
std::string stringify(const T &t)
conversion to string
RelationshipManagerType
Main types of Relationship Managers.