18 params.
addClassDescription(
"Used to prevent a coupled variable from going above a upper bound");
20 "v",
"The coupled variable we require to be greater than the upper bound");
21 params.
addParam<
Real>(
"upper_bound", 0,
"The upper 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 _upper_bound(getParam<
Real>(
"upper_bound"))
38 mooseError(
"Coupled variable 'v' needs to be different from 'variable' with " 39 "UpperBoundNodalKernel");
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.
Class used to enforce a upper bound on a coupled variable.
virtual Real computeQpResidual() override
The user can override this function to compute the residual at a node.
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
This is the virtual that derived classes should override for computing an off-diagonal jacobian compo...
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.
virtual Real computeQpJacobian() override
The user can override this function to compute the "on-diagonal" Jacobian contribution.
MooseVariable & _var
variable this works on
std::set< BoundaryID > _bnd_ids
Boundaries on which we should not execute this object.
const unsigned int _v_var
The number of the coupled variable.
UpperBoundNodalKernel(const InputParameters ¶meters)
static InputParameters validParams()
const VariableValue & _u
Value of the unknown variable this is acting on.
registerMooseObject("MooseApp", UpperBoundNodalKernel)
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...
const VariableValue & _v
The value of the coupled variable.
const Node *const & _current_node
current node being processed
static InputParameters validParams()
Class constructor.
const Real _upper_bound
The upper bound on the coupled variable.
Base class for creating nodal kernels with hand-coded Jacobians.
auto min(const L &left, const R &right)
unsigned int _qp
Quadrature point index.
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.