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 28713 : ElementIntegralFunctorPostprocessorTempl<is_ad>::validParams() 18 : { 19 28713 : InputParameters params = ElementIntegralPostprocessor::validParams(); 20 28713 : params.addRequiredParam<MooseFunctorName>("functor", 21 : "The name of the functor that this object operates on"); 22 86139 : params.addParam<MooseFunctorName>( 23 57426 : "prefactor", 1, "The name of a pre-factor inside the integrand"); 24 28713 : params.addClassDescription("Computes a volume integral of the specified functor"); 25 28713 : return params; 26 0 : } 27 : 28 : template <bool is_ad> 29 95 : ElementIntegralFunctorPostprocessorTempl<is_ad>::ElementIntegralFunctorPostprocessorTempl( 30 : const InputParameters & parameters) 31 : : ElementIntegralPostprocessor(parameters), 32 95 : _functor(getFunctor<GenericReal<is_ad>>("functor")), 33 190 : _prefactor(getFunctor<GenericReal<is_ad>>("prefactor")) 34 : { 35 95 : } 36 : 37 : template <bool is_ad> 38 : Real 39 1979 : ElementIntegralFunctorPostprocessorTempl<is_ad>::computeQpIntegral() 40 : { 41 1979 : Moose::ElemQpArg elem_qp = {_current_elem, _qp, _qrule, _q_point[_qp]}; 42 3599 : return MetaPhysicL::raw_value(_prefactor(elem_qp, determineState()) * 43 5219 : _functor(elem_qp, determineState())); 44 : } 45 : 46 : template class ElementIntegralFunctorPostprocessorTempl<false>; 47 : template class ElementIntegralFunctorPostprocessorTempl<true>;