24 "If true, the functor to add is on the right hand side of the equation. By convention, all " 25 "terms are moved to the left hand side, so if true, a factor of -1 is applied.");
30 "The operation mode, 'add' just returns the value of the functor and " 31 "therefore adds the functor value to the residual" 32 "'target' sets the residual term in such a way that the residual of " 33 "the variable u vanishes if its value matches the given functor. " 34 "Please note: In mode 'target' this kernel only imposes the equality " 35 "between the variable and the functor when it is the only kernel in " 36 "that variable's equation on the specified subdomains.");
44 _functor(getFunctor<
ADReal>(
"functor")),
45 _sign(getParam<bool>(
"functor_on_rhs") ? -1.0 : 1.0)
58 return _sign * functor_value;
virtual ADReal precomputeQpResidual() override
Called before forming the residual for an element.
static InputParameters validParams()
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
const ADTemplateVariableValue< T > & _u
Holds the solution at current quadrature points.
FunctorKernel(const InputParameters ¶meters)
DualNumber< Real, DNDerivativeType, true > ADReal
const Real _sign
Sign to apply to functor.
registerMooseObject("MooseApp", FunctorKernel)
const QBase *const & _qrule
active quadrature rule
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Argument for requesting functor evaluation at a quadrature point location in an element.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
const Moose::Functor< ADReal > & _functor
Functor to add.
static InputParameters validParams()
const Elem *const & _current_elem
Current element.
const Mode _mode
The working mode of this kernel ("add" or "target")
void ErrorVector unsigned int
const MooseArray< Point > & _q_point
The physical location of the element's quadrature Points, indexed by _qp.
unsigned int _qp
The current quadrature point index.
Adds a term from a functor.