18 params.
addClassDescription(
"Used to prevent a coupled variable from going below a lower bound");
20 "v",
"The coupled variable we require to be greater than the lower bound");
21 params.
addParam<Real>(
"lower_bound", 0,
"The lower bound on the coupled variable");
22 params.
addParam<std::vector<BoundaryName>>(
25 "Boundaries on which not to execute the NodalKernel. This can be useful for avoiding "
26 "singuarility in the matrix in case a constraint is active in the same place that a "
27 "DirichletBC is set");
34 _v(coupledValue(
"v")),
35 _lower_bound(getParam<Real>(
"lower_bound"))
38 mooseError(
"Coupled variable 'v' needs to be different from 'variable' with "
39 "LowerBoundNodalKernel");
41 const auto & bnd_names = getParam<std::vector<BoundaryName>>(
"exclude_boundaries");
42 for (
const auto & bnd_name : bnd_names)
registerMooseObject("MooseApp", LowerBoundNodalKernel)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Class used to enforce a lower bound on a coupled variable.
std::set< BoundaryID > _bnd_ids
Boundaries on which we should not execute this object.
const VariableValue & _v
The value of the coupled variable.
const Real _lower_bound
The lower bound on the coupled variable.
virtual Real computeQpJacobian() override
The user can override this function to compute the "on-diagonal" Jacobian contribution.
static InputParameters validParams()
virtual Real computeQpResidual() override
The user can override this function to compute the residual at a node.
const unsigned int _v_var
The number of the coupled variable.
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
This is the virtual that derived classes should override for computing an off-diagonal jacobian compo...
LowerBoundNodalKernel(const InputParameters ¶meters)
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
bool isBoundaryNode(dof_id_type node_id) const
Returns true if the requested node is in the list of boundary nodes, false otherwise.
unsigned int number() const
Get variable number coming from libMesh.
unsigned int _qp
Quadrature point index.
const Node *const & _current_node
current node being processed
Base class for creating nodal kernels with hand-coded Jacobians.
static InputParameters validParams()
Class constructor.
MooseVariable & _var
variable this works on
const VariableValue & _u
Value of the unknown variable this is acting on.
MooseMesh & _mesh
Reference to this Kernel's mesh object.