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 "SetComponentBoolValueControl.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", SetComponentBoolValueControl); 13 : 14 : InputParameters 15 16 : SetComponentBoolValueControl::validParams() 16 : { 17 16 : InputParameters params = THMControl::validParams(); 18 32 : params.addRequiredParam<std::string>("component", "The name of the component to be controlled."); 19 32 : params.addRequiredParam<std::string>( 20 : "parameter", "The name of the parameter in the component to be controlled."); 21 32 : params.addRequiredParam<std::string>("value", 22 : "The name of control data to be set in the component."); 23 16 : params.addClassDescription( 24 : "Control to set a boolean value of a component parameter with control data boolean"); 25 16 : return params; 26 0 : } 27 : 28 8 : SetComponentBoolValueControl::SetComponentBoolValueControl(const InputParameters & parameters) 29 : : THMControl(parameters), 30 8 : _component_name(getParam<std::string>("component")), 31 16 : _param_name(getParam<std::string>("parameter")), 32 16 : _ctrl_param_name("component", _component_name, _param_name), 33 16 : _value(getControlData<bool>("value")) 34 : { 35 8 : } 36 : 37 : void 38 88 : SetComponentBoolValueControl::execute() 39 : { 40 88 : setControllableValueByName<bool>(_ctrl_param_name, _value); 41 88 : }