18#include "libmesh/quadrature.h"
32 Moose::VarKindType::VAR_SOLVER,
33 Moose::VarFieldType::VAR_FIELD_ARRAY),
34 _var(*mooseVariable()),
35 _normals(_assembly.normals()),
36 _phi(_assembly.phiFace(_var)),
37 _test(_var.phiFace()),
38 _u(_is_implicit ? _var.sln() : _var.slnOld()),
54 "saved-in auxiliary variable is incompatible with the object's nonlinear variable: ",
70 "saved-in auxiliary variable is incompatible with the object's nonlinear variable: ",
94 "Size of local residual is not equal to the number of array variable compoments");
109 mooseError(
"Save-in variable for an array kernel must be an array variable");
141 mooseError(
"Save-in variable for an array kernel must be an array variable");
149 return RealEigenVector::Zero(
_var.
count());
156 if (!jvar.dofIndices().size())
164 const auto phi_size = jvar.phiSize();
174 for (
_j = 0;
_j < phi_size;
_j++)
193 mooseError(
"Save-in variable for an array kernel must be an array variable");
227 return RealEigenMatrix::Zero(
_var.
count(), (
unsigned int)jvar.
order() + 1);
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
ArrayMooseVariable & _var
virtual RealEigenVector computeQpJacobian()
Method for computing the diagonal Jacobian at quadrature points.
virtual RealEigenMatrix computeQpOffDiagJacobianScalar(const MooseVariableScalar &jvar)
This is the virtual that derived classes should override for computing a full Jacobian component.
virtual RealEigenMatrix computeQpOffDiagJacobian(const MooseVariableFEBase &jvar)
Method for computing an off-diagonal jacobian component at quadrature points.
RealEigenVector _work_vector
Work vector for residual.
virtual void initQpOffDiagJacobian(const MooseVariableFEBase &)
Put necessary evaluations depending on qp but independent on test and shape functions here for off-di...
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes d-ivar-residual / d-jvar...
void computeOffDiagJacobianScalar(unsigned int jvar) override
Computes jacobian block with respect to a scalar variable.
virtual void computeQpResidual(RealEigenVector &residual)=0
Method for computing the residual at quadrature points, to be filled in residual.
virtual void computeJacobian() override
Compute this object's contribution to the diagonal Jacobian entries.
virtual void computeResidual() override
Compute this object's contribution to the residual.
static InputParameters validParams()
virtual void initQpResidual()
Put necessary evaluations depending on qp but independent on test functions here.
const ArrayVariableTestValue & _test
test function values (in QPs)
const ArrayVariablePhiValue & _phi
shape function values (in QPs)
ArrayIntegratedBC(const InputParameters ¶meters)
virtual void initQpJacobian()
Put necessary evaluations depending on qp but independent on test and shape functions here.
const unsigned int _count
Number of components of the array variable.
void saveFullLocalArrayJacobian(DenseMatrix< Number > &ke, unsigned int i, unsigned int ntest, unsigned int j, unsigned int nphi, unsigned int ivar, unsigned int jvar, const RealEigenMatrix &v) const
Helper function for assembling full Jacobian contriubutions on local quadrature points for an array k...
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...
DenseVector< Real > getJacobianDiagonal(const DenseMatrix< Number > &ke)
void saveDiagLocalArrayJacobian(DenseMatrix< Number > &ke, unsigned int i, unsigned int ntest, unsigned int j, unsigned int nphi, unsigned int ivar, const RealEigenVector &v) const
Helper function for assembling diagonal Jacobian contriubutions on local quadrature points for an arr...
Base class for deriving any boundary condition of a integrated type.
static InputParameters validParams()
bool _has_diag_save_in
The aux variables to save the diagonal Jacobian contributions to.
std::vector< AuxVariableName > _diag_save_in_strings
const QBase *const & _qrule
active quadrature rule
bool _has_save_in
The aux variables to save the residual contributions to.
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
std::vector< MooseVariableFEBase * > _diag_save_in
std::vector< MooseVariableFEBase * > _save_in
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 libMesh::FEType & feType() const
Get the type of finite element object.
SystemBase & sys()
Get the system this variable is part of.
libMesh::Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int.
unsigned int number() const
Get variable number coming from libMesh.
unsigned int count() const
Get the number of components Note: For standard and vector variables, the number is one.
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
void addSolution(const DenseVector< libMesh::Number > &v)
Add passed in local DOF values onto the current solution.
This class provides an interface for common operations on field variables of both FE and FV types wit...
Interface for objects that need to get values of MooseVariables.
MooseVariableFE< RealEigenVector > * mooseVariable() const
Return the MooseVariableFE object that this interface acts on.
Class for scalar variables (they are different).
THREAD_ID _tid
The thread ID for this kernel.
Assembly & _assembly
Reference to this Kernel's assembly object.
const MooseVariableFieldBase & getVariable(unsigned int jvar_num) const
Retrieve the variable object from our system associated with jvar_num.
SubProblem & _subproblem
Reference to this kernel's SubProblem.
SystemBase & _sys
Reference to the EquationSystem object.
virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the variable reference for requested ArrayMooseVariable which may be in any system.
virtual void addVariableToZeroOnJacobian(std::string var_name)
Adds this variable to the list of variables to be zeroed during each Jacobian evaluation.
virtual void addVariableToZeroOnResidual(std::string var_name)
Adds this variable to the list of variables to be zeroed during each residual evaluation.
virtual MooseVariableScalar & getScalarVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a scalar variable with specified number.
DenseMatrix< Number > _local_ke
Holds local Jacobian entries as they are accumulated by this Kernel.
void accumulateTaggedLocalMatrix()
Local Jacobian blocks will be appended by adding the current local kernel Jacobian.
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
Prepare data for computing element jacobian according to the active tags.
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...
std::string incompatVarMsg(MooseVariableFieldBase &var1, MooseVariableFieldBase &var2)
Builds and returns a string of the form: