20 #include "libmesh/dof_map.h" 21 #include "libmesh/dense_vector.h" 22 #include "libmesh/numeric_vector.h" 23 #include "libmesh/dense_subvector.h" 24 #include "libmesh/libmesh_common.h" 25 #include "libmesh/quadrature.h" 37 _lowerd_var(*getArrayVar(
"lowerd_variable", 0)),
38 _lambda(_is_implicit ? _lowerd_var.slnLower() : _lowerd_var.slnLowerOld()),
40 _phi_lambda(_lowerd_var.phiLower()),
41 _test_lambda(_lowerd_var.phiLower()),
46 if (lower_domains.count(
id) == 0)
50 "'lowerd_variable' must be defined on the interior lower-dimensional subdomain '" +
52 "' that is added by Mesh/build_all_side_lowerd_mesh=true.\nThe check could be overly " 58 "Must not be defined on the interior lower-dimensional subdomain '" +
63 "The number of components must be equal to the number of " 64 "components of 'variable'");
97 "Size of local residual is not equal to the number of array variable compoments");
135 "Jacobian types without lower should be handled in computeElemNeighJacobian");
163 for (
_i = 0;
_i < test_space.size();
_i++)
164 for (
_j = 0;
_j < loc_phi.size();
_j++)
169 _local_ke,
_i, test_space.size(),
_j, loc_phi.size(), ivar, v);
217 "Jacobian types without lower should be handled in computeOffDiagElemNeighJacobian");
243 for (
_i = 0;
_i < test_space.size();
_i++)
244 for (
_j = 0;
_j < loc_phi.size();
_j++)
263 for (
_i = 0;
_i < test_space.size();
_i++)
264 for (
_j = 0;
_j < loc_phi.size();
_j++)
273 mooseError(
"Vector variable cannot be coupled into array DG kernel currently");
MooseMesh & _mesh
Reference to this Kernel's mesh object.
const QBase *const & _qrule
Quadrature rule.
virtual void computeLowerDJacobian(Moose::ConstraintJacobianType jacobian_type)
Computes one of the five pieces of Jacobian involving lower-d.
const std::set< SubdomainID > & interiorLowerDBlocks() const
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
virtual void computeLowerDResidual()
Computes the Lower part of residual for the variable on the lower-d element.
virtual void computeOffDiagElemNeighJacobian(Moose::DGJacobianType type, const MooseVariableFEBase &jvar) override
Computes the element-element off-diagonal Jacobian.
virtual void precalculateOffDiagJacobian(unsigned int)
unsigned int number() const
Get variable number coming from libMesh.
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...
unsigned int count() const
Get the number of components Note: For standard and vector variables, the number is one...
virtual void precalculateResidual()
RealEigenVector _work_vector
Work vector for residual computation.
This class provides an interface for common operations on field variables of both FE and FV types wit...
static InputParameters validParams()
Factory constructor initializes all internal references needed for residual computation.
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...
virtual void computeJacobian() override
Computes the nine pieces of element/neighbor/lower-d - element/neighbor/lower-d Jacobian.
const ArrayVariableTestValue & _test_lambda
test functions
DenseMatrix< Number > _local_ke
Holds local Jacobian entries as they are accumulated by this Kernel.
const MooseVariableFieldBase & getVariable(unsigned int jvar_num) const
Retrieve the variable object from our system associated with jvar_num.
const std::string & getSubdomainName(SubdomainID subdomain_id) const
Return the name of a block given an id.
ArrayDGLowerDKernel(const InputParameters ¶meters)
virtual void computeElemNeighJacobian(Moose::DGJacobianType type) override
Computes the element/neighbor-element/neighbor Jacobian.
static InputParameters validParams()
Factory constructor initializes all internal references needed for residual computation.
virtual void computeElemNeighResidual(Moose::DGResidualType type) override
Computes the residual for this element or the neighbor.
const ArrayVariableTestValue & _test
test functions
virtual void initLowerDQpResidual()
Put necessary evaluations depending on qp but independent on test functions here. ...
void mooseDocumentedError(const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
Emits a documented error with object name and type.
const unsigned int _count
Number of components of the array variable.
virtual void precalculateJacobian()
OutputTools< Real >::VariableTestValue VariableTestValue
bool excludeBoundary() const
Check current element if it contains broken boundary.
const std::string & type() const
Get the type of this class.
const MooseArray< Real > & _coord
Coordinate transform mainly for curvilinear coordinates.
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 ...
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealEigenMatrix
virtual void computeLowerDQpResidual(RealEigenVector &residual)=0
Method for computing the Lower part of residual at quadrature points, to be filled in residual...
void accumulateTaggedLocalMatrix()
Local Jacobian blocks will be appended by adding the current local kernel Jacobian.
The DGKernel class is responsible for calculating the residuals for various physics on internal sides...
Assembly & _assembly
Reference to this Kernel's assembly object.
const std::set< SubdomainID > & activeSubdomains() const
The subdomains the variable is active on.
virtual void initLowerDQpOffDiagJacobian(Moose::ConstraintJacobianType, const MooseVariableFEBase &)
Put necessary evaluations depending on qp but independent on test and shape functions here for off-di...
virtual void computeResidual() override
Computes the residual for this element, the neighbor and the lower-d element.
virtual void computeOffDiagLowerDJacobian(Moose::ConstraintJacobianType type, const MooseVariableFEBase &jvar)
Computes one of the five pieces of off-diagonal Jacobian involving lower-d.
virtual RealEigenVector computeLowerDQpJacobian(Moose::ConstraintJacobianType jacobian_type)=0
Computes one of the five pieces of Jacobian involving lower-d at quadrature points.
const ArrayMooseVariable & _lowerd_var
Variable this kernel operates on.
virtual void initLowerDQpJacobian(Moose::ConstraintJacobianType)
Put necessary evaluations depending on qp but independent on test and shape functions here...
virtual const FieldVariablePhiValue & phiLower() const override
Return the variable's shape functions on a lower-dimensional element.
void prepareMatrixTagLower(Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::ConstraintJacobianType type)
Prepare data for computing the jacobian according to the active tags for mortar.
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.
virtual Moose::VarFieldType fieldType() const =0
Filed type of this variable.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const ArrayVariablePhiValue & _phi_neighbor
Side shape function.
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
void prepareVectorTagLower(Assembly &assembly, unsigned int ivar)
Prepare data for computing the residual according to active tags for mortar constraints.
const ArrayVariablePhiValue & _phi_lambda
Shape functions.
OutputTools< RealEigenVector >::VariableTestValue ArrayVariableTestValue
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...
const ArrayVariableTestValue & _test_neighbor
Side test function.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes d-residual / d-jvar...
virtual RealEigenMatrix computeLowerDQpOffDiagJacobian(Moose::ConstraintJacobianType type, const MooseVariableFEBase &jvar)
Computes one of the five pieces of off-diagonal Jacobian involving lower-d at quadrature points...
ArrayMooseVariable & _var
Variable this kernel operates on.
const ArrayVariablePhiValue & _phi
Shape functions.