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 "ElementExtremeFunctorValue.h" 11 : 12 : registerMooseObject("MooseApp", ElementExtremeFunctorValue); 13 : registerMooseObject("MooseApp", ADElementExtremeFunctorValue); 14 : 15 : template <bool is_ad> 16 : InputParameters 17 29068 : ElementExtremeFunctorValueTempl<is_ad>::validParams() 18 : { 19 29068 : InputParameters params = ExtremeValueBase<ElementPostprocessor>::validParams(); 20 29068 : params.addRequiredParam<MooseFunctorName>( 21 : "functor", "The name of the functor for which to find the extrema"); 22 29068 : params.addParam<MooseFunctorName>( 23 : "proxy_functor", 24 : "The name of the functor to use to identify the location at which " 25 : "the functor value should be taken; if not provided, this defaults " 26 : "to the 'functor' parameter."); 27 29068 : params.addClassDescription( 28 : "Finds either the min or max elemental value of a functor over the domain."); 29 29068 : return params; 30 0 : } 31 : 32 : template <bool is_ad> 33 280 : ElementExtremeFunctorValueTempl<is_ad>::ElementExtremeFunctorValueTempl( 34 : const InputParameters & parameters) 35 : : ExtremeValueBase<ElementPostprocessor>(parameters), 36 280 : _functor(getFunctor<GenericReal<is_ad>>("functor")), 37 560 : _proxy_functor(isParamValid("proxy_functor") ? getFunctor<GenericReal<is_ad>>("proxy_functor") 38 560 : : getFunctor<GenericReal<is_ad>>("functor")) 39 : { 40 280 : } 41 : 42 : template <bool is_ad> 43 : std::pair<Real, Real> 44 104361 : ElementExtremeFunctorValueTempl<is_ad>::getProxyValuePair() 45 : { 46 : // Most element evaluations do not use skewness correction, 47 : // but this could become a parameter in the future 48 104361 : Moose::ElemArg elem = makeElemArg(_current_elem); 49 193961 : return std::make_pair(MetaPhysicL::raw_value(_proxy_functor(elem, determineState())), 50 298322 : MetaPhysicL::raw_value(_functor(elem, determineState()))); 51 : } 52 : 53 : template class ElementExtremeFunctorValueTempl<false>; 54 : template class ElementExtremeFunctorValueTempl<true>;