https://mooseframework.inl.gov
UserForcingFunctorNodalKernel.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 #include "MooseFunctor.h"
12 
14 
17 {
19  params.addClassDescription(
20  "Residual contribution to an ODE from a source functor acting at nodes.");
21  params.addRequiredParam<MooseFunctorName>("functor", "The forcing functor");
22  return params;
23 }
24 
26  : ADNodalKernel(parameters), _functor(getFunctor<ADReal>("functor"))
27 {
28 }
29 
30 ADReal
32 {
33  return -_functor(nodeArg(), determineState());
34 }
Represents the rate in a simple ODE of du/dt = f.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:46
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...
const Moose::Functor< ADReal > & _functor
registerMooseObject("MooseApp", UserForcingFunctorNodalKernel)
Base class for creating nodal kernels with AD-computed Jacobians.
Definition: ADNodalKernel.h:18
Moose::NodeArg nodeArg() const
virtual ADReal computeQpResidual() override
The user can override this function to compute the residual at a node.
static InputParameters validParams()
Class constructor.
Definition: ADNodalKernel.C:19
static InputParameters validParams()
Constructor grabs the Function.
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...
UserForcingFunctorNodalKernel(const InputParameters &parameters)