16#include "libmesh/quadrature.h"
31 Moose::VarKindType::VAR_SOLVER,
32 Moose::VarFieldType::VAR_FIELD_ARRAY),
34 _var(*mooseVariable()),
35 _ad_JxW(_assembly.adJxWFace()),
36 _ad_coord(_assembly.adCoordTransformation()),
37 _use_displaced_mesh(getParam<bool>(
"use_displaced_mesh")),
38 _normals(_assembly.adNormals()),
39 _test(_var.phiFace()),
40 _grad_test(_var.gradPhiFace()),
42 _grad_u(_var.adGradSlnFace()),
45 _raw_work_vector(_count)
51 paramError(
"save_in",
"Save-in is not supported by AD array boundary conditions");
67 for (
const auto c : make_range(
_count))
DualNumber< Real, DNDerivativeType, true > ADReal
virtual void computeQpResidual(ADRealEigenVector &residual)=0
Compute this boundary condition's contribution to the residual at the current quadrature point,...
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes this object's contribution to off-diagonal blocks of the system Jacobian matrix.
ArrayMooseVariable & _var
The array variable this boundary condition acts on.
virtual void computeResidual() override
Compute this object's contribution to the residual.
const MooseArray< ADReal > & _ad_JxW
Quadrature weights times the face Jacobian, with derivatives on a displaced mesh.
const MooseArray< ADReal > & _ad_coord
Coordinate transformation factors, with derivatives on a displaced mesh.
ADRealEigenVector _work_vector
Work vector for the residual at a quadrature point.
void computeResidualsForJacobian()
Fill _local_ad_re with the AD residuals of all test functions on the current face.
const ArrayVariableTestValue & _test
test function values (in QPs)
const unsigned int _count
Number of components of the array variable.
virtual void computeOffDiagJacobianScalar(unsigned int jvar) override
Computes jacobian block with respect to a scalar variable.
virtual void computeResidualAndJacobian() override
Compute this object's contribution to the residual and Jacobian simultaneously.
const bool _use_displaced_mesh
Whether this boundary condition is evaluated on the displaced mesh.
ADArrayIntegratedBC(const InputParameters ¶meters)
static InputParameters validParams()
virtual void computeJacobian() override
Compute this object's contribution to the diagonal Jacobian entries.
std::vector< ADReal > _local_ad_re
Local AD residuals for the Jacobian computation.
RealEigenVector _raw_work_vector
Values of _work_vector without derivatives, for the residual computation.
virtual void initQpResidual()
Put necessary evaluations depending on qp but independent of test functions here.
An interface for accessing Moose::Functors for systems that care about automatic differentiation,...
static InputParameters validParams()
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
Base class for deriving any boundary condition of a integrated type.
static InputParameters validParams()
std::vector< AuxVariableName > _diag_save_in_strings
const QBase *const & _qrule
active quadrature rule
unsigned int _qp
quadrature point index
const MooseArray< Real > & _JxW
transformed Jacobian weights
unsigned int _i
i-th, j-th index for enumerating test and shape functions
std::vector< AuxVariableName > _save_in_strings
const MooseArray< Real > & _coord
coordinate transformation
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
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 addResiduals(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals corresponding to the provided dof indices.
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...