19 MooseEnum type_options(
"upper=0 lower=1",
"upper");
23 "Type of bound. 'upper' refers to the upper bound. 'lower' refers to the lower value.");
24 params.
addRequiredParam<NonlinearVariableName>(
"bounded_variable",
"The variable to be bounded");
32 _bounded_vector(_type == 0 ? _nl_sys.getVector(
"upper_bound")
33 : _nl_sys.getVector(
"lower_bound")),
34 _bounded_var(_nl_sys.getVariable(_tid, getParam<NonlinearVariableName>(
"bounded_variable"))),
35 _bounded_var_name(parameters.get<NonlinearVariableName>(
"bounded_variable")),
36 _fe_var(_bounded_var.isFV() ? nullptr
37 : &_subproblem.getStandardVariable(_tid, _bounded_var_name))
41 paramError(
"bounded_variable",
"Bounded variable must be nodal or of a CONSTANT order!");
49 "Dummy bounds aux variable and bounded variable must use the same finite element "
58 mooseWarning(
"A variational inequalities solver must be used in conjunction with Bounds"));
66 if (dof != std::numeric_limits<dof_id_type>::max())
83 "Bounds are only set on one DOF value per node currently");
91 "Bounds are only set on one DOF value per element currently");
98 return std::numeric_limits<dof_id_type>::max();
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
void ErrorVector unsigned int
AuxiliarySystem & _aux_sys
const THREAD_ID _tid
Thread ID.
bool isNodal() const
Nodal or elemental kernel?
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
const Node *const & _current_node
Current node (valid only for nodal kernels)
static InputParameters validParams()
static InputParameters validParams()
BoundsBase(const InputParameters ¶meters)
virtual Real getBound()=0
Method to get bound value for a variable.
virtual void initialSetup() override final
Gets called at the beginning of the simulation before this object is asked to do its job.
NumericVector< Number > & _bounded_vector
Reference to the bounded vector of nonlinear system.
virtual Real computeValue() override final
Compute and return the value of the aux variable.
MooseVariableFieldBase & _bounded_var
MOOSE variable (base class) we set the bound for.
dof_id_type getDoFIndex() const
Return the current DOF index to apply the bound on.
FEProblemBase & _c_fe_problem
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.
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 ...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
const libMesh::FEType & feType() const
Get the type of finite element object.
virtual bool isNodal() const
Is this variable nodal.
unsigned int number() const
Get variable number coming from libMesh.
unsigned int number() const
Gets the number of this system.
MooseVariableField< T > & getActualFieldVariable(THREAD_ID tid, const std::string &var_name)
Returns a field variable pointer - this includes finite volume variables.
virtual void set(const numeric_index_type i, const T value)=0
bool isSNESVI(FEProblemBase &fe_problem)
check if SNES type is variational inequalities (VI) solver