18#include "libmesh/threads.h"
19#include "libmesh/quadrature.h"
34 Moose::VarKindType::VAR_SOLVER,
35 Moose::VarFieldType::VAR_FIELD_ARRAY),
37 _var(*mooseVariable()),
39 _grad_test(_var.gradPhi()),
40 _array_grad_test(_var.arrayGradPhi()),
41 _phi(_assembly.phi(_var)),
42 _grad_phi(_assembly.gradPhi(_var)),
44 _grad_u(_var.adGradSln()),
virtual void computeResidual() override
Compute this object's contribution to the residual.
const unsigned int _count
Number of components of the array variable.
virtual void initQpResidual()
Put necessary evaluations depending on qp but independent on test functions here.
std::vector< ADReal > _local_ad_re
ArrayMooseVariable & _var
This is an array kernel so we cast to a ArrayMooseVariable.
virtual void computeJacobian() override
Compute this object's contribution to the diagonal Jacobian entries.
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes this object's contribution to off-diagonal blocks of the system Jacobian matrix.
virtual void computeQpResidual(ADRealEigenVector &residual)=0
Compute this Kernel's contribution to the residual at the current quadrature point,...
const ArrayVariableTestValue & _test
the current test function
static InputParameters validParams()
ADArrayKernel(const InputParameters ¶meters)
ADRealEigenVector _work_vector
Work vector for residual and diag jacobian.
const Elem * _my_elem
Cache variable to prevent multiple invocations of Jacobian computation for one element (recall that A...
An interface for accessing Moose::Functors for systems that care about automatic differentiation,...
void saveLocalArrayResidual(DenseVector< Number > &re, unsigned int i, unsigned int ntest, const RealEigenVector &v) const
Helper function for assembling residual contriubutions on local quadrature points for an array kernel...
void saveLocalADArray(std::vector< ADReal > &re, unsigned int i, unsigned int ntest, const ADRealEigenVector &v) const
This is the common base class for the three main kernel types implemented in MOOSE,...
static InputParameters validParams()
const MooseArray< Real > & _coord
The scaling factor to convert from cartesian to another coordinate system (e.g rz,...
unsigned int _qp
The current quadrature point index.
const MooseArray< Real > & _JxW
The current quadrature point weight value.
const Elem *const & _current_elem
Current element.
unsigned int _i
current index for the test function
const QBase *const & _qrule
active quadrature rule
const std::vector< Real > & arrayScalingFactor() const
unsigned int number() const
Get variable number coming from libMesh.
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
Interface for objects that need to get values of MooseVariables.
MooseVariableFE< RealEigenVector > * mooseVariable() const
Return the MooseVariableFE object that this interface acts on.
virtual void precalculateJacobian()
Assembly & _assembly
Reference to this Kernel's assembly object.
SubProblem & _subproblem
Reference to this kernel's SubProblem.
virtual void precalculateResidual()
virtual void haveADObjects(bool have_ad_objects)
Method for setting whether we have any ad objects.
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided residual derivatives into the Jacobian for the provided dof indices.
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual according to active tags.
DenseVector< Number > _local_re
Holds local residual entries as they are accumulated by this Kernel.
virtual unsigned int size() const override final
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...