LCOV - code coverage report
Current view: top level - src/postprocessors - InternalSideIntegralPostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 31 31 100.0 %
Date: 2026-05-29 20:35:17 Functions: 8 8 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 "InternalSideIntegralPostprocessor.h"
      11             : 
      12             : #include "libmesh/quadrature.h"
      13             : 
      14             : InputParameters
      15        6241 : InternalSideIntegralPostprocessor::validParams()
      16             : {
      17        6241 :   InputParameters params = InternalSidePostprocessor::validParams();
      18        6241 :   return params;
      19             : }
      20             : 
      21          62 : InternalSideIntegralPostprocessor::InternalSideIntegralPostprocessor(
      22          62 :     const InputParameters & parameters)
      23          62 :   : InternalSidePostprocessor(parameters), _qp(0), _integral_value(0), _qp_integration(true)
      24             : {
      25          62 : }
      26             : 
      27             : void
      28          58 : InternalSideIntegralPostprocessor::initialize()
      29             : {
      30          58 :   _integral_value = 0;
      31          58 : }
      32             : 
      33             : void
      34        3168 : InternalSideIntegralPostprocessor::execute()
      35             : {
      36        3168 :   _integral_value += computeIntegral();
      37        3168 : }
      38             : 
      39             : Real
      40          53 : InternalSideIntegralPostprocessor::getValue() const
      41             : {
      42          53 :   return _integral_value;
      43             : }
      44             : 
      45             : void
      46           5 : InternalSideIntegralPostprocessor::threadJoin(const UserObject & y)
      47             : {
      48           5 :   const auto & pps = static_cast<const InternalSideIntegralPostprocessor &>(y);
      49           5 :   _integral_value += pps._integral_value;
      50           5 : }
      51             : 
      52             : Real
      53        3168 : InternalSideIntegralPostprocessor::computeIntegral()
      54             : {
      55        3168 :   Real sum = 0;
      56        3168 :   if (_qp_integration)
      57        5472 :     for (_qp = 0; _qp < _qrule->n_points(); _qp++)
      58        3744 :       sum += _JxW[_qp] * _coord[_qp] * computeQpIntegral();
      59             :   else
      60             :   {
      61             :     // Finite volume functors integration is over FaceInfo, not quadrature points
      62        1440 :     getFaceInfos();
      63             : 
      64        2880 :     for (auto & fi : _face_infos)
      65        1440 :       sum += fi->faceArea() * fi->faceCoord() * computeFaceInfoIntegral(fi);
      66             :   }
      67        3168 :   return sum;
      68             : }
      69             : 
      70             : void
      71          53 : InternalSideIntegralPostprocessor::finalize()
      72             : {
      73          53 :   gatherSum(_integral_value);
      74          53 : }

Generated by: LCOV version 1.14