19 #include "libmesh/dof_map.h" 20 #include "libmesh/dense_vector.h" 21 #include "libmesh/numeric_vector.h" 22 #include "libmesh/dense_subvector.h" 23 #include "libmesh/libmesh_common.h" 24 #include "libmesh/quadrature.h" 37 _var(*mooseVariable()),
38 _u(_is_implicit ? _var.sln() : _var.slnOld()),
39 _grad_u(_is_implicit ? _var.gradSln() : _var.gradSlnOld()),
41 _phi(_assembly.phiFace(_var)),
42 _grad_phi(_assembly.gradPhiFace(_var)),
44 _test(_var.phiFace()),
45 _grad_test(_var.gradPhiFace()),
47 _phi_neighbor(_assembly.phiFaceNeighbor(_var)),
48 _grad_phi_neighbor(_assembly.gradPhiFaceNeighbor(_var)),
50 _test_neighbor(_var.phiFaceNeighbor()),
51 _grad_test_neighbor(_var.gradPhiFaceNeighbor()),
53 _u_neighbor(_is_implicit ? _var.slnNeighbor() : _var.slnOldNeighbor()),
54 _grad_u_neighbor(_is_implicit ? _var.gradSlnNeighbor() : _var.gradSlnOldNeighbor())
70 " as a save_in variable in " +
name());
75 "saved-in auxiliary variable is incompatible with the object's nonlinear variable: ",
94 " as a diag_save_in variable in " +
name());
99 "saved-in auxiliary variable is incompatible with the object's nonlinear variable: ",
129 for (
_i = 0;
_i < test_space.size();
_i++)
140 const std::vector<dof_id_type> & dof_indices =
141 is_elem ? var->dofIndices() : var->dofIndicesNeighbor();
142 var->sys().solution().add_vector(
_local_re, dof_indices);
163 for (
_i = 0;
_i < test_space.size();
_i++)
164 for (
_j = 0;
_j < loc_phi.size();
_j++)
174 for (
unsigned int i = 0; i < rows; i++)
181 var->sys().solution().add_vector(diag, var->dofIndices());
183 var->sys().solution().add_vector(diag, var->dofIndicesNeighbor());
208 for (
_i = 0;
_i < test_space.size();
_i++)
209 for (
_j = 0;
_j < loc_phi.size();
_j++)
const QBase *const & _qrule
Quadrature rule.
static InputParameters validParams()
Factory constructor initializes all internal references needed for residual computation.
const libMesh::FEType & feType() const
Get the type of finite element object.
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
std::string incompatVarMsg(MooseVariableFieldBase &var1, MooseVariableFieldBase &var2)
Builds and returns a string of the form:
unsigned int number() const
Get variable number coming from libMesh.
std::vector< AuxVariableName > _save_in_strings
virtual void computeElemNeighResidual(Moose::DGResidualType type) override
Computes the residual for this element or the neighbor.
const VariablePhiValue & _phi_neighbor
Side shape function.
virtual Real computeQpJacobian(Moose::DGJacobianType type)=0
This is the virtual that derived classes should override for computing the Jacobian on neighboring el...
bool _has_diag_save_in
The aux variables to save the diagonal Jacobian contributions to.
This class provides an interface for common operations on field variables of both FE and FV types wit...
std::vector< MooseVariableFEBase * > _diag_save_in
THREAD_ID _tid
The thread ID for this kernel.
DenseMatrix< Number > _local_ke
Holds local Jacobian entries as they are accumulated by this Kernel.
virtual const std::string & name() const
Get the name of the class.
Serves as a base class for DGKernel and ADDGKernel.
MooseVariable & _var
Variable this kernel operates on.
SystemBase & _sys
Reference to the EquationSystem object.
static InputParameters validParams()
Factory constructor initializes all internal references needed for residual computation.
const VariableTestValue & _test_neighbor
Side test function.
void prepareMatrixTagNeighbor(Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::DGJacobianType type)
Prepare data for computing element jacobian according to the active tags for DG and interface kernels...
std::vector< MooseVariableFEBase * > _save_in
MooseVariableFE< Real > * mooseVariable() const
Return the MooseVariableFE object that this interface acts on.
Enhances MooseVariableInterface interface provide values from neighbor elements.
virtual Real computeQpOffDiagJacobian(Moose::DGJacobianType type, unsigned int jvar)
This is the virtual that derived classes should override for computing the off-diag Jacobian...
OutputTools< Real >::VariableTestValue VariableTestValue
SubProblem & _subproblem
Reference to this kernel's SubProblem.
VarKindType
Framework-wide stuff.
std::vector< AuxVariableName > _diag_save_in_strings
virtual void precalculateQpOffDiagJacobian(Moose::DGJacobianType, const MooseVariableFEBase &)
Insertion point for evaluations that depend on qp but are independent of the test and shape functions...
DGKernel(const InputParameters ¶meters)
const std::string & type() const
Get the type of this class.
const MooseArray< Real > & _coord
Coordinate transform mainly for curvilinear coordinates.
virtual void precalculateQpJacobian(Moose::DGJacobianType)
Insertion point for evaluations that depend on qp but are independent of the test and shape functions...
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 ...
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const =0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
void accumulateTaggedLocalMatrix()
Local Jacobian blocks will be appended by adding the current local kernel Jacobian.
static Threads::spin_mutex _resid_vars_mutex
virtual bool hasVariable(const std::string &var_name) const
Query a system for a variable.
virtual void computeElemNeighJacobian(Moose::DGJacobianType type) override
Computes the element/neighbor-element/neighbor Jacobian.
Assembly & _assembly
Reference to this Kernel's assembly object.
const VariableTestValue & _test
test functions
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
void prepareVectorTagNeighbor(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual the according to active tags for DG and interface kernels...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void addVariableToZeroOnResidual(std::string var_name)
Adds this variable to the list of variables to be zeroed during each residual evaluation.
DenseVector< Number > _local_re
Holds local residual entries as they are accumulated by this Kernel.
const MooseArray< Real > & _JxW
Jacobian det times quadrature weighting on quadrature points.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
virtual void addVariableToZeroOnJacobian(std::string var_name)
Adds this variable to the list of variables to be zeroed during each Jacobian evaluation.
const VariablePhiValue & _phi
Shape functions.
virtual void precalculateQpResidual(Moose::DGResidualType)
Insertion point for evaluations that depend on qp but are independent of the test functions...
virtual Real computeQpResidual(Moose::DGResidualType type)=0
This is the virtual that derived classes should override for computing the residual on neighboring el...
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.
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
Prepare data for computing element jacobian according to the active tags.
SystemBase & sys()
Get the system this variable is part of.
virtual void computeOffDiagElemNeighJacobian(Moose::DGJacobianType type, const MooseVariableFEBase &jvar) override
Computes the element-element off-diagonal Jacobian.
static Threads::spin_mutex _jacoby_vars_mutex
bool _has_save_in
The aux variables to save the residual contributions to.