https://mooseframework.inl.gov
ElementIntegralFunctorPostprocessor.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>("functor",
21  "The name of the functor that this object operates on");
22  params.addParam<MooseFunctorName>(
23  "prefactor", 1, "The name of a pre-factor inside the integrand");
24  params.addClassDescription("Computes a volume integral of the specified functor");
25  return params;
26 }
27 
28 template <bool is_ad>
30  const InputParameters & parameters)
31  : ElementIntegralPostprocessor(parameters),
32  _functor(getFunctor<GenericReal<is_ad>>("functor")),
33  _prefactor(getFunctor<GenericReal<is_ad>>("prefactor"))
34 {
35 }
36 
37 template <bool is_ad>
38 Real
40 {
41  Moose::ElemQpArg elem_qp = {_current_elem, _qp, _qrule, _q_point[_qp]};
42  return MetaPhysicL::raw_value(_prefactor(elem_qp, determineState()) *
43  _functor(elem_qp, determineState()));
44 }
45 
ElementIntegralFunctorPostprocessorTempl(const InputParameters &parameters)
This postprocessor computes a volume integral of the specified variable.
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...
registerMooseObject("MooseApp", ElementIntegralFunctorPostprocessor)
Argument for requesting functor evaluation at a quadrature point location in an element.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...
This postprocessor computes an element integral of the specified functor.