https://mooseframework.inl.gov
Loading...
Searching...
No Matches
StickyBC.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "StickyBC.h"
11#include "MooseVariable.h"
12
13registerMooseObject("SolidMechanicsApp", StickyBC);
14
17{
19 params.addParam<Real>(
20 "min_value",
21 std::numeric_limits<Real>::lowest(),
22 "If the old variable value <= min_value, the variable is fixed at its old value");
23 params.addParam<Real>(
24 "max_value",
25 std::numeric_limits<Real>::max(),
26 "If the old variable value >= max_value, the variable is fixed at its old value");
28 "Imposes the boundary condition $u = u_{old}$ if $u_{old}$ exceeds the bounds provided");
29 return params;
30}
31
33 : NodalBC(parameters),
34 _u_old(_var.dofValuesOld()),
35 _min_value(getParam<Real>("min_value")),
36 _max_value(getParam<Real>("max_value"))
37{
39 mooseError("StickyBC: min_value must not be greater than max_value");
40}
41
42bool
44{
45 const unsigned qp = 0; // this is a NodalBC: all qp = 0
46 return (_u_old[qp] <= _min_value || _u_old[qp] >= _max_value);
47}
48
49Real
51{
52 return _u[_qp] - _u_old[_qp];
53}
registerMooseObject("SolidMechanicsApp", StickyBC)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void mooseError(Args &&... args) const
const VariableValue & _u
static InputParameters validParams()
const unsigned int _qp
Sticky-type boundary condition, where if the old variable value exceeds the bounds provided u is fixe...
Definition StickyBC.h:20
const VariableValue & _u_old
Definition StickyBC.h:31
StickyBC(const InputParameters &parameters)
Definition StickyBC.C:32
const Real _max_value
The maximum bound.
Definition StickyBC.h:35
const Real _min_value
The minimum bound.
Definition StickyBC.h:33
static InputParameters validParams()
Definition StickyBC.C:16
virtual bool shouldApply() const override
Definition StickyBC.C:43
virtual Real computeQpResidual() override
Definition StickyBC.C:50