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