LCOV - code coverage report
Current view: top level - src/postprocessors - RealControlDataValuePostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 19 21 90.5 %
Date: 2025-07-30 13:02:48 Functions: 5 5 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 "RealControlDataValuePostprocessor.h"
      11             : #include "THMProblem.h"
      12             : 
      13             : registerMooseObject("ThermalHydraulicsApp", RealControlDataValuePostprocessor);
      14             : 
      15             : InputParameters
      16         336 : RealControlDataValuePostprocessor::validParams()
      17             : {
      18         336 :   InputParameters params = GeneralPostprocessor::validParams();
      19         336 :   params.addClassDescription("Outputs the value of a ControlData as a postprocessor");
      20         672 :   params.addRequiredParam<std::string>("control_data_name",
      21             :                                        "The name of the control data to output.");
      22         336 :   return params;
      23           0 : }
      24             : 
      25         112 : RealControlDataValuePostprocessor::RealControlDataValuePostprocessor(
      26         112 :     const InputParameters & parameters)
      27         224 :   : GeneralPostprocessor(parameters), _control_data_name(getParam<std::string>("control_data_name"))
      28             : {
      29             :   THMProblem * thm_problem =
      30         336 :       dynamic_cast<THMProblem *>(getCheckedPointerParam<FEProblemBase *>("_fe_problem_base"));
      31         112 :   if (thm_problem)
      32             :   {
      33         112 :     _thm_problem = thm_problem;
      34         112 :     _control_data_value = _thm_problem->getControlData<Real>(_control_data_name);
      35             :   }
      36             :   else
      37           0 :     mooseError(name(),
      38             :                ": Cannot use RealControlDataValuePostprocessor without the component system.");
      39         112 : }
      40             : 
      41             : void
      42         492 : RealControlDataValuePostprocessor::initialize()
      43             : {
      44         492 : }
      45             : 
      46             : void
      47         492 : RealControlDataValuePostprocessor::execute()
      48             : {
      49         492 : }
      50             : 
      51             : Real
      52         492 : RealControlDataValuePostprocessor::getValue() const
      53             : {
      54         492 :   return _control_data_value->get();
      55             : }

Generated by: LCOV version 1.14