17 #include "libmesh/quadrature.h" 23 params.addRequiredCoupledVar(
"lm_variable",
"The lagrange multiplier variable");
24 params.addParam<
bool>(
27 "Whether to use a positive sign when adding this object's residual to the Lagrange " 28 "multiplier constraint equation. Positive or negative sign should be chosen such that the " 29 "diagonals for the LM block of the matrix are positive");
35 _lm_var(*getVar(
"lm_variable", 0)),
36 _lm(adCoupledValue(
"lm_variable")),
37 _lm_test(_lm_var.phi()),
38 _lm_sign(getParam<bool>(
"lm_sign_positive") ? 1. : -1)
45 std::vector<Real> strong_residuals(
_qrule->n_points());
50 strong_residuals[
_qp] =
75 std::vector<ADReal> strong_residuals(
_qrule->n_points());
78 "The test function sizes and the dof indices sizes should match.");
void computeResidual() override
MooseVariable & _lm_var
The Lagrange multiplier variable.
void accumulateTaggedLocalResidual()
static InputParameters validParams()
unsigned int number() const
const VariableTestValue & _lm_test
The values of the Lagrange multiplier test functions at quadrature points.
virtual void precalculateResidual()
const ADTemplateVariableTestValue< T > & _test
virtual OutputTools< typename Moose::ADType< T >::type >::OutputValue precomputeQpResidual()=0
std::vector< ADReal > _residuals
const std::vector< dof_id_type > & dofIndices() const final
const QBase *const & _qrule
const Real _lm_sign
The sign (either +1 or -1) applied to this object's residual when adding to the Lagrange multiplier c...
const MooseArray< ADReal > & _ad_JxW
LMKernel(const InputParameters ¶meters)
std::vector< dof_id_type > _all_dof_indices
The union of the primary var dof indices as well as the LM dof indices.
DenseVector< Number > _local_re
MooseVariableFE< T > & _var
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
static InputParameters validParams()
void computeResidualsForJacobian() override
const MooseArray< ADReal > & _ad_coord