21 "Base class for imposing constraints using scalar Lagrange multipliers");
22 params.
addParam<PostprocessorName>(
"phi0",
"0",
"The value that the constraint will enforce.");
30 _phi0(getPostprocessorValue(
"phi0")),
31 _lambda_var(*getScalarVar(
"lambda", 0)),
32 _lambda(adCoupledScalarValue(
"lambda"))
41 std::array<ADReal, 1>{{
_lambda[0] * volume}},
55 mooseAssert(
_local_re.
size() == 1,
"We should only have a single dof");
57 "The lambda variable should be first order");
66 std::array<Real, 1>{{lm_r}},
81 "The lambda variable should be first order");
83 mooseAssert(
_var.
dofIndices().size() == 1,
"We should only have one dof");
91 std::array<ADReal, 1>{{lm_r}},
const Real & elemVolume() const
Returns the reference to the current element volume.
MooseVariableFV< Real > & _var
Base class for FV elemental kernels that need qp-indexed solution values.
static InputParameters validParams()
ADReal computeQpResidual() override=0
This is the primary function that must be implemented for flux kernel terms.
void computeResidual() override final
Usually you should not override these functions - they have some tricky stuff in them that you don't ...
void computeJacobian() override final
Compute this object's contribution to the diagonal Jacobian entries.
FVScalarLagrangeMultiplierConstraint(const InputParameters ¶meters)
void computeOffDiagJacobian() override final
void computeResidualAndJacobian() override final
Compute this object's contribution to the residual and Jacobian simultaneously.
static InputParameters validParams()
const MooseVariableScalar & _lambda_var
The Lagrange Multiplier variable.
const ADVariableValue & _lambda
The Lagrange Multiplier value.
unsigned int size() const
The number of elements that can currently be stored in the array.
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.
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.
virtual const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
Assembly & _assembly
Reference to this Kernel's assembly object.
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided residual derivatives into the Jacobian for the provided dof indices.
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
void addResidualsAndJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals and derivatives for the Jacobian, corresponding to the provided d...
void addResiduals(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals corresponding to the provided dof indices.
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.
virtual unsigned int size() const override final