LCOV - code coverage report
Current view: top level - src/postprocessors - TimeIntegratedPostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 18 19 94.7 %
Date: 2025-08-08 20:01:16 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 "TimeIntegratedPostprocessor.h"
      11             : 
      12             : registerMooseObject("MooseApp", TimeIntegratedPostprocessor);
      13             : registerMooseObjectRenamed("MooseApp",
      14             :                            TotalVariableValue,
      15             :                            "04/01/2022 00:00",
      16             :                            TimeIntegratedPostprocessor);
      17             : 
      18             : InputParameters
      19       28730 : TimeIntegratedPostprocessor::validParams()
      20             : {
      21       28730 :   InputParameters params = GeneralPostprocessor::validParams();
      22       28730 :   params.addClassDescription("Integrate a Postprocessor value over time using trapezoidal rule.");
      23       28730 :   params.addParam<PostprocessorName>("value", "The name of the postprocessor");
      24       28730 :   return params;
      25           0 : }
      26             : 
      27         100 : TimeIntegratedPostprocessor::TimeIntegratedPostprocessor(const InputParameters & parameters)
      28             :   : GeneralPostprocessor(parameters),
      29         100 :     _value(0),
      30         100 :     _value_old(getPostprocessorValueOldByName(name())),
      31         100 :     _pps_value(getPostprocessorValue("value")),
      32         200 :     _pps_value_old(getPostprocessorValueOld("value"))
      33             : {
      34         100 : }
      35             : 
      36             : void
      37         515 : TimeIntegratedPostprocessor::initialize()
      38             : {
      39         515 : }
      40             : 
      41             : void
      42         515 : TimeIntegratedPostprocessor::execute()
      43             : {
      44         515 :   _value = _value_old + 0.5 * (_pps_value + _pps_value_old) * _dt;
      45         515 : }
      46             : 
      47             : Real
      48         515 : TimeIntegratedPostprocessor::getValue() const
      49             : {
      50         515 :   return _value;
      51             : }

Generated by: LCOV version 1.14