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

This holds maps between pressure_var or pressure_var, sat_var used in RichardsMaterial and kernels, etc, and the variable number used internally by MOOSE. More...

#include <RichardsVarNames.h>

Inheritance diagram for RichardsVarNames:
[legend]

Public Member Functions

 RichardsVarNames (const InputParameters &parameters)
 
void initialize ()
 
void execute ()
 
void finalize ()
 
unsigned int num_v () const
 the number of porepressure variables More...
 
unsigned int richards_var_num (unsigned int moose_var_num) const
 the richards variable number More...
 
bool not_richards_var (unsigned int moose_var_num) const
 returns true if moose_var_num is not a richards var More...
 
std::string richards_names () const
 a space-separated string of richards variable names eg richards_names() = 'pwater pgas' More...
 
const VariableValue * richards_vals (unsigned int richards_var_num) const
 a vector of pointers to VariableValues More...
 
const VariableValue * richards_vals_old (unsigned int richards_var_num) const
 a vector of pointers to old VariableValues More...
 
const VariableGradient * grad_var (unsigned int richards_var_num) const
 a vector of pointers to grad(Variable) More...
 
const VariableValue * nodal_var (unsigned int richards_var_num) const
 The nodal variable values for the given richards_var_num To extract a the value of pressure variable "pvar", at node i, use (*RichardsVarNames.nodal_var(pvar))[i]. More...
 
const VariableValue * nodal_var_old (unsigned int richards_var_num) const
 The old nodal variable values for the given richards_var_num. More...
 
std::string var_types () const
 return the _var_types string More...
 

Protected Attributes

unsigned int _num_v
 number of richards variables More...
 
MooseEnum _var_types
 physical meaning of the variables. Eg 'pppp' means 'all variables are pressure variables' More...
 
std::vector< unsigned int > _moose_var_num
 _moose_var_num[i] = the moose variable number corresponding to richards variable i More...
 
std::vector< unsigned int > _ps_var_num
 _pressure_var_num[i] = the richards variable corresponding to moose variable i More...
 
std::vector< const VariableValue * > _moose_var_value
 moose_var_value[i] = values of richards variable i More...
 
std::vector< const VariableValue * > _moose_var_value_old
 moose_var_value_old[i] = old values of richards variable i More...
 
std::vector< const VariableValue * > _moose_nodal_var_value
 moose_var_value[i] = values of richards variable i More...
 
std::vector< const VariableValue * > _moose_nodal_var_value_old
 moose_var_value_old[i] = old values of richards variable i More...
 
std::vector< const VariableGradient * > _moose_grad_var
 moose_grad_var[i] = gradient values of richards variable i More...
 

Detailed Description

This holds maps between pressure_var or pressure_var, sat_var used in RichardsMaterial and kernels, etc, and the variable number used internally by MOOSE.

Definition at line 25 of file RichardsVarNames.h.

Constructor & Destructor Documentation

RichardsVarNames::RichardsVarNames ( const InputParameters &  parameters)

Definition at line 34 of file RichardsVarNames.C.

35  : GeneralUserObject(parameters),
36  Coupleable(this, false),
37  ZeroInterface(parameters),
38  _num_v(coupledComponents("richards_vars")),
39  _var_types(getParam<MooseEnum>("var_types"))
40 {
41  unsigned int max_moose_var_num_seen = 0;
42 
43  _moose_var_num.resize(_num_v);
44  _moose_var_value.resize(_num_v);
48  _moose_grad_var.resize(_num_v);
49  for (unsigned int i = 0; i < _num_v; ++i)
50  {
51  _moose_var_num[i] = coupled("richards_vars", i);
52  max_moose_var_num_seen =
53  (max_moose_var_num_seen > _moose_var_num[i] ? max_moose_var_num_seen : _moose_var_num[i]);
54  _moose_var_value[i] = &coupledValue("richards_vars", i); // coupledValue returns a reference (an
55  // alias) to a VariableValue, and the &
56  // turns it into a pointer
57  _moose_var_value_old[i] = (_is_transient ? &coupledValueOld("richards_vars", i) : &_zero);
58  _moose_nodal_var_value[i] = &coupledNodalValue("richards_vars", i); // coupledNodalValue returns
59  // a reference (an alias) to
60  // a VariableValue, and the
61  // & turns it into a pointer
63  (_is_transient ? &coupledNodalValueOld("richards_vars", i) : &_zero);
64  _moose_grad_var[i] = &coupledGradient("richards_vars", i);
65  }
66 
67  _ps_var_num.resize(max_moose_var_num_seen + 1);
68  for (unsigned int i = 0; i < max_moose_var_num_seen + 1; ++i)
69  _ps_var_num[i] = _num_v; // NOTE: indicates that i is not a richards variable
70  for (unsigned int i = 0; i < _num_v; ++i)
72 }
std::vector< const VariableValue * > _moose_nodal_var_value
moose_var_value[i] = values of richards variable i
std::vector< const VariableValue * > _moose_nodal_var_value_old
moose_var_value_old[i] = old values of richards variable i
std::vector< unsigned int > _moose_var_num
_moose_var_num[i] = the moose variable number corresponding to richards variable i ...
std::vector< const VariableValue * > _moose_var_value
moose_var_value[i] = values of richards variable i
std::vector< unsigned int > _ps_var_num
_pressure_var_num[i] = the richards variable corresponding to moose variable i
std::vector< const VariableGradient * > _moose_grad_var
moose_grad_var[i] = gradient values of richards variable i
MooseEnum _var_types
physical meaning of the variables. Eg &#39;pppp&#39; means &#39;all variables are pressure variables&#39; ...
unsigned int _num_v
number of richards variables
std::vector< const VariableValue * > _moose_var_value_old
moose_var_value_old[i] = old values of richards variable i

Member Function Documentation

void RichardsVarNames::execute ( )

Definition at line 80 of file RichardsVarNames.C.

81 {
82 }
void RichardsVarNames::finalize ( )

Definition at line 85 of file RichardsVarNames.C.

86 {
87 }
const VariableGradient * RichardsVarNames::grad_var ( unsigned int  richards_var_num) const

a vector of pointers to grad(Variable)

Parameters
richards_var_numthe richards variable number eg if richards_vars = 'pwater pgas', then (*grad_var(1))[qp] = grad(pgas) evaluated at quadpoint qp Also grad_var(i) = &coupledGradient

Definition at line 127 of file RichardsVarNames.C.

Referenced by RichardsMaterial::computePandSeff().

128 {
130 }
std::vector< const VariableGradient * > _moose_grad_var
moose_grad_var[i] = gradient values of richards variable i
unsigned int richards_var_num(unsigned int moose_var_num) const
the richards variable number
void RichardsVarNames::initialize ( )

Definition at line 75 of file RichardsVarNames.C.

76 {
77 }
const VariableValue * RichardsVarNames::nodal_var ( unsigned int  richards_var_num) const

The nodal variable values for the given richards_var_num To extract a the value of pressure variable "pvar", at node i, use (*RichardsVarNames.nodal_var(pvar))[i].

Parameters
richards_var_numthe richards variable number

Definition at line 139 of file RichardsVarNames.C.

Referenced by RichardsBorehole::RichardsBorehole(), RichardsFullyUpwindFlux::RichardsFullyUpwindFlux(), RichardsLumpedMassChange::RichardsLumpedMassChange(), and RichardsPiecewiseLinearSink::RichardsPiecewiseLinearSink().

140 {
142 }
std::vector< const VariableValue * > _moose_nodal_var_value
moose_var_value[i] = values of richards variable i
unsigned int richards_var_num(unsigned int moose_var_num) const
the richards variable number
const VariableValue * RichardsVarNames::nodal_var_old ( unsigned int  richards_var_num) const

The old nodal variable values for the given richards_var_num.

Parameters
richards_var_numthe richards variable number

Definition at line 145 of file RichardsVarNames.C.

Referenced by RichardsLumpedMassChange::RichardsLumpedMassChange().

146 {
148 }
std::vector< const VariableValue * > _moose_nodal_var_value_old
moose_var_value_old[i] = old values of richards variable i
unsigned int richards_var_num(unsigned int moose_var_num) const
the richards variable number
bool RichardsVarNames::not_richards_var ( unsigned int  moose_var_num) const

returns true if moose_var_num is not a richards var

Parameters
moose_var_numthe MOOSE variable number eg if richards_vars = 'pwater pgas', and the variables in the simulation are 'temperature pwater pgas displacement' then not_pressure_var(0) = true, no_pressure_var(1) = false

Definition at line 106 of file RichardsVarNames.C.

Referenced by RichardsFlux::computeQpOffDiagJacobian(), RichardsMassChange::computeQpOffDiagJacobian(), RichardsHalfGaussianSink::computeQpOffDiagJacobian(), RichardsLumpedMassChange::computeQpOffDiagJacobian(), RichardsPolyLineSink::computeQpOffDiagJacobian(), RichardsPiecewiseLinearSink::computeQpOffDiagJacobian(), RichardsBorehole::computeQpOffDiagJacobian(), and RichardsFullyUpwindFlux::upwind().

107 {
108  if (moose_var_num >= _ps_var_num.size() || _ps_var_num[moose_var_num] == _num_v)
109  return true;
110  return false;
111 }
std::vector< unsigned int > _ps_var_num
_pressure_var_num[i] = the richards variable corresponding to moose variable i
unsigned int _num_v
number of richards variables
unsigned int RichardsVarNames::num_v ( ) const

the number of porepressure variables

Definition at line 90 of file RichardsVarNames.C.

91 {
92  return _num_v;
93 }
unsigned int _num_v
number of richards variables
std::string RichardsVarNames::richards_names ( ) const

a space-separated string of richards variable names eg richards_names() = 'pwater pgas'

const VariableValue * RichardsVarNames::richards_vals ( unsigned int  richards_var_num) const

a vector of pointers to VariableValues

Parameters
richards_var_numthe pressure variable number eg if richards_vars = 'pwater pgas', then (*richards_vals(1))[qp] = pgas evaluated at quadpoint qp Also richards_vals(i) = &coupledValue

Definition at line 114 of file RichardsVarNames.C.

Referenced by RichardsMaterial::computePandSeff().

115 {
116  return _moose_var_value[richards_var_num]; // moose_var_value is a vector of pointers to
117  // VariableValuees
118 }
std::vector< const VariableValue * > _moose_var_value
moose_var_value[i] = values of richards variable i
unsigned int richards_var_num(unsigned int moose_var_num) const
the richards variable number
const VariableValue * RichardsVarNames::richards_vals_old ( unsigned int  richards_var_num) const

a vector of pointers to old VariableValues

Parameters
richards_var_numthe richards variable number eg if richards_vars = 'pwater pgas', then (*richards_vals_old(1))[qp] = old pgas evaluated at quadpoint qp Also richards_vals_old(i) = &coupledValueOld

Definition at line 121 of file RichardsVarNames.C.

Referenced by RichardsMaterial::computePandSeff().

122 {
124 }
unsigned int richards_var_num(unsigned int moose_var_num) const
the richards variable number
std::vector< const VariableValue * > _moose_var_value_old
moose_var_value_old[i] = old values of richards variable i
unsigned int RichardsVarNames::richards_var_num ( unsigned int  moose_var_num) const

the richards variable number

Parameters
moose_var_numthe MOOSE variable number eg if richards_vars = 'pwater pgas', and the variables in the simulation are 'temperature pwater pgas displacement' then richards_var_num(2) = 1

Definition at line 96 of file RichardsVarNames.C.

Referenced by RichardsFlux::computeQpOffDiagJacobian(), RichardsMassChange::computeQpOffDiagJacobian(), RichardsHalfGaussianSink::computeQpOffDiagJacobian(), RichardsLumpedMassChange::computeQpOffDiagJacobian(), RichardsPolyLineSink::computeQpOffDiagJacobian(), RichardsPiecewiseLinearSink::computeQpOffDiagJacobian(), RichardsBorehole::computeQpOffDiagJacobian(), grad_var(), nodal_var(), nodal_var_old(), richards_vals(), richards_vals_old(), and RichardsFullyUpwindFlux::upwind().

97 {
98  if (moose_var_num >= _ps_var_num.size() || _ps_var_num[moose_var_num] == _num_v)
99  mooseError("The moose variable with number ",
100  moose_var_num,
101  " is not a richards according to the RichardsVarNames UserObject");
102  return _ps_var_num[moose_var_num];
103 }
std::vector< unsigned int > _ps_var_num
_pressure_var_num[i] = the richards variable corresponding to moose variable i
unsigned int _num_v
number of richards variables
std::string RichardsVarNames::var_types ( ) const

return the _var_types string

Definition at line 133 of file RichardsVarNames.C.

Referenced by RichardsMaterial::computePandSeff().

134 {
135  return _var_types;
136 }
MooseEnum _var_types
physical meaning of the variables. Eg &#39;pppp&#39; means &#39;all variables are pressure variables&#39; ...

Member Data Documentation

std::vector<const VariableGradient *> RichardsVarNames::_moose_grad_var
protected

moose_grad_var[i] = gradient values of richards variable i

Definition at line 133 of file RichardsVarNames.h.

Referenced by grad_var(), and RichardsVarNames().

std::vector<const VariableValue *> RichardsVarNames::_moose_nodal_var_value
protected

moose_var_value[i] = values of richards variable i

Definition at line 127 of file RichardsVarNames.h.

Referenced by nodal_var(), and RichardsVarNames().

std::vector<const VariableValue *> RichardsVarNames::_moose_nodal_var_value_old
protected

moose_var_value_old[i] = old values of richards variable i

Definition at line 130 of file RichardsVarNames.h.

Referenced by nodal_var_old(), and RichardsVarNames().

std::vector<unsigned int> RichardsVarNames::_moose_var_num
protected

_moose_var_num[i] = the moose variable number corresponding to richards variable i

Definition at line 113 of file RichardsVarNames.h.

Referenced by RichardsVarNames().

std::vector<const VariableValue *> RichardsVarNames::_moose_var_value
protected

moose_var_value[i] = values of richards variable i

Definition at line 120 of file RichardsVarNames.h.

Referenced by richards_vals(), and RichardsVarNames().

std::vector<const VariableValue *> RichardsVarNames::_moose_var_value_old
protected

moose_var_value_old[i] = old values of richards variable i

Definition at line 123 of file RichardsVarNames.h.

Referenced by richards_vals_old(), and RichardsVarNames().

unsigned int RichardsVarNames::_num_v
protected

number of richards variables

Definition at line 107 of file RichardsVarNames.h.

Referenced by not_richards_var(), num_v(), richards_var_num(), and RichardsVarNames().

std::vector<unsigned int> RichardsVarNames::_ps_var_num
protected

_pressure_var_num[i] = the richards variable corresponding to moose variable i

Definition at line 116 of file RichardsVarNames.h.

Referenced by not_richards_var(), richards_var_num(), and RichardsVarNames().

MooseEnum RichardsVarNames::_var_types
protected

physical meaning of the variables. Eg 'pppp' means 'all variables are pressure variables'

Definition at line 110 of file RichardsVarNames.h.

Referenced by var_types().


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