LCOV - code coverage report
Current view: top level - src/postprocessors - ConstantPostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 14 15 93.3 %
Date: 2025-07-17 01:28:37 Functions: 3 3 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 "ConstantPostprocessor.h"
      11             : 
      12             : registerMooseObject("MooseApp", ConstantPostprocessor);
      13             : 
      14             : InputParameters
      15       14511 : ConstantPostprocessor::validParams()
      16             : {
      17       14511 :   InputParameters params = GeneralPostprocessor::validParams();
      18       14511 :   params.addParam<Real>("value", 0, "The value");
      19       14511 :   params.declareControllable("value");
      20             : 
      21       14511 :   params.addClassDescription("Postprocessor that holds a constant value");
      22       14511 :   return params;
      23           0 : }
      24             : 
      25         118 : ConstantPostprocessor::ConstantPostprocessor(const InputParameters & params)
      26         118 :   : GeneralPostprocessor(params), _value(getParam<Real>("value"))
      27             : {
      28         118 :   const PostprocessorReporterName r_name(name());
      29         118 :   auto & write_data = _fe_problem.getReporterData(ReporterData::WriteKey());
      30             : 
      31             :   // Initialize value
      32         118 :   write_data.setReporterValue<PostprocessorValue>(r_name, _value);
      33         118 : }
      34             : 
      35             : Real
      36         137 : ConstantPostprocessor::getValue() const
      37             : {
      38         137 :   return _value;
      39             : }

Generated by: LCOV version 1.14