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 : #include "GetFunctionValueControl.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", GetFunctionValueControl); 14 : 15 : InputParameters 16 214 : GetFunctionValueControl::validParams() 17 : { 18 214 : InputParameters params = THMControl::validParams(); 19 214 : params.addClassDescription("Sets a ControlData named 'value' with the value of a function"); 20 428 : params.addRequiredParam<FunctionName>("function", 21 : "The name of the function prescribing a value."); 22 428 : params.addParam<Point>("point", Point(), "Point at which to evaluate function"); 23 214 : return params; 24 0 : } 25 : 26 106 : GetFunctionValueControl::GetFunctionValueControl(const InputParameters & parameters) 27 : : THMControl(parameters), 28 106 : _value(declareComponentControlData<Real>("value")), 29 212 : _point(getParam<Point>("point")), 30 212 : _function(getFunction("function")) 31 : { 32 106 : } 33 : 34 : void 35 955 : GetFunctionValueControl::execute() 36 : { 37 955 : _value = _function.value(_t, _point); 38 955 : }