https://mooseframework.inl.gov
SetValueChainControl.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 "SetValueChainControl.h"
11 #include "MooseUtils.h"
12 
15 
16 template <typename T>
19 {
21  params.addRequiredParam<std::string>("parameter", "Parameter(s) to control");
22  params.addRequiredParam<std::string>("value",
23  "Control data to use for the value of the parameter(s)");
24  const std::string type_str = MooseUtils::prettyCppType<T>();
25  params.addClassDescription("Sets parameter(s) of type '" + type_str +
26  "' to a control data value of type '" + type_str + "'.");
27  return params;
28 }
29 
30 template <typename T>
32  : ChainControl(parameters), _value(getChainControlData<T>("value"))
33 {
34 }
35 
36 template <typename T>
37 void
39 {
40  setControllableValue<T>("parameter", _value);
41 }
virtual void execute() override
Execute the control.
Sets parameter(s) to a control data value.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
static InputParameters validParams()
Definition: ChainControl.C:14
registerMooseObject("MooseApp", SetRealValueChainControl)
SetValueChainControlTempl(const InputParameters &parameters)
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...
Control that additionally provides the capability to produce/consume data values, to allow control op...
Definition: ChainControl.h:21