36 params.
addParam<std::vector<std::string>>(
38 "Adds user-defined labels for accessing object parameters via control logic.");
46 parameters.
get<
std::string>(
"action_type"),
47 parameters.
get<
std::string>(
"_action_name"),
48 *parameters.getCheckedPointerParam<
MooseApp *>(
"_moose_app",
"In Action constructor"),
51 *parameters.getCheckedPointerParam<
MooseApp *>(
"_moose_app",
"In Action constructor")),
53 parameters.getCheckedPointerParam<
MooseApp *>(
"_moose_app",
"In Action constructor")
56 (parameters.
get<
std::string>(
"action_type") !=
"" 57 ?
std::string(
"::") + parameters.
get<
std::string>(
"action_type")
59 (parameters.
get<
std::string>(
"_action_name") !=
"" 60 ?
std::string(
"::") + parameters.
get<
std::string>(
"_action_name")
62 (parameters.isParamValid(
"task") && parameters.
get<
std::string>(
"task") !=
"" 63 ?
std::string(
"::") + parameters.
get<
std::string>(
"task")
65 _registered_identifier(isParamValid(
"registered_identifier")
66 ? getParam<
std::string>(
"registered_identifier")
68 _specific_task_name(_pars.isParamValid(
"task") ? getParam<
std::string>(
"task") :
""),
70 _current_task(_awh.getCurrentTaskName()),
72 _displaced_mesh(_awh.displacedMesh()),
73 _problem(_awh.problemBase()),
74 _act_timer(registerTimedSection(
"act", 4))
77 mooseError(
"This object was not constructed using the ActionFactory, which is not supported.");
97 static unsigned int unique_object_id = 0;
99 auto new_name = moose_object_pars.
get<std::string>(
"_moose_base") +
'_' +
name() +
'_' + rm_name +
105 rm_params.set<std::string>(
"for_whom") =
name();
108 if (rm_input_parameter_func)
109 rm_input_parameter_func(moose_object_pars, rm_params);
113 if (!rm_params.areAllRequiredParamsValid())
114 mooseError(
"Missing required parameters for RelationshipManager " + rm_name +
" for object " +
143 for (
const auto & buildable_type : buildable_types)
145 auto & rm_name = std::get<0>(buildable_type);
146 auto & rm_type = std::get<1>(buildable_type);
147 auto rm_input_parameter_func = std::get<2>(buildable_type);
150 input_rm_type, moose_object_pars, rm_name, rm_type, rm_input_parameter_func) ||
165 const std::string & param_name,
169 if (!to_hit_node || to_hit_node->isRoot())
171 if (
const auto hit_node = from_params.
getHitNode(param_name))
173 else if (
const auto hit_node = from_params.
getHitNode())
RelationshipManagerType
Main types of Relationship Managers.
Action(const InputParameters ¶meters)
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
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)
static InputParameters validParams()
Parameters that are processed directly by the Parser and are valid anywhere in the input...
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
Base class for MOOSE-based applications.
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.
ActionFactory & getActionFactory()
Retrieve a writable reference to the ActionFactory associated with this App.
virtual const std::string & name() const
Get the name of the class.
Factory & _factory
The Factory associated with the MooseApp.
bool addRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Transfers ownership of a RelationshipManager to the application for lifetime management.
static InputParameters validParams()
std::function< void(const InputParameters &, InputParameters &)> RelationshipManagerInputParameterCallback
The type for the callback to set RelationshipManager parameters.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
MooseApp & _app
The MOOSE application this is associated with.
std::string stringify(const T &t)
conversion to string
Interface for objects interacting with the PerfGraph.
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...
std::shared_ptr< MooseMesh > & _mesh
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
const InputParameters * currentlyConstructing() const
void timedAct()
The method called externally that causes the action to act()
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...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
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.
const InputParameters & parameters() const
Get the parameters of the object.
virtual void act()=0
Method to add objects to the simulation or perform other setup tasks.
Base class shared by both Action and MooseObject.