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"));
83 "Bounds are only set on one DOF value per node currently");
91 "Bounds are only set on one DOF value per element currently");
bool isSNESVI(FEProblemBase &fe_problem)
check if SNES type is variational inequalities (VI) solver
virtual bool isNodal() const
Is this variable nodal.
const libMesh::FEType & feType() const
Get the type of finite element object.
unsigned int number() const
Get variable number coming from libMesh.
const Node *const & _current_node
Current node (valid only for nodal kernels)
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
void mooseWarning(Args &&... args) const
Emits a warning prefixed with object name and type.
auto max(const L &left, const R &right)
dof_id_type getDoFIndex() const
Return the current DOF index to apply the bound on.
FEProblemBase & _c_fe_problem
NumericVector< Number > & _bounded_vector
Reference to the bounded vector of nonlinear system.
MooseVariableFieldBase & _bounded_var
MOOSE variable (base class) we set the bound for.
static InputParameters validParams()
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
virtual Real computeValue() override final
Compute and return the value of the aux variable.
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 ...
unsigned int number() const
Gets the number of this system.
AuxiliarySystem & _aux_sys
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
BoundsBase(const InputParameters ¶meters)
virtual Real getBound()=0
Method to get bound value for a variable.
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
virtual void set(const numeric_index_type i, const Number value)=0
virtual void initialSetup() override final
Gets called at the beginning of the simulation before this object is asked to do its job...
void ErrorVector unsigned int
bool isNodal() const
Nodal or elemental kernel?
MooseVariableField< T > & getActualFieldVariable(THREAD_ID tid, const std::string &var_name)
Returns a field variable pointer - this includes finite volume variables.