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"))
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}},
ADReal computeQpResidual() override=0
This is the primary function that must be implemented for flux kernel terms.
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 accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
unsigned int number() const
Get variable number coming from libMesh.
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 computeJacobian() override final
Compute this object's contribution to the diagonal Jacobian entries.
const ADVariableValue & _lambda
The Lagrange Multiplier value.
void computeResidualAndJacobian() override final
Compute this object's contribution to the residual and Jacobian simultaneously.
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.
FVElemental is used for calculating residual contributions from volume integral terms of a PDE where ...
unsigned int size() const
The number of elements that can currently be stored in the array.
static InputParameters validParams()
static InputParameters validParams()
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
void computeResidual() override final
Usually you should not override these functions - they have some tricky stuff in them that you don't ...
Assembly & _assembly
Reference to this Kernel's assembly object.
libMesh::Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int...
const MooseVariableScalar & _lambda_var
The Lagrange Multiplier variable.
void computeOffDiagJacobian() override final
DenseVector< Number > _local_re
Holds local residual entries as they are accumulated by this Kernel.
virtual unsigned int size() const override final
const Real & elemVolume() const
Returns the reference to the current element volume.
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual according to active tags.
FVScalarLagrangeMultiplierConstraint(const InputParameters ¶meters)
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.
virtual const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
MooseVariableFV< Real > & _var