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

Generated by: LCOV version 1.14