www.mooseframework.org
Action.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 
15 #include "Action.h"
16 #include "ActionWarehouse.h"
17 #include "MooseMesh.h"
18 #include "MooseApp.h"
19 #include "MooseUtils.h" // remove when getBaseName is removed
20 
21 template <>
24 {
25  InputParameters params;
26 
31  params.addParam<std::vector<std::string>>(
32  "active",
33  std::vector<std::string>({"__all__"}),
34  "If specified only the blocks named will be visited and made active");
35  params.addParam<std::vector<std::string>>(
36  "inactive",
37  std::vector<std::string>(),
38  "If specified blocks matching these identifiers will be skipped.");
39 
40  params.addPrivateParam<std::string>("_moose_docs_type",
41  "action"); // the type of syntax for documentation system
42  params.addPrivateParam<std::string>("_action_name"); // the name passed to ActionFactory::create
43  params.addPrivateParam<std::string>("task");
44  params.addPrivateParam<std::string>("registered_identifier");
45  params.addPrivateParam<std::string>("action_type");
46  params.addPrivateParam<ActionWarehouse *>("awh", NULL);
47 
48  return params;
49 }
50 
53  *parameters.getCheckedPointerParam<MooseApp *>("_moose_app", "In Action constructor")),
54  _pars(parameters),
55  _registered_identifier(isParamValid("registered_identifier")
56  ? getParam<std::string>("registered_identifier")
57  : ""),
58  _name(getParam<std::string>("_action_name")),
59  _action_type(getParam<std::string>("action_type")),
60  _app(*parameters.getCheckedPointerParam<MooseApp *>("_moose_app", "In Action constructor")),
61  _factory(_app.getFactory()),
62  _action_factory(_app.getActionFactory()),
63  _specific_task_name(_pars.isParamValid("task") ? getParam<std::string>("task") : ""),
64  _awh(*parameters.getCheckedPointerParam<ActionWarehouse *>("awh")),
65  _current_task(_awh.getCurrentTaskName()),
66  _mesh(_awh.mesh()),
67  _displaced_mesh(_awh.displacedMesh()),
68  _problem(_awh.problemBase()),
69  _executioner(_app.executioner())
70 {
71 }
72 
74 std::string
76 {
77  mooseDeprecated("getShortName() is deprecated.");
79 }
80 
81 std::string
83 {
84  mooseDeprecated("getBaseName() is deprecated.");
86 }
void addPrivateParam(const std::string &name, const T &value)
These method add a parameter to the InputParameters object which can be retrieved like any other para...
Action(InputParameters parameters)
Definition: Action.C:51
void mooseDeprecated(Args &&...args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:202
Base class for MOOSE-based applications.
Definition: MooseApp.h:58
Storage for action instances.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::string getBaseName() const
Deprecated name methods, use name()
Definition: Action.C:82
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:325
std::string _name
The name of the action.
Definition: Action.h:92
An inteface for the _console for outputting to the Console object.
std::string baseName(const std::string &name)
Function for string the information before the final / in a parser block.
Definition: MooseUtils.C:331
InputParameters validParams< Action >()
Definition: Action.C:23
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
std::string getShortName() const
DEPRECATED METHODS.
Definition: Action.C:75