https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
11#include "MooseUtils.h"
12#include "MooseApp.h"
13
16
17template <typename T>
20{
22 params.addRequiredParam<std::string>("parameter", "Parameter(s) to control");
23 params.addRequiredParam<std::string>("value",
24 "Control data to use for the value of the parameter(s)");
25 const std::string type_str = MooseUtils::prettyCppType<T>();
26 params.addClassDescription("Sets parameter(s) of type '" + type_str +
27 "' to a control data value of type '" + type_str + "'.");
28 return params;
29}
30
31template <typename T>
33 : ChainControl(parameters), _value(getChainControlData<T>("value"))
34{
35}
36
37template <typename T>
38void
40{
41 setControllableValue<T>("parameter", _value);
42}
43
44template <typename T>
45void
47{
48 if (_app.isRecovering())
49 setControllableValue<T>("parameter", _value);
50}
registerMooseObject("MooseApp", SetRealValueChainControl)
Control that additionally provides the capability to produce/consume data values, to allow control op...
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...
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.
Sets parameter(s) to a control data value.
virtual void initialSetup() override
Called once at the beginning of the simulation, used to initialize recovered control values.
virtual void execute() override
Execute the control.
static InputParameters validParams()
SetValueChainControlTempl(const InputParameters &parameters)