LCOV - code coverage report
Current view: top level - src/postprocessors - ElementIntegralFunctorPostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 15 16 93.8 %
Date: 2025-07-17 01:28:37 Functions: 6 6 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 "ElementIntegralFunctorPostprocessor.h"
      11             : 
      12             : registerMooseObject("MooseApp", ElementIntegralFunctorPostprocessor);
      13             : registerMooseObject("MooseApp", ADElementIntegralFunctorPostprocessor);
      14             : 
      15             : template <bool is_ad>
      16             : InputParameters
      17       28701 : ElementIntegralFunctorPostprocessorTempl<is_ad>::validParams()
      18             : {
      19       28701 :   InputParameters params = ElementIntegralPostprocessor::validParams();
      20       28701 :   params.addRequiredParam<MooseFunctorName>("functor",
      21             :                                             "The name of the functor that this object operates on");
      22       86103 :   params.addParam<MooseFunctorName>(
      23       57402 :       "prefactor", 1, "The name of a pre-factor inside the integrand");
      24       28701 :   params.addClassDescription("Computes a volume integral of the specified functor");
      25       28701 :   return params;
      26           0 : }
      27             : 
      28             : template <bool is_ad>
      29          89 : ElementIntegralFunctorPostprocessorTempl<is_ad>::ElementIntegralFunctorPostprocessorTempl(
      30             :     const InputParameters & parameters)
      31             :   : ElementIntegralPostprocessor(parameters),
      32          89 :     _functor(getFunctor<GenericReal<is_ad>>("functor")),
      33         178 :     _prefactor(getFunctor<GenericReal<is_ad>>("prefactor"))
      34             : {
      35          89 : }
      36             : 
      37             : template <bool is_ad>
      38             : Real
      39        1763 : ElementIntegralFunctorPostprocessorTempl<is_ad>::computeQpIntegral()
      40             : {
      41        1763 :   Moose::ElemQpArg elem_qp = {_current_elem, _qp, _qrule, _q_point[_qp]};
      42        3203 :   return MetaPhysicL::raw_value(_prefactor(elem_qp, determineState()) *
      43        4643 :                                 _functor(elem_qp, determineState()));
      44             : }
      45             : 
      46             : template class ElementIntegralFunctorPostprocessorTempl<false>;
      47             : template class ElementIntegralFunctorPostprocessorTempl<true>;

Generated by: LCOV version 1.14