www.mooseframework.org
GlobalParamsAction.h
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 #ifndef GLOBALPARAMSACTION_H
16 #define GLOBALPARAMSACTION_H
17 
18 #include "Action.h"
19 
20 class GlobalParamsAction;
21 
22 template <>
24 
25 class GlobalParamsAction : public Action
26 {
27 public:
29 
30  virtual void act() override;
31 
37  void remove(const std::string & name);
38 
39  template <typename T>
40  inline T & setScalarParam(const std::string & name)
41  {
42  return parameters().set<T>(name);
43  }
44 
45  template <typename T>
46  inline std::vector<T> & setVectorParam(const std::string & name)
47  {
48  return parameters().set<std::vector<T>>(name);
49  }
50 
51  template <typename T>
52  inline std::vector<std::vector<T>> & setDoubleIndexParam(const std::string & name)
53  {
54  return parameters().set<std::vector<std::vector<T>>>(name);
55  }
56 };
57 #endif // GLOBALPARAMSACTION_H
GlobalParamsAction(InputParameters params)
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters & parameters()
Definition: Action.h:63
std::vector< T > & setVectorParam(const std::string &name)
std::vector< std::vector< T > > & setDoubleIndexParam(const std::string &name)
Base class for actions.
Definition: Action.h:39
T & setScalarParam(const std::string &name)
virtual void act() override
const std::string & name() const
The name of the action.
Definition: Action.h:51
InputParameters validParams< GlobalParamsAction >()