17#include "libmesh/threads.h"
18#include "libmesh/quadrature.h"
33 Moose::VarKindType::VAR_SOLVER,
34 Moose::VarFieldType::VAR_FIELD_VECTOR),
35 _var(*mooseVariable()),
37 _grad_test(_var.gradPhi()),
38 _phi(_assembly.phi(_var)),
39 _grad_phi(_assembly.gradPhi(_var)),
40 _u(_is_implicit ? _var.sln() : _var.slnOld()),
41 _grad_u(_is_implicit ? _var.gradSln() : _var.gradSlnOld())
61 var->sys().solution().add_vector(
_local_re, var->dofIndices());
78 DenseVector<Number> diag(rows);
79 for (
unsigned int i = 0; i < rows; i++)
83 var->sys().solution().add_vector(diag, var->dofIndices());
100 const auto phi_size = jvar.dofIndices().size();
104 for (
_j = 0;
_j < phi_size;
_j++)
This is the common base class for the three main kernel types implemented in MOOSE,...
std::vector< MooseVariableFEBase * > _save_in
bool _has_diag_save_in
The aux variables to save the diagonal Jacobian contributions to.
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.
bool _has_save_in
The aux variables to save the residual contributions to.
const MooseArray< Real > & _JxW
The current quadrature point weight value.
unsigned int _j
current index for the shape function
std::vector< MooseVariableFEBase * > _diag_save_in
unsigned int _i
current index for the test function
const QBase *const & _qrule
active quadrature rule
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.
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
Interface for objects that need to get values of MooseVariables.
MooseVariableFE< RealVectorValue > * 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.
virtual void precalculateJacobian()
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.
SystemBase & _sys
Reference to the EquationSystem object.
virtual void precalculateOffDiagJacobian(unsigned int)
virtual void precalculateResidual()
bool computingScalingJacobian() const
Whether we are computing an initial Jacobian for automatic variable scaling.
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.
const VectorVariableTestValue & _test
the current test function
static InputParameters validParams()
virtual void computeOffDiagJacobianScalar(unsigned int jvar) override
Computes jacobian block with respect to a scalar variable.
virtual Real computeQpOffDiagJacobianScalar(unsigned int)
For coupling scalar variables.
virtual void computeJacobian() override
Compute this VectorKernel's contribution to the diagonal Jacobian entries.
VectorKernel(const InputParameters ¶meters)
const VectorVariablePhiValue & _phi
the current shape functions
virtual Real computeQpOffDiagJacobian(unsigned int)
This is the virtual that derived classes should override for computing an off-diagonal Jacobian compo...
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes d-residual / d-jvar... storing the result in Ke.
virtual Real computeQpJacobian()
Compute this Kernel's contribution to the Jacobian at the current quadrature point.
const VectorMooseVariable & _var
This is a regular kernel so we cast to a regular MooseVariable.
virtual Real computeQpResidual()=0
Compute this Kernel's contribution to the residual at the current quadrature point.
virtual void computeResidual() override
Compute this VectorKernel's contribution to the residual.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...