www.mooseframework.org
GlobalParamsAction.h
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 #pragma once
11 
12 #include "Action.h"
13 
14 class GlobalParamsAction;
15 
16 template <>
18 
19 class GlobalParamsAction : public Action
20 {
21 public:
23 
24  virtual void act() override;
25 
31  void remove(const std::string & name);
32 
33  template <typename T>
34  inline T & setScalarParam(const std::string & name)
35  {
36  return parameters().set<T>(name);
37  }
38 
39  template <typename T>
40  inline std::vector<T> & setVectorParam(const std::string & name)
41  {
42  return parameters().set<std::vector<T>>(name);
43  }
44 
45  template <typename T>
46  inline std::vector<std::vector<T>> & setDoubleIndexParam(const std::string & name)
47  {
48  return parameters().set<std::vector<std::vector<T>>>(name);
49  }
50 };
GlobalParamsAction(InputParameters params)
const std::string & name() const
The name of the action.
Definition: Action.h:76
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:88
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:35
T & setScalarParam(const std::string &name)
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
InputParameters validParams< GlobalParamsAction >()