LCOV - code coverage report
Current view: top level - src/postprocessors - RealControlDataValuePostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 19 21 90.5 %
Date: 2026-05-29 20:41:18 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         156 : RealControlDataValuePostprocessor::validParams()
      17             : {
      18         156 :   InputParameters params = GeneralPostprocessor::validParams();
      19         156 :   params.addClassDescription("Outputs the value of a ControlData as a postprocessor");
      20         312 :   params.addRequiredParam<std::string>("control_data_name",
      21             :                                        "The name of the control data to output.");
      22         156 :   return params;
      23           0 : }
      24             : 
      25          52 : RealControlDataValuePostprocessor::RealControlDataValuePostprocessor(
      26          52 :     const InputParameters & parameters)
      27         104 :   : GeneralPostprocessor(parameters), _control_data_name(getParam<std::string>("control_data_name"))
      28             : {
      29             :   THMProblem * thm_problem =
      30         156 :       dynamic_cast<THMProblem *>(getCheckedPointerParam<FEProblemBase *>("_fe_problem_base"));
      31          52 :   if (thm_problem)
      32             :   {
      33          52 :     _thm_problem = thm_problem;
      34          52 :     _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          52 : }
      40             : 
      41             : void
      42         270 : RealControlDataValuePostprocessor::initialize()
      43             : {
      44         270 : }
      45             : 
      46             : void
      47         270 : RealControlDataValuePostprocessor::execute()
      48             : {
      49         270 : }
      50             : 
      51             : Real
      52         270 : RealControlDataValuePostprocessor::getValue() const
      53             : {
      54         270 :   return _control_data_value->get();
      55             : }

Generated by: LCOV version 1.14