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

Generated by: LCOV version 1.14