https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Action.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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 "ParallelParamObject.h"
13#include "InputParameters.h"
15#include "Registry.h"
16#include "PerfGraphInterface.h"
19
20#include <string>
21#include <ostream>
22
23class ActionWarehouse;
24class ActionFactory;
25class MooseMesh;
26class FEProblemBase;
27class Executioner;
28class MooseApp;
29class Factory;
30
36 public PerfGraphInterface,
38{
39public:
41 static const std::string unique_action_name_param;
42
44
46
47 virtual ~Action() = default;
48
52 void timedAct();
53
54 // To get warnings tracked in the SolutionInvalidityOutput
56
57private:
70 bool
72 const InputParameters & moose_object_pars,
73 std::string rm_name,
77
78protected:
91 const InputParameters & moose_object_pars);
92
93public:
104
109
110 const std::string & specificTaskName() const { return _specific_task_name; }
111
112 const std::set<std::string> & getAllTasks() const { return _all_tasks; }
113
114 void appendTask(const std::string & task) { _all_tasks.insert(task); }
115
116protected:
120 virtual void act() = 0;
121
136 void associateWithParameter(const std::string & param_name, InputParameters & params) const;
137
146 void associateWithParameter(const InputParameters & from_params,
147 const std::string & param_name,
148 InputParameters & params) const;
149
150 // The registered syntax for this block if any
152
160
166 std::set<std::string> _all_tasks;
167
170
172 const std::string & _current_task;
173
174 std::shared_ptr<MooseMesh> & _mesh;
175 std::shared_ptr<MooseMesh> & _displaced_mesh;
176
178 std::shared_ptr<FEProblemBase> & _problem;
179
182
183 // Base classes have the same name for that attribute, pick one
184 using MooseBase::_app;
185};
unsigned int PerfID
Definition MooseTypes.h:240
Specialized factory for generic Action System objects.
Storage for action instances.
Base class for actions.
Definition Action.h:38
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.
Definition Action.C:100
void associateWithParameter(const std::string &param_name, InputParameters &params) const
Associates the object's parameters params with the input location from this Action's parameter with t...
Definition Action.C:170
static const std::string unique_action_name_param
The name of the parameter that contains the unique action name.
Definition Action.h:41
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:159
MooseObjectName uniqueActionName() const
The unique name for accessing input parameters of this action in the InputParameterWarehouse.
Definition Action.h:108
const std::set< std::string > & getAllTasks() const
Definition Action.h:112
std::set< std::string > _all_tasks
A list of all the tasks that this Action will satisfy.
Definition Action.h:166
std::string _registered_identifier
Definition Action.h:151
std::shared_ptr< MooseMesh > & _mesh
Definition Action.h:174
const std::string & specificTaskName() const
Definition Action.h:110
static InputParameters validParams()
Definition Action.C:26
void appendTask(const std::string &task)
Definition Action.h:114
void timedAct()
The method called externally that causes the action to act()
Definition Action.C:76
std::shared_ptr< MooseMesh > & _displaced_mesh
Definition Action.h:175
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.
Definition Action.C:148
virtual void act()=0
Method to add objects to the simulation or perform other setup tasks.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition Action.h:178
virtual ~Action()=default
const std::string & _current_task
The current action (even though we have separate instances for each action)
Definition Action.h:172
ActionWarehouse & _awh
Reference to ActionWarehouse where we store object build by actions.
Definition Action.h:169
usingCombinedWarningSolutionWarnings
Definition Action.h:55
PerfID _act_timer
Timers.
Definition Action.h:181
Executioners are objects that do the actual work of solving your problem.
Definition Executioner.h:37
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Generic factory class for build all sorts of objects.
Definition Factory.h:29
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
The Interface used to retrieve mesh meta data (attributes) set by the MeshGenerator system.
Base class for MOOSE-based applications.
Definition MooseApp.h:110
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
MooseObjectName uniqueName() const
Definition MooseBase.C:69
MooseApp & _app
The MOOSE application this is associated with.
Definition MooseBase.h:375
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
A class for storing the names of MooseObject by tag and object name.
Base class shared by both Action and MooseObject.
Interface for objects interacting with the PerfGraph.
An interface that allows the marking of invalid solutions during a solve.
std::function< void(const InputParameters &, InputParameters &)> RelationshipManagerInputParameterCallback
The type for the callback to set RelationshipManager parameters.
RelationshipManagerType
Main types of Relationship Managers.