Line data Source code
1 : #include "ConditionalBoundsAux.h" 2 : 3 : registerMooseObject("raccoonApp", ConditionalBoundsAux); 4 : 5 : InputParameters 6 142 : ConditionalBoundsAux::validParams() 7 : { 8 142 : InputParameters params = BoundsBase::validParams(); 9 142 : params.addClassDescription( 10 : "This class conditionally enforces a lower bound. When the variable value is below a given " 11 : "threshold, a constant value is used as the bound; when the variable value is above a given " 12 : "threshold, irreversibility is enforced."); 13 284 : params.addRequiredParam<Real>("fixed_bound_value", "The value of fixed bound for the variable"); 14 284 : params.addRequiredParam<Real>("threshold_value", 15 : "The threshold for conditional history bound for the variable"); 16 284 : params.set<MooseEnum>("bound_type") = "lower"; 17 142 : params.suppressParameter<MooseEnum>("bound_type"); 18 142 : return params; 19 0 : } 20 : 21 2 : ConditionalBoundsAux::ConditionalBoundsAux(const InputParameters & parameters) 22 : : BoundsBase(parameters), 23 2 : _fixed_bound_value(getParam<Real>("fixed_bound_value")), 24 6 : _threshold_value(getParam<Real>("threshold_value")) 25 : { 26 2 : } 27 : 28 : Real 29 58065 : ConditionalBoundsAux::getBound() 30 : { 31 : Real d_old = 0; 32 58065 : if (_fe_var && isNodal()) 33 58065 : d_old = _fe_var->getNodalValueOld(*_current_node); 34 : else 35 0 : mooseError("This variable type is not supported yet"); 36 58065 : if (d_old >= _threshold_value) 37 : return d_old; 38 : else 39 56910 : return _fixed_bound_value; 40 : }