11 #include "metaphysicl/raw_type.h" 22 "Evaluates the gradient of a functor (variable, function or functor material property) on " 23 "the current element or quadrature point.");
24 params.
addRequiredParam<MooseFunctorName>(
"functor",
"The functor to evaluate");
25 params.
addParam<MooseFunctorName>(
"factor", 1,
"A factor to apply on the functor");
26 params.
addParam<MaterialPropertyName>(
27 "factor_matprop", 1,
"A (regular) material property factor to apply on the functor");
31 params.
addParam<
unsigned short>(
"ghost_layers", 1,
"The number of layers of elements to ghost.");
33 "ElementSideNeighborLayers",
37 rm_params.
set<
unsigned short>(
"layers") = obj_params.
get<
unsigned short>(
"ghost_layers");
38 rm_params.
set<
bool>(
"use_displaced_mesh") = obj_params.
get<
bool>(
"use_displaced_mesh");
47 _functor(getFunctor<
GenericReal<is_ad>>(
"functor")),
49 _factor_matprop(getGenericMaterialProperty<
Real, is_ad>(
"factor_matprop")),
55 "The variable must be a non-vector, non-array finite-volume/finite-element variable.");
58 paramError(
"variable",
"This AuxKernel only supports Elemental fields");
66 const auto state = determineState();
71 raw_value(_functor.gradient(qp_arg, state));
75 const auto elem_arg = makeElemArg(_current_elem);
76 mooseAssert(_qp == 0,
"Only one Qp per element expected when using an elemental argument");
78 raw_value(_functor.gradient(elem_arg, state));
Moose::GenericType< Real, is_ad > GenericReal
virtual RealVectorValue computeValue() override
Compute and return the value of the aux variable.
Class for stuff related to variables.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Evaluate a functor (functor material property, function or variable) with either the cell-center or q...
const bool _use_qp_arg
Whether to use a quadrature-based functor argument, appropriate for finite element evaluations...
FunctorElementalGradientAuxTempl(const InputParameters ¶meters)
Argument for requesting functor evaluation at a quadrature point location in an element.
static InputParameters validParams()
MooseVariableField< RealVectorValue > & _var
This is a regular kernel so we cast to a regular MooseVariable.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
bool isNodal() const
Nodal or elemental kernel?
registerMooseObject("MooseApp", FunctorElementalGradientAux)