https://mooseframework.inl.gov
ADNodalKernel.h
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 
10 #pragma once
11 
12 #include "NodalKernelBase.h"
13 #include "ADFunctorInterface.h"
14 #include "MooseVariableInterface.h"
15 
20  public ADFunctorInterface,
21  public MooseVariableInterface<Real>
22 {
23 public:
29 
31 
38  void computeResidual() override;
39 
46  void computeJacobian() override;
47 
52  void computeOffDiagJacobian(unsigned int jvar) override final;
53 
58  const MooseVariable & variable() const override { return _var; }
59 
60 protected:
64  virtual ADReal computeQpResidual() = 0;
65 
68 
71 };
Class for stuff related to variables.
Definition: Adaptivity.h:31
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
const ADVariableValue & _u
Value of the unknown variable this is acting on.
Definition: ADNodalKernel.h:70
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const MooseVariable & variable() const override
Gets the variable this is active on.
Definition: ADNodalKernel.h:58
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:42
An interface for accessing Moose::Functors for systems that care about automatic differentiation, e.g.
MooseVariable & _var
variable this works on
Definition: ADNodalKernel.h:67
virtual ADReal computeQpResidual()=0
The user can override this function to compute the residual at a node.
void computeOffDiagJacobian(unsigned int jvar) override final
This method simply routes to computeJacobian whenever jvar == _var.number() since global AD computes ...
Definition: ADNodalKernel.C:71
Base class for creating nodal kernels with AD-computed Jacobians.
Definition: ADNodalKernel.h:19
static InputParameters validParams()
Class constructor.
Definition: ADNodalKernel.C:19
forward declarations
Base class for creating new types of nodal kernels.
Interface for objects that need to get values of MooseVariables.
ADNodalKernel(const InputParameters &parameters)
Definition: ADNodalKernel.C:26
void computeJacobian() override
Compute the Jacobian at one node.
Definition: ADNodalKernel.C:56
void computeResidual() override
Compute the residual at the current node.
Definition: ADNodalKernel.C:41