https://mooseframework.inl.gov
ElementExtremeFunctorValue.C
Go to the documentation of this file.
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 
11 
14 
15 template <bool is_ad>
18 {
20  params.addRequiredParam<MooseFunctorName>(
21  "functor", "The name of the functor for which to find the extrema");
22  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  params.addClassDescription(
28  "Finds either the min or max elemental value of a functor over the domain.");
29  return params;
30 }
31 
32 template <bool is_ad>
34  const InputParameters & parameters)
36  _functor(getFunctor<GenericReal<is_ad>>("functor")),
37  _proxy_functor(isParamValid("proxy_functor") ? getFunctor<GenericReal<is_ad>>("proxy_functor")
38  : getFunctor<GenericReal<is_ad>>("functor"))
39 {
40 }
41 
42 template <bool is_ad>
43 std::pair<Real, Real>
45 {
46  // Most element evaluations do not use skewness correction,
47  // but this could become a parameter in the future
48  Moose::ElemArg elem = makeElemArg(_current_elem);
49  return std::make_pair(MetaPhysicL::raw_value(_proxy_functor(elem, determineState())),
50  MetaPhysicL::raw_value(_functor(elem, determineState())));
51 }
52 
Moose::GenericType< Real, is_ad > GenericReal
Definition: MooseTypes.h:648
auto raw_value(const Eigen::Map< T > &in)
Definition: EigenADReal.h:73
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
static InputParameters validParams()
A structure that is used to evaluate Moose functors logically at an element/cell center.
ElementExtremeFunctorValueTempl(const InputParameters &parameters)
virtual std::pair< Real, Real > getProxyValuePair() override
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
registerMooseObject("MooseApp", ElementExtremeFunctorValue)
A postprocessor for collecting an extreme value for a functor with an element argument.