Go to the documentation of this file.
18 #include "libmesh/quadrature.h"
36 _var(*mooseVariable()),
37 _normals(_assembly.normals()),
38 _phi(_assembly.phiFace(_var)),
39 _test(_var.phiFace()),
40 _u(_is_implicit ? _var.sln() : _var.slnOld()),
55 "saved-in auxiliary variable is incompatible with the object's nonlinear variable: ",
71 "saved-in auxiliary variable is incompatible with the object's nonlinear variable: ",
93 mooseAssert(residual.size() ==
_count,
94 "Size of local residual is not equal to the number of array variable compoments");
103 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
106 auto * avar = dynamic_cast<ArrayMooseVariable *>(var);
110 mooseError(
"Save-in variable for an array kernel must be an array variable");
137 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
140 auto * avar = dynamic_cast<ArrayMooseVariable *>(var);
142 avar->addSolution(diag);
144 mooseError(
"Save-in variable for an array kernel must be an array variable");
152 size_t jvar_num = jvar.
number();
165 for (
_j = 0;
_j < phi_size;
_j++)
178 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
181 auto * avar = dynamic_cast<ArrayMooseVariable *>(var);
183 avar->addSolution(diag);
185 mooseError(
"Save-in variable for an array kernel must be an array variable");
unsigned int _i
i-th, j-th index for enumerating test and shape functions
MooseVariableFEBase & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
void accumulateTaggedLocalMatrix()
Local Jacobian blocks will be appended by adding the current local kernel Jacobian.
MooseVariableFE< RealEigenVector > * mooseVariable() const
Get the variable that this object is using.
Class for scalar variables (they are different).
const FEType & feType() const
Get the type of finite element object.
void mooseError(Args &&... args) const
virtual size_t phiSize() const =0
Return phi size.
void saveLocalArrayResidual(DenseVector< Number > &re, unsigned int i, unsigned int ntest, const RealEigenVector &v)
Helper function for assembling residual contriubutions on local quadrature points for an array variab...
void computeJacobianBlockScalar(unsigned int jvar) override
Computes jacobian block with respect to a scalar variable.
DenseVector< Number > _local_re
Holds residual entries as they are accumulated by this Kernel.
Base class for deriving any boundary condition of a integrated type.
void addMooseVariableDependency(MooseVariableFEBase *var)
Call this function to add the passed in MooseVariableFEBase as a variable that this object depends on...
bool _has_diag_save_in
The aux variables to save the diagonal Jacobian contributions to.
virtual void addVariableToZeroOnJacobian(std::string var_name)
Adds this variable to the list of variables to be zeroed during each Jacobian evaluation.
const ArrayVariablePhiValue & _phi
shape function values (in QPs)
virtual void computeJacobianBlock(MooseVariableFEBase &jvar) override
Computes d-ivar-residual / d-jvar...
virtual RealEigenVector computeQpResidual()=0
Method for computing the residual at quadrature points.
const MooseArray< Real > & _coord
coordinate transformation
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
Prepare data for computing element jacobian according to the ative tags.
static InputParameters validParams()
virtual MooseVariableScalar & getScalarVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a scalar variable with specified number.
virtual ArrayMooseVariable & getArrayVariable(THREAD_ID tid, const std::string &var_name)=0
Returns the variable reference for requested ArrayMooseVariable which may be in any system.
virtual void computeJacobian() override
std::vector< MooseVariableFEBase * > _save_in
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 ...
defineLegacyParams(ArrayIntegratedBC)
const QBase *const & _qrule
active quadrature rule
virtual void initQpOffDiagJacobian(MooseVariableFEBase &)
Put necessary evaluations depending on qp but independent on test and shape functions here for off-di...
virtual RealEigenMatrix computeQpOffDiagJacobianScalar(MooseVariableScalar &jvar)
This is the virtual that derived classes should override for computing a full Jacobian component.
Base class for deriving any boundary condition of a integrated type.
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)
Helper function for assembling full Jacobian contriubutions on local quadrature points for an array v...
const unsigned int _count
Number of components of the array variable.
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
std::vector< AuxVariableName > _diag_save_in_strings
virtual void addVariableToZeroOnResidual(std::string var_name)
Adds this variable to the list of variables to be zeroed during each residual evaluation.
ArrayIntegratedBC(const InputParameters ¶meters)
virtual void initQpResidual()
Put necessary evaluations depending on qp but independent on test functions here.
static InputParameters validParams()
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual the according to active tags.
virtual RealEigenMatrix computeQpOffDiagJacobian(MooseVariableFEBase &jvar)
Method for computing an off-diagonal jacobian component at quadrature points.
std::string incompatVarMsg(MooseVariableFEBase &var1, MooseVariableFEBase &var2)
Builds and returns a string of the form:
Assembly & _assembly
Reference to assembly.
SystemBase & _sys
Reference to SystemBase.
DenseVector< Real > getJacobianDiagonal(DenseMatrix< Number > &ke)
virtual RealEigenVector computeQpJacobian()
Method for computing the diagonal Jacobian at quadrature points.
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealEigenMatrix
virtual void initQpJacobian()
Put necessary evaluations depending on qp but independent on test and shape functions here.
ArrayMooseVariable & _var
void saveDiagLocalArrayJacobian(DenseMatrix< Number > &ke, unsigned int i, unsigned int ntest, unsigned int j, unsigned int nphi, unsigned int ivar, const RealEigenVector &v)
Helper function for assembling diagonal Jacobian contriubutions on local quadrature points for an arr...
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
unsigned int _qp
quadrature point index
const MooseArray< Real > & _JxW
transformed Jacobian weights
VarKindType
Framework-wide stuff.
SystemBase & sys()
Get the system this variable is part of.
std::vector< AuxVariableName > _save_in_strings
DenseMatrix< Number > _local_ke
Holds residual entries as they are accumulated by this Kernel.
virtual void computeResidual() override
std::vector< MooseVariableFEBase * > _diag_save_in
unsigned int size() const
The number of elements that can currently be stored in the array.
bool _has_save_in
The aux variables to save the residual contributions to.
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Interface for objects that need to get values of MooseVariables.
const ArrayVariableTestValue & _test
test function values (in QPs)
SubProblem & _subproblem
Reference to SubProblem.
unsigned int number() const
Get variable number coming from libMesh.