www.mooseframework.org
GlobalParamsAction.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "GlobalParamsAction.h"
11 
12 #include "MooseApp.h"
14 
15 registerMooseAction("MooseApp", GlobalParamsAction, "set_global_params");
16 
19 {
21  params.addClassDescription("Action used to aid in the application of parameters defined in the "
22  "GlobalParams input block.");
23  std::vector<std::string> blocks(1, "");
24 
25  /* GlobalParams should not have children or other standard public Action attributes */
26  params.addPrivateParam<std::vector<std::string>>("active", blocks);
27  params.addPrivateParam<std::vector<std::string>>("inactive", blocks);
28  return params;
29 }
30 
32 
33 void
35 {
36 }
37 
38 void
39 GlobalParamsAction::remove(const std::string & name)
40 {
41  parameters().remove(name);
42 }
43 
46 {
47  return const_cast<InputParameters &>(_pars);
48 }
GlobalParamsAction(const InputParameters &params)
registerMooseAction("MooseApp", GlobalParamsAction, "set_global_params")
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...
InputParameters & parameters()
Obtain a non-const reference of the action parameters in the InputParameterWarehouse.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
Base class for actions.
Definition: Action.h:38
static InputParameters validParams()
Definition: Action.C:24
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
static InputParameters validParams()
void remove(const std::string &name)
This function is here to remove parameters of a type so that global parameters can potentially use th...