Line data Source code
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 : // MOOSE includes 11 : #include "RealFunctionControl.h" 12 : #include "Function.h" 13 : 14 : registerMooseObject("MooseApp", RealFunctionControl); 15 : 16 : InputParameters 17 14385 : RealFunctionControl::validParams() 18 : { 19 14385 : InputParameters params = Control::validParams(); 20 14385 : params.addClassDescription( 21 : "Sets the value of a 'Real' input parameters to the value of a provided function."); 22 14385 : params.addRequiredParam<FunctionName>( 23 : "function", "The function to use for controlling the specified parameter."); 24 14385 : params.addRequiredParam<std::string>( 25 : "parameter", 26 : "The input parameter(s) to control. Specify a single parameter name and all " 27 : "parameters in all objects matching the name will be updated"); 28 14385 : return params; 29 0 : } 30 : 31 60 : RealFunctionControl::RealFunctionControl(const InputParameters & parameters) 32 60 : : Control(parameters), _function(getFunction("function")) 33 : { 34 60 : } 35 : 36 : void 37 245 : RealFunctionControl::execute() 38 : { 39 245 : Real value = _function.value(_t); 40 245 : setControllableValue<Real>("parameter", value); 41 245 : }