www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
StickyBC Class Reference

Sticky-type boundary condition, where if the old variable value exceeds the bounds provided u is fixed (ala Dirichlet) to the old value. More...

#include <StickyBC.h>

Inheritance diagram for StickyBC:
[legend]

Public Member Functions

 StickyBC (const InputParameters &parameters)
 

Protected Member Functions

virtual bool shouldApply () override
 
virtual Real computeQpResidual () override
 

Protected Attributes

const VariableValue & _u_old
 
const Real _min_value
 The minimum bound. More...
 
const Real _max_value
 The maximum bound. More...
 

Detailed Description

Sticky-type boundary condition, where if the old variable value exceeds the bounds provided u is fixed (ala Dirichlet) to the old value.

Definition at line 25 of file StickyBC.h.

Constructor & Destructor Documentation

◆ StickyBC()

StickyBC::StickyBC ( const InputParameters &  parameters)

Definition at line 33 of file StickyBC.C.

34  : NodalBC(parameters),
35  _u_old(_var.dofValuesOld()),
36  _min_value(getParam<Real>("min_value")),
37  _max_value(getParam<Real>("max_value"))
38 {
39  if (_min_value > _max_value)
40  mooseError("StickyBC: min_value must not be greater than max_value");
41 }
const VariableValue & _u_old
Definition: StickyBC.h:35
const Real _min_value
The minimum bound.
Definition: StickyBC.h:37
const Real _max_value
The maximum bound.
Definition: StickyBC.h:39

Member Function Documentation

◆ computeQpResidual()

Real StickyBC::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 51 of file StickyBC.C.

52 {
53  return _u[_qp] - _u_old[_qp];
54 }
const VariableValue & _u_old
Definition: StickyBC.h:35

◆ shouldApply()

bool StickyBC::shouldApply ( )
overrideprotectedvirtual

Definition at line 44 of file StickyBC.C.

45 {
46  const unsigned qp = 0; // this is a NodalBC: all qp = 0
47  return (_u_old[qp] <= _min_value || _u_old[qp] >= _max_value);
48 }
const VariableValue & _u_old
Definition: StickyBC.h:35
const Real _min_value
The minimum bound.
Definition: StickyBC.h:37
const Real _max_value
The maximum bound.
Definition: StickyBC.h:39

Member Data Documentation

◆ _max_value

const Real StickyBC::_max_value
protected

The maximum bound.

Definition at line 39 of file StickyBC.h.

Referenced by shouldApply(), and StickyBC().

◆ _min_value

const Real StickyBC::_min_value
protected

The minimum bound.

Definition at line 37 of file StickyBC.h.

Referenced by shouldApply(), and StickyBC().

◆ _u_old

const VariableValue& StickyBC::_u_old
protected

Definition at line 35 of file StickyBC.h.

Referenced by computeQpResidual(), and shouldApply().


The documentation for this class was generated from the following files: