https://mooseframework.inl.gov
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 
10 #include "ScaleOldChainControl.h"
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 
41 void
43 {
45 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const Real & _value_old
Control value before scaling.
Real & _value
Control value after scaling.
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...
ScaleOldChainControl(const InputParameters &parameters)
registerMooseObject("MooseApp", ScaleOldChainControl)
static InputParameters validParams()
Definition: ChainControl.C:14
const Real & _scale_factor
Factor by which to scale control value.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void execute() override
Execute the control.
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...
static InputParameters validParams()
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...
Scales an old control value by another control value.
Control that additionally provides the capability to produce/consume data values, to allow control op...
Definition: ChainControl.h:21