LCOV - code coverage report
Current view: top level - include/utils - StabilizationUtils.h (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 9 9 100.0 %
Date: 2025-07-25 05:00:39 Functions: 7 10 70.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 "MooseTypes.h"
      11             : 
      12             : namespace StabilizationUtils
      13             : {
      14             : template <typename Functor>
      15             : auto
      16     4841348 : elementAverage(const Functor & f, const MooseArray<Real> & JxW, const MooseArray<Real> & coord)
      17             : {
      18             :   using ret_type = decltype(f(std::declval<unsigned int>()));
      19     4841348 :   ret_type avg;
      20     4841348 :   MathUtils::mooseSetToZero(avg);
      21     4841348 :   Real v = 0;
      22    40971124 :   for (auto qp : make_range(JxW.size()))
      23             :   {
      24    36129776 :     avg += f(qp) * JxW[qp] * coord[qp];
      25    36129776 :     v += JxW[qp] * coord[qp];
      26             :   }
      27     4841348 :   avg /= v;
      28     4841348 :   return avg;
      29             : }
      30             : }

Generated by: LCOV version 1.14