23 "Enforces a prescribed average value for a finite element variable on a boundary using a " 24 "scalar Lagrange multiplier.");
25 params.
addParam<PostprocessorName>(
"phi0",
"0",
"The value that the constraint will enforce.");
32 _phi0(getPostprocessorValue(
"phi0")),
33 _lambda_var(*getScalarVar(
"lambda", 0)),
34 _lambda(coupledScalarValue(
"lambda"))
37 paramError(
"lambda",
"The lambda variable must be a first-order scalar variable.");
99 std::array<Real, 1> residual{{0.0}};
const VariableTestValue & _test
test function values (in QPs)
const MooseVariableScalar & _lambda_var
Lagrange multiplier scalar variable.
virtual void computeResidual() override
Compute this object's contribution to the residual.
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 void computeOffDiagJacobian(unsigned int jvar) override
Computes d-ivar-residual / d-jvar...
virtual void computeOffDiagJacobianScalar(unsigned int jvar) override
Computes jacobian block with respect to a scalar variable.
unsigned int number() const
Get variable number coming from libMesh.
Enforces the average value of a finite element variable on a boundary using a scalar Lagrange multipl...
void computeScalarJacobian()
Compute the zero diagonal block for the Lagrange multiplier equation.
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 computeFieldScalarJacobian()
Compute the Jacobian contribution from the Lagrange multiplier to the field equation.
static InputParameters validParams()
unsigned int _i
i-th, j-th index for enumerating test and shape functions
void computeScalarFieldJacobian()
Compute the Jacobian contribution from the field variable to the Lagrange multiplier equation...
static InputParameters validParams()
const VariablePhiValue & _phi
shape function values (in QPs)
unsigned int _qp
quadrature point index
virtual void computeJacobian() override
Compute this object's contribution to the diagonal Jacobian entries.
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.
const std::string & name() const
Get the name of the class.
unsigned int size() const
The number of elements that can currently be stored in the array.
const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
virtual void computeResidualAndJacobian() override
Compute this object's contribution to the residual and Jacobian simultaneously.
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
registerMooseObject("MooseApp", BoundaryIntegralValueConstraint)
Base class for deriving any boundary condition of a integrated type.
void prepareShapes(unsigned int var_num) override final
Prepare shape functions.
const MooseArray< Real > & _coord
coordinate transformation
Assembly & _assembly
Reference to this Kernel's assembly object.
void computeScalarResidual()
Compute the Lagrange multiplier residual contribution.
libMesh::Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int...
const QBase *const & _qrule
active quadrature rule
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::set< std::string > additionalROVariables() override
virtual void computeResidual() override
Compute this object's contribution to the residual.
const VariableValue & _lambda
Lagrange multiplier scalar variable value.
const PostprocessorValue & _phi0
The value that the boundary average of the field variable is constrained to.
BoundaryIntegralValueConstraint(const InputParameters ¶meters)
bool _is_implicit
If the object is using implicit or explicit form.
const VariableValue & _u
the values of the unknown variable this BC is acting on
const MooseArray< Real > & _JxW
transformed Jacobian weights
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.
virtual Real computeQpResidual() override
Method for computing the residual at quadrature points.