forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GlobalParamsAction.C
49 lines (40 loc) · 1.42 KB
/
GlobalParamsAction.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#include "GlobalParamsAction.h"
#include "MooseApp.h"
#include "InputParameterWarehouse.h"
registerMooseAction("MooseApp", GlobalParamsAction, "set_global_params");
InputParameters
GlobalParamsAction::validParams()
{
InputParameters params = Action::validParams();
params.addClassDescription("Action used to aid in the application of parameters defined in the "
"GlobalParams input block.");
std::vector<std::string> blocks(1, "");
/* GlobalParams should not have children or other standard public Action attributes */
params.addPrivateParam<std::vector<std::string>>("active", blocks);
params.addPrivateParam<std::vector<std::string>>("inactive", blocks);
return params;
}
GlobalParamsAction::GlobalParamsAction(const InputParameters & params) : Action(params) {}
void
GlobalParamsAction::act()
{
}
void
GlobalParamsAction::remove(const std::string & name)
{
parameters().remove(name);
}
InputParameters &
GlobalParamsAction::parameters()
{
const auto & params = _app.getInputParameterWarehouse().getInputParameters();
return *(params.find(uniqueActionName())->second.get());
}