LCOV - code coverage report
Current view: top level - src/postprocessors - ElementAverageFunctorPostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #33416 (b10b36) with base 9fbd27 Lines: 20 25 80.0 %
Date: 2026-07-23 16:15:30 Functions: 6 7 85.7 %
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 "ElementAverageFunctorPostprocessor.h"
      11             : 
      12             : registerMooseObject("MooseApp", ElementAverageFunctorPostprocessor);
      13             : 
      14             : InputParameters
      15        3149 : ElementAverageFunctorPostprocessor::validParams()
      16             : {
      17        3149 :   return ElementIntegralFunctorPostprocessor::validParams();
      18             : }
      19             : 
      20          30 : ElementAverageFunctorPostprocessor::ElementAverageFunctorPostprocessor(
      21          30 :     const InputParameters & parameters)
      22          30 :   : ElementIntegralFunctorPostprocessor(parameters)
      23             : {
      24          30 : }
      25             : 
      26             : void
      27          26 : ElementAverageFunctorPostprocessor::initialize()
      28             : {
      29          26 :   ElementIntegralFunctorPostprocessor::initialize();
      30          26 :   _volume = 0;
      31          26 : }
      32             : 
      33             : void
      34         117 : ElementAverageFunctorPostprocessor::execute()
      35             : {
      36         117 :   ElementIntegralFunctorPostprocessor::execute();
      37         117 :   _volume += _current_elem_volume;
      38         117 : }
      39             : 
      40             : Real
      41          26 : ElementAverageFunctorPostprocessor::getValue() const
      42             : {
      43          26 :   return ElementIntegralFunctorPostprocessor::getValue() / _volume;
      44             : }
      45             : 
      46             : void
      47          26 : ElementAverageFunctorPostprocessor::finalize()
      48             : {
      49          26 :   ElementIntegralFunctorPostprocessor::finalize();
      50          26 :   gatherSum(_volume);
      51          26 : }
      52             : 
      53             : void
      54           0 : ElementAverageFunctorPostprocessor::threadJoin(const UserObject & y)
      55             : {
      56           0 :   ElementIntegralFunctorPostprocessor::threadJoin(y);
      57           0 :   const auto & pps = static_cast<const ElementAverageFunctorPostprocessor &>(y);
      58           0 :   _volume += pps._volume;
      59           0 : }

Generated by: LCOV version 1.14