https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ScaleOldChainControl.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
13
16{
18
19 params.addClassDescription("Scales an old control value by another control value.");
20
21 params.addParam<std::string>("control_data",
22 "Control data whose old value is to be scaled. If no name is "
23 "provided, this control data is used.");
24 params.addRequiredParam<std::string>("scale_factor", "Control data by which to scale value");
25 params.addRequiredParam<Real>("initial_value", "Initial value if scaling this control data");
26
27 return params;
28}
29
31 : ChainControl(parameters),
32 _value(declareChainControlData<Real>("value")),
33 _value_old(getChainControlDataOldByName<Real>(isParamValid("control_data")
34 ? getParam<std::string>("control_data")
35 : fullControlDataName("value"))),
36 _scale_factor(getChainControlData<Real>("scale_factor"))
37{
38 _value = getParam<Real>("initial_value");
39}
40
41void
registerMooseObject("MooseApp", ScaleOldChainControl)
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 addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
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.
Scales an old control value by another control value.
const Real & _scale_factor
Factor by which to scale control value.
ScaleOldChainControl(const InputParameters &parameters)
static InputParameters validParams()
const Real & _value_old
Control value before scaling.
Real & _value
Control value after scaling.
virtual void execute() override
Execute the control.