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)
MooseMesh & _mesh
Reference to this Kernel's mesh object.
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.
const unsigned int _v_var
The number of the coupled variable.
const VariableValue & _v
The value of the coupled variable.
virtual Real computeQpResidual() override
The user can override this function to compute the residual at a node.
MooseVariable & _var
variable this works on
virtual Real computeQpJacobian() override
The user can override this function to compute the "on-diagonal" Jacobian contribution.
const Real _lower_bound
The lower bound on the coupled variable.
static InputParameters validParams()
const VariableValue & _u
Value of the unknown variable this is acting on.
registerMooseObject("MooseApp", LowerBoundNodalKernel)
std::set< BoundaryID > _bnd_ids
Boundaries on which we should not execute this object.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Class used to enforce a lower bound on a coupled variable.
const Node *const & _current_node
current node being processed
static InputParameters validParams()
Class constructor.
Base class for creating nodal kernels with hand-coded Jacobians.
auto min(const L &left, const R &right)
LowerBoundNodalKernel(const InputParameters ¶meters)
unsigned int _qp
Quadrature point index.
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
This is the virtual that derived classes should override for computing an off-diagonal jacobian compo...