www.mooseframework.org
MooseObject.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 // MOOSE includes
16 #include "MooseObject.h"
17 #include "MooseApp.h"
18 #include "MooseUtils.h"
19 
20 template <>
23 {
24  InputParameters params;
25  params.addParam<bool>("enable", true, "Set the enabled status of the MooseObject.");
26  params.addParam<std::vector<std::string>>(
27  "control_tags",
28  "Adds user-defined labels for accessing object parameters via control logic.");
29  params.addPrivateParam<std::string>("_object_name"); // the name passed to Factory::create
30  params.addParamNamesToGroup("enable control_tags", "Advanced");
31 
32  return params;
33 }
34 
37  *parameters.get<MooseApp *>("_moose_app")), // Can't call getParam before pars is set
38  ParallelObject(
39  *parameters.get<MooseApp *>("_moose_app")), // Can't call getParam before pars is set
40  _app(*parameters.getCheckedPointerParam<MooseApp *>("_moose_app")),
41  _pars(parameters),
42  _name(getParam<std::string>("_object_name")),
43  _enabled(getParam<bool>("enable")){}
44 
45  [[noreturn]] void callMooseErrorRaw(std::string & msg, MooseApp * app)
46 {
48  std::string prefix;
49  if (!app->isUltimateMaster())
50  prefix = app->name();
51  moose::internal::mooseErrorRaw(msg, prefix);
52 }
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...
MooseObject(const InputParameters &parameters)
Definition: MooseObject.C:35
Base class for MOOSE-based applications.
Definition: MooseApp.h:58
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
InputParameters validParams< MooseObject >()
Definition: MooseObject.C:22
An inteface for the _console for outputting to the Console object.
void mooseErrorRaw(std::string msg, const std::string prefix="")
Definition: MooseError.C:34
void mooseConsole()
Send current output buffer to Console output objects.
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...
bool isUltimateMaster()
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:476
void callMooseErrorRaw(std::string &msg, MooseApp *app)
Definition: MooseObject.C:45
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:841
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...