LCOV - code coverage report
Current view: top level - src/postprocessors - CumulativeValuePostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 17 18 94.4 %
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 "CumulativeValuePostprocessor.h"
      11             : 
      12             : registerMooseObject("MooseApp", CumulativeValuePostprocessor);
      13             : 
      14             : InputParameters
      15       14469 : CumulativeValuePostprocessor::validParams()
      16             : {
      17       14469 :   InputParameters params = GeneralPostprocessor::validParams();
      18       14469 :   params.addClassDescription("Creates a cumulative sum of a Postprocessor value with time.");
      19       14469 :   params.addRequiredParam<PostprocessorName>("postprocessor", "The name of the postprocessor");
      20       14469 :   return params;
      21           0 : }
      22             : 
      23         102 : CumulativeValuePostprocessor::CumulativeValuePostprocessor(const InputParameters & parameters)
      24             :   : GeneralPostprocessor(parameters),
      25         102 :     _sum(0.0),
      26         102 :     _sum_old(getPostprocessorValueOldByName(name())),
      27         204 :     _pps_value(getPostprocessorValue("postprocessor"))
      28             : {
      29         102 : }
      30             : 
      31             : void
      32         715 : CumulativeValuePostprocessor::initialize()
      33             : {
      34         715 : }
      35             : 
      36             : void
      37         715 : CumulativeValuePostprocessor::execute()
      38             : {
      39         715 :   _sum = _sum_old + _pps_value;
      40         715 : }
      41             : 
      42             : Real
      43         715 : CumulativeValuePostprocessor::getValue() const
      44             : {
      45         715 :   return _sum;
      46             : }

Generated by: LCOV version 1.14