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

Generated by: LCOV version 1.14