LCOV - code coverage report
Current view: top level - src/chaincontrols - SetValueChainControl.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 18 18 100.0 %
Date: 2026-05-29 20:35:17 Functions: 8 8 100.0 %
Legend: Lines: hit not hit

          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 "SetValueChainControl.h"
      11             : #include "MooseUtils.h"
      12             : #include "MooseApp.h"
      13             : 
      14             : registerMooseObject("MooseApp", SetRealValueChainControl);
      15             : registerMooseObject("MooseApp", SetBoolValueChainControl);
      16             : 
      17             : template <typename T>
      18             : InputParameters
      19        6242 : SetValueChainControlTempl<T>::validParams()
      20             : {
      21        6242 :   InputParameters params = ChainControl::validParams();
      22       24968 :   params.addRequiredParam<std::string>("parameter", "Parameter(s) to control");
      23       18726 :   params.addRequiredParam<std::string>("value",
      24             :                                        "Control data to use for the value of the parameter(s)");
      25        6242 :   const std::string type_str = MooseUtils::prettyCppType<T>();
      26        6242 :   params.addClassDescription("Sets parameter(s) of type '" + type_str +
      27             :                              "' to a control data value of type '" + type_str + "'.");
      28       12484 :   return params;
      29        6242 : }
      30             : 
      31             : template <typename T>
      32          60 : SetValueChainControlTempl<T>::SetValueChainControlTempl(const InputParameters & parameters)
      33         120 :   : ChainControl(parameters), _value(getChainControlData<T>("value"))
      34             : {
      35          60 : }
      36             : 
      37             : template <typename T>
      38             : void
      39         213 : SetValueChainControlTempl<T>::execute()
      40             : {
      41         426 :   setControllableValue<T>("parameter", _value);
      42         213 : }
      43             : 
      44             : template <typename T>
      45             : void
      46          60 : SetValueChainControlTempl<T>::initialSetup()
      47             : {
      48          60 :   if (_app.isRecovering())
      49          15 :     setControllableValue<T>("parameter", _value);
      50          60 : }

Generated by: LCOV version 1.14