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

Holds variables and provides some services. More...

#include <VariableWarehouse.h>

Public Member Functions

 VariableWarehouse ()
 
void add (const std::string &var_name, std::shared_ptr< MooseVariableBase > var)
 Add a variable. More...
 
void addBoundaryVar (BoundaryID bnd, const MooseVariableFieldBase *var)
 Add a boundary variable. More...
 
void addBoundaryVar (const std::set< BoundaryID > &boundary_ids, const MooseVariableFieldBase *var)
 Add a variable to a set of boundaries. More...
 
void addBoundaryVars (const std::set< BoundaryID > &boundary_ids, const std::unordered_map< std::string, std::vector< MooseVariableFieldBase *>> &vars)
 Add a map of variables to a set of boundaries. More...
 
MooseVariableBasegetVariable (const std::string &var_name) const
 Get a variable from the warehouse. More...
 
MooseVariableBasegetVariable (unsigned int var_number) const
 Get a variable from the warehouse. More...
 
template<typename T >
MooseVariableFE< T > * getFieldVariable (const std::string &var_name)
 Get a finite element variable from the warehouse of either Real or RealVectorValue type. More...
 
template<typename T >
MooseVariableFE< T > * getFieldVariable (unsigned int var_number)
 Get a finite element variable from the warehouse of either Real or RealVectorValue type. More...
 
template<typename T >
MooseVariableField< T > * getActualFieldVariable (const std::string &var_name)
 This should be called getFieldVariable, but that name is already taken by a legacy function. More...
 
template<typename T >
MooseVariableFV< T > * getFVVariable (const std::string &var_name)
 Get a finite volume variable. More...
 
template<typename T >
MooseVariableField< T > * getActualFieldVariable (unsigned int var_number)
 This should be called getFieldVariable, but that name is already taken by a legacy function. More...
 
const std::vector< VariableName > & names () const
 Get the list of all variable names. More...
 
const std::vector< MooseVariableFieldBase * > & fieldVariables () const
 Get the list of variables. More...
 
const std::set< const MooseVariableFieldBase * > & boundaryVars (BoundaryID bnd) const
 Get the list of variables that needs to be reinitialized on a given boundary. More...
 
const std::vector< MooseVariableScalar * > & scalars () const
 Get the list of scalar variables. More...
 
void initialSetup ()
 Call initialSetup for all variables. More...
 
void timestepSetup ()
 Call timestepSetup for all variables. More...
 
void customSetup (const ExecFlagType &exec_type)
 Call setup on a particular execute flag for all variables. More...
 
void subdomainSetup ()
 Call subdomainSetup for all variables. More...
 
void residualSetup ()
 Call residualSetup for all variables. More...
 
void jacobianSetup ()
 Call jacobianSetup for all variables. More...
 
void clearAllDofIndices ()
 Clear all dof indices from each variable. More...
 
void setActiveVariableCoupleableVectorTags (const std::set< TagID > &vtags)
 Set the active vector tags for the variables. More...
 
void setActiveScalarVariableCoupleableVectorTags (const std::set< TagID > &vtags)
 Set the active vector tags for the variables. More...
 
const std::map< unsigned int, std::shared_ptr< MooseVariableBase > > & numberToVariableMap () const
 Map from variable number to variable pointer. More...
 
template<>
MooseVariableFE< RealVectorValue > * getFieldVariable (const std::string &var_name)
 
template<>
MooseVariableFE< RealVectorValue > * getFieldVariable (unsigned int var_number)
 
template<>
MooseVariableFE< RealEigenVector > * getFieldVariable (const std::string &var_name)
 
template<>
MooseVariableFE< RealEigenVector > * getFieldVariable (unsigned int var_number)
 
template<>
MooseVariableField< RealVectorValue > * getActualFieldVariable (const std::string &var_name)
 
template<>
MooseVariableField< RealVectorValue > * getActualFieldVariable (unsigned int var_number)
 
template<>
MooseVariableField< RealEigenVector > * getActualFieldVariable (const std::string &var_name)
 
template<>
MooseVariableField< RealEigenVector > * getActualFieldVariable (unsigned int var_number)
 
template<>
VectorMooseVariablegetFieldVariable (const std::string &var_name)
 
template<>
VectorMooseVariablegetFieldVariable (unsigned int var_number)
 
template<>
ArrayMooseVariablegetFieldVariable (const std::string &var_name)
 
template<>
ArrayMooseVariablegetFieldVariable (unsigned int var_number)
 
template<>
MooseVariableField< RealVectorValue > * getActualFieldVariable (const std::string &var_name)
 
template<>
MooseVariableField< RealVectorValue > * getActualFieldVariable (unsigned int var_number)
 
template<>
MooseVariableField< RealEigenVector > * getActualFieldVariable (const std::string &var_name)
 
template<>
MooseVariableField< RealEigenVector > * getActualFieldVariable (unsigned int var_number)
 

Protected Attributes

std::vector< VariableName > _names
 list of variable names More...
 
std::vector< MooseVariableFieldBase * > _vars
 list of finite element variables More...
 
HashMap< unsigned, MooseVariable * > _regular_vars_by_number
 map of non-vector finite element variables with unsigned keys More...
 
HashMap< std::string, MooseVariableFVReal * > _fv_vars_by_name
 map of non-vector finite element variables with name keys More...
 
HashMap< std::string, MooseLinearVariableFVReal * > _linear_fv_vars_by_name
 map of non-vector linear finite volume variables with name keys More...
 
HashMap< std::string, MooseVariable * > _regular_vars_by_name
 map of non-vector finite element variables with name keys More...
 
HashMap< unsigned, MooseVariableFVReal * > _fv_vars_by_number
 map of non-vector finite element variables with unsigned keys More...
 
HashMap< unsigned, MooseLinearVariableFVReal * > _linear_fv_vars_by_number
 map of non-vector finite element variables with unsigned keys More...
 
HashMap< std::string, VectorMooseVariable * > _vector_vars_by_name
 map of vector finite element variables with name keys More...
 
HashMap< unsigned, VectorMooseVariable * > _vector_vars_by_number
 map of vector finite element variables with unsigned keys More...
 
HashMap< std::string, ArrayMooseVariable * > _array_vars_by_name
 map of vector finite element variables with name keys More...
 
HashMap< unsigned, ArrayMooseVariable * > _array_vars_by_number
 map of vector finite element variables with unsigned keys More...
 
std::map< std::string, MooseVariableBase * > _var_name
 Name to variable mapping. More...
 
std::map< BoundaryID, std::set< const MooseVariableFieldBase * > > _boundary_vars
 Map to variables that need to be evaluated on a boundary. More...
 
std::vector< MooseVariableScalar * > _scalar_vars
 list of all scalar, non-finite element variables More...
 
std::map< unsigned int, std::shared_ptr< MooseVariableBase > > _all_objects
 All instances of objects. More...
 

Detailed Description

Holds variables and provides some services.

Definition at line 49 of file VariableWarehouse.h.

Constructor & Destructor Documentation

◆ VariableWarehouse()

VariableWarehouse::VariableWarehouse ( )

Definition at line 17 of file VariableWarehouse.C.

17 {}

Member Function Documentation

◆ add()

void VariableWarehouse::add ( const std::string &  var_name,
std::shared_ptr< MooseVariableBase var 
)

Add a variable.

Parameters
var_nameThe name of the variable
varVariable

Definition at line 20 of file VariableWarehouse.C.

21 {
22  _names.push_back(var_name);
23  auto * raw_var = var.get();
24  _all_objects[var->number()] = var;
25  _var_name[var_name] = raw_var;
26 
27  if (auto * tmp_var = dynamic_cast<MooseVariableFieldBase *>(raw_var))
28  {
29  _vars.push_back(tmp_var);
30  if (auto * tmp_var = dynamic_cast<MooseVariable *>(raw_var))
31  {
32  _regular_vars_by_number[tmp_var->number()] = tmp_var;
33  _regular_vars_by_name[var_name] = tmp_var;
34  }
35  else if (auto * tmp_var = dynamic_cast<MooseVariableFVReal *>(raw_var))
36  {
37  _fv_vars_by_number[tmp_var->number()] = tmp_var;
38  _fv_vars_by_name[var_name] = tmp_var;
39  }
40  else if (auto * tmp_var = dynamic_cast<MooseLinearVariableFVReal *>(raw_var))
41  {
42  _linear_fv_vars_by_number[tmp_var->number()] = tmp_var;
43  _linear_fv_vars_by_name[var_name] = tmp_var;
44  }
45  else if (auto * tmp_var = dynamic_cast<VectorMooseVariable *>(raw_var))
46  {
47  _vector_vars_by_number[tmp_var->number()] = tmp_var;
48  _vector_vars_by_name[var_name] = tmp_var;
49  }
50  else if (auto * tmp_var = dynamic_cast<ArrayMooseVariable *>(raw_var))
51  {
52  _array_vars_by_number[tmp_var->number()] = tmp_var;
53  _array_vars_by_name[var_name] = tmp_var;
54  }
55  else
56  mooseError("Unknown variable class passed into VariableWarehouse. Attempt to hack us?");
57  }
58  else if (auto * tmp_var = dynamic_cast<MooseVariableScalar *>(raw_var))
59  _scalar_vars.push_back(tmp_var);
60  else
61  mooseError("Unknown variable class passed into VariableWarehouse. Attempt to hack us?");
62 }
std::vector< MooseVariableScalar * > _scalar_vars
list of all scalar, non-finite element variables
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
HashMap< unsigned, ArrayMooseVariable * > _array_vars_by_number
map of vector finite element variables with unsigned keys
std::map< std::string, MooseVariableBase * > _var_name
Name to variable mapping.
HashMap< std::string, VectorMooseVariable * > _vector_vars_by_name
map of vector finite element variables with name keys
HashMap< std::string, MooseLinearVariableFVReal * > _linear_fv_vars_by_name
map of non-vector linear finite volume variables with name keys
std::map< unsigned int, std::shared_ptr< MooseVariableBase > > _all_objects
All instances of objects.
HashMap< unsigned, MooseVariableFVReal * > _fv_vars_by_number
map of non-vector finite element variables with unsigned keys
std::vector< MooseVariableFieldBase * > _vars
list of finite element variables
HashMap< std::string, ArrayMooseVariable * > _array_vars_by_name
map of vector finite element variables with name keys
HashMap< unsigned, MooseVariable * > _regular_vars_by_number
map of non-vector finite element variables with unsigned keys
std::vector< VariableName > _names
list of variable names
HashMap< std::string, MooseVariable * > _regular_vars_by_name
map of non-vector finite element variables with name keys
HashMap< unsigned, MooseLinearVariableFVReal * > _linear_fv_vars_by_number
map of non-vector finite element variables with unsigned keys
HashMap< unsigned, VectorMooseVariable * > _vector_vars_by_number
map of vector finite element variables with unsigned keys
HashMap< std::string, MooseVariableFVReal * > _fv_vars_by_name
map of non-vector finite element variables with name keys

◆ addBoundaryVar() [1/2]

void VariableWarehouse::addBoundaryVar ( BoundaryID  bnd,
const MooseVariableFieldBase var 
)

Add a boundary variable.

Parameters
bndThe boundary id where this variable is defined
varThe variable

Definition at line 65 of file VariableWarehouse.C.

Referenced by addBoundaryVar(), and addBoundaryVars().

66 {
67  _boundary_vars[bnd].insert(var);
68 }
std::map< BoundaryID, std::set< const MooseVariableFieldBase * > > _boundary_vars
Map to variables that need to be evaluated on a boundary.

◆ addBoundaryVar() [2/2]

void VariableWarehouse::addBoundaryVar ( const std::set< BoundaryID > &  boundary_ids,
const MooseVariableFieldBase var 
)

Add a variable to a set of boundaries.

Parameters
boundary_idsThe boundary ids where this variable is defined
varThe variable

Definition at line 71 of file VariableWarehouse.C.

73 {
74  for (const auto & bid : boundary_ids)
75  addBoundaryVar(bid, var);
76 }
void addBoundaryVar(BoundaryID bnd, const MooseVariableFieldBase *var)
Add a boundary variable.

◆ addBoundaryVars()

void VariableWarehouse::addBoundaryVars ( const std::set< BoundaryID > &  boundary_ids,
const std::unordered_map< std::string, std::vector< MooseVariableFieldBase *>> &  vars 
)

Add a map of variables to a set of boundaries.

Parameters
boundary_idsThe boundary ids where this variable is defined
varsA map of variables

Definition at line 79 of file VariableWarehouse.C.

82 {
83  for (const auto & bid : boundary_ids)
84  for (const auto & it : vars)
85  for (const auto & var : it.second)
86  addBoundaryVar(bid, var);
87 }
void addBoundaryVar(BoundaryID bnd, const MooseVariableFieldBase *var)
Add a boundary variable.

◆ boundaryVars()

const std::set< const MooseVariableFEBase * > & VariableWarehouse::boundaryVars ( BoundaryID  bnd) const

Get the list of variables that needs to be reinitialized on a given boundary.

Parameters
bndThe boundary ID
Returns
The list of variables

Definition at line 128 of file VariableWarehouse.C.

129 {
130  return _boundary_vars.find(bnd)->second;
131 }
std::map< BoundaryID, std::set< const MooseVariableFieldBase * > > _boundary_vars
Map to variables that need to be evaluated on a boundary.

◆ clearAllDofIndices()

void VariableWarehouse::clearAllDofIndices ( )

Clear all dof indices from each variable.

Definition at line 302 of file VariableWarehouse.C.

303 {
304  for (auto * var : _vars)
305  var->clearAllDofIndices();
306 }
std::vector< MooseVariableFieldBase * > _vars
list of finite element variables

◆ customSetup()

void VariableWarehouse::customSetup ( const ExecFlagType exec_type)

Call setup on a particular execute flag for all variables.

Definition at line 274 of file VariableWarehouse.C.

275 {
276  for (auto & pair : _all_objects)
277  pair.second->customSetup(exec_type);
278 }
std::map< unsigned int, std::shared_ptr< MooseVariableBase > > _all_objects
All instances of objects.

◆ fieldVariables()

const std::vector< MooseVariableFEBase * > & VariableWarehouse::fieldVariables ( ) const

Get the list of variables.

Returns
The list of variables

Definition at line 116 of file VariableWarehouse.C.

117 {
118  return _vars;
119 }
std::vector< MooseVariableFieldBase * > _vars
list of finite element variables

◆ getActualFieldVariable() [1/10]

template<typename T >
MooseVariableField< T > * VariableWarehouse::getActualFieldVariable ( const std::string &  var_name)

This should be called getFieldVariable, but that name is already taken by a legacy function.

Definition at line 203 of file VariableWarehouse.C.

204 {
205  auto it = _regular_vars_by_name.find(var_name);
206  if (it != _regular_vars_by_name.end())
207  return it->second;
208  auto it_fv = _fv_vars_by_name.find(var_name);
209  if (it_fv != _fv_vars_by_name.end())
210  return it_fv->second;
211  return _linear_fv_vars_by_name.at(var_name);
212 }
HashMap< std::string, MooseLinearVariableFVReal * > _linear_fv_vars_by_name
map of non-vector linear finite volume variables with name keys
HashMap< std::string, MooseVariable * > _regular_vars_by_name
map of non-vector finite element variables with name keys
HashMap< std::string, MooseVariableFVReal * > _fv_vars_by_name
map of non-vector finite element variables with name keys

◆ getActualFieldVariable() [2/10]

template<typename T >
MooseVariableField< T > * VariableWarehouse::getActualFieldVariable ( unsigned int  var_number)

This should be called getFieldVariable, but that name is already taken by a legacy function.

Definition at line 216 of file VariableWarehouse.C.

217 {
218  auto it = _regular_vars_by_number.find(var_number);
219  if (it != _regular_vars_by_number.end())
220  return it->second;
221  auto it_fv = _fv_vars_by_number.find(var_number);
222  if (it_fv != _fv_vars_by_number.end())
223  return it_fv->second;
224  return _linear_fv_vars_by_number.at(var_number);
225 }
HashMap< unsigned, MooseVariableFVReal * > _fv_vars_by_number
map of non-vector finite element variables with unsigned keys
HashMap< unsigned, MooseVariable * > _regular_vars_by_number
map of non-vector finite element variables with unsigned keys
HashMap< unsigned, MooseLinearVariableFVReal * > _linear_fv_vars_by_number
map of non-vector finite element variables with unsigned keys

◆ getActualFieldVariable() [3/10]

template<>
MooseVariableField<RealVectorValue>* VariableWarehouse::getActualFieldVariable ( const std::string &  var_name)

Definition at line 229 of file VariableWarehouse.C.

230 {
231  // TODO: when necessary, add the if check to see if we have an FV vector var
232  // before just returning nothing as found in FE vars list.
233  return getFieldVariable<RealVectorValue>(var_name);
234 }

◆ getActualFieldVariable() [4/10]

template<>
template MooseVariableField< Real > * VariableWarehouse::getActualFieldVariable< Real > ( const std::string &  var_name)

Definition at line 247 of file VariableWarehouse.C.

248 {
249  return getFieldVariable<RealEigenVector>(var_name);
250 }

◆ getActualFieldVariable() [5/10]

template<>
template MooseVariableField< Real > * VariableWarehouse::getActualFieldVariable< Real > ( unsigned int  var_number)

Definition at line 254 of file VariableWarehouse.C.

255 {
256  return getFieldVariable<RealEigenVector>(var_number);
257 }

◆ getActualFieldVariable() [6/10]

template<>
MooseVariableField<RealVectorValue>* VariableWarehouse::getActualFieldVariable ( unsigned int  var_number)

Definition at line 238 of file VariableWarehouse.C.

239 {
240  // TODO: when necessary, add the if check to see if we have an FV vector var
241  // before just returning nothing as found in FE vars list.
242  return getFieldVariable<RealVectorValue>(var_number);
243 }

◆ getActualFieldVariable() [7/10]

template<>
MooseVariableField<RealEigenVector>* VariableWarehouse::getActualFieldVariable ( const std::string &  var_name)

◆ getActualFieldVariable() [8/10]

template<>
MooseVariableField<RealEigenVector>* VariableWarehouse::getActualFieldVariable ( unsigned int  var_number)

◆ getActualFieldVariable() [9/10]

template<>
MooseVariableField<RealVectorValue>* VariableWarehouse::getActualFieldVariable ( const std::string &  var_name)

◆ getActualFieldVariable() [10/10]

template<>
MooseVariableField<RealVectorValue>* VariableWarehouse::getActualFieldVariable ( unsigned int  var_number)

◆ getFieldVariable() [1/10]

template<typename T >
MooseVariableFE< T > * VariableWarehouse::getFieldVariable ( const std::string &  var_name)

Get a finite element variable from the warehouse of either Real or RealVectorValue type.

Parameters
var_nameThe name of the variable to retrieve
Returns
The retrieved variable

Note this should actually be named getFieldFEVariable, but that would require fixing a lot of code in a lot of apps

Definition at line 153 of file VariableWarehouse.C.

154 {
155  return getFieldVariableHelper<T>(_regular_vars_by_name, var_name, "_regular_vars_by_name");
156 }
HashMap< std::string, MooseVariable * > _regular_vars_by_name
map of non-vector finite element variables with name keys

◆ getFieldVariable() [2/10]

template<typename T >
MooseVariableFE< T > * VariableWarehouse::getFieldVariable ( unsigned int  var_number)

Get a finite element variable from the warehouse of either Real or RealVectorValue type.

Parameters
var_numberThe number of the variable to retrieve
Returns
The retrieved variable

Note this should actually be named getFieldFEVariable, but that would require fixing a lot of code in a lot of apps

Definition at line 160 of file VariableWarehouse.C.

161 {
162  return getFieldVariableHelper<T>(_regular_vars_by_number, var_number, "_regular_vars_by_number");
163 }
HashMap< unsigned, MooseVariable * > _regular_vars_by_number
map of non-vector finite element variables with unsigned keys

◆ getFieldVariable() [3/10]

template<>
VectorMooseVariable* VariableWarehouse::getFieldVariable ( const std::string &  var_name)

Definition at line 167 of file VariableWarehouse.C.

168 {
169  return getFieldVariableHelper<RealVectorValue>(
170  _vector_vars_by_name, var_name, "_vector_vars_by_name");
171 }
HashMap< std::string, VectorMooseVariable * > _vector_vars_by_name
map of vector finite element variables with name keys

◆ getFieldVariable() [4/10]

template<>
VectorMooseVariable* VariableWarehouse::getFieldVariable ( unsigned int  var_number)

Definition at line 175 of file VariableWarehouse.C.

176 {
177  return getFieldVariableHelper<RealVectorValue>(
178  _vector_vars_by_number, var_number, "_vector_vars_by_number");
179 }
HashMap< unsigned, VectorMooseVariable * > _vector_vars_by_number
map of vector finite element variables with unsigned keys

◆ getFieldVariable() [5/10]

template<>
template MooseVariableFE< Real > * VariableWarehouse::getFieldVariable< Real > ( const std::string &  var_name)

Definition at line 183 of file VariableWarehouse.C.

184 {
185  return getFieldVariableHelper<RealEigenVector>(
186  _array_vars_by_name, var_name, "_array_vars_by_name");
187 }
HashMap< std::string, ArrayMooseVariable * > _array_vars_by_name
map of vector finite element variables with name keys

◆ getFieldVariable() [6/10]

template<>
template MooseVariableFE< Real > * VariableWarehouse::getFieldVariable< Real > ( unsigned int  var_number)

Definition at line 191 of file VariableWarehouse.C.

192 {
193  return getFieldVariableHelper<RealEigenVector>(
194  _array_vars_by_number, var_number, "_array_vars_by_number");
195 }
HashMap< unsigned, ArrayMooseVariable * > _array_vars_by_number
map of vector finite element variables with unsigned keys

◆ getFieldVariable() [7/10]

template<>
MooseVariableFE<RealEigenVector>* VariableWarehouse::getFieldVariable ( unsigned int  var_number)

◆ getFieldVariable() [8/10]

template<>
MooseVariableFE<RealEigenVector>* VariableWarehouse::getFieldVariable ( const std::string &  var_name)

◆ getFieldVariable() [9/10]

template<>
MooseVariableFE<RealVectorValue>* VariableWarehouse::getFieldVariable ( const std::string &  var_name)

◆ getFieldVariable() [10/10]

template<>
MooseVariableFE<RealVectorValue>* VariableWarehouse::getFieldVariable ( unsigned int  var_number)

◆ getFVVariable()

template<typename T >
MooseVariableFV< T > * VariableWarehouse::getFVVariable ( const std::string &  var_name)

Get a finite volume variable.

Definition at line 270 of file VariableWarehouse.h.

271 {
272  auto it = _fv_vars_by_name.find(var_name);
273  if (it == _fv_vars_by_name.end())
274  mooseError("Requested variable ",
275  var_name,
276  " doesn't exist as a finite volume variable in the warehouse.");
277 
278  return it->second;
279 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
HashMap< std::string, MooseVariableFVReal * > _fv_vars_by_name
map of non-vector finite element variables with name keys

◆ getVariable() [1/2]

MooseVariableBase * VariableWarehouse::getVariable ( const std::string &  var_name) const

Get a variable from the warehouse.

Parameters
var_nameThe name of the variable to retrieve
Returns
The retrieved variable

Definition at line 90 of file VariableWarehouse.C.

91 {
92  auto it = _var_name.find(var_name);
93  if (it != _var_name.end())
94  return it->second;
95  else
96  return nullptr;
97 }
std::map< std::string, MooseVariableBase * > _var_name
Name to variable mapping.

◆ getVariable() [2/2]

MooseVariableBase * VariableWarehouse::getVariable ( unsigned int  var_number) const

Get a variable from the warehouse.

Parameters
var_numberThe number of the variable to retrieve
Returns
The retrieved variable

Definition at line 100 of file VariableWarehouse.C.

101 {
102  auto it = _all_objects.find(var_number);
103  if (it != _all_objects.end())
104  return it->second.get();
105  else
106  return nullptr;
107 }
std::map< unsigned int, std::shared_ptr< MooseVariableBase > > _all_objects
All instances of objects.

◆ initialSetup()

void VariableWarehouse::initialSetup ( )

Call initialSetup for all variables.

Definition at line 260 of file VariableWarehouse.C.

261 {
262  for (auto & pair : _all_objects)
263  pair.second->initialSetup();
264 }
std::map< unsigned int, std::shared_ptr< MooseVariableBase > > _all_objects
All instances of objects.

◆ jacobianSetup()

void VariableWarehouse::jacobianSetup ( )

Call jacobianSetup for all variables.

Definition at line 288 of file VariableWarehouse.C.

289 {
290  for (auto & pair : _all_objects)
291  pair.second->jacobianSetup();
292 }
std::map< unsigned int, std::shared_ptr< MooseVariableBase > > _all_objects
All instances of objects.

◆ names()

const std::vector< VariableName > & VariableWarehouse::names ( ) const

Get the list of all variable names.

Returns
The list of variable names

Definition at line 110 of file VariableWarehouse.C.

111 {
112  return _names;
113 }
std::vector< VariableName > _names
list of variable names

◆ numberToVariableMap()

const std::map< unsigned int, std::shared_ptr< MooseVariableBase > > & VariableWarehouse::numberToVariableMap ( ) const
inline

Map from variable number to variable pointer.

Includes both field and scalar variables

Definition at line 282 of file VariableWarehouse.h.

283 {
284  return _all_objects;
285 }
std::map< unsigned int, std::shared_ptr< MooseVariableBase > > _all_objects
All instances of objects.

◆ residualSetup()

void VariableWarehouse::residualSetup ( )

Call residualSetup for all variables.

Definition at line 295 of file VariableWarehouse.C.

296 {
297  for (auto & pair : _all_objects)
298  pair.second->residualSetup();
299 }
std::map< unsigned int, std::shared_ptr< MooseVariableBase > > _all_objects
All instances of objects.

◆ scalars()

const std::vector< MooseVariableScalar * > & VariableWarehouse::scalars ( ) const

Get the list of scalar variables.

Returns
The list of scalar variables

Definition at line 122 of file VariableWarehouse.C.

123 {
124  return _scalar_vars;
125 }
std::vector< MooseVariableScalar * > _scalar_vars
list of all scalar, non-finite element variables

◆ setActiveScalarVariableCoupleableVectorTags()

void VariableWarehouse::setActiveScalarVariableCoupleableVectorTags ( const std::set< TagID > &  vtags)

Set the active vector tags for the variables.

Definition at line 316 of file VariableWarehouse.C.

317 {
318  for (auto * var : _scalar_vars)
319  var->setActiveTags(vtags);
320 }
std::vector< MooseVariableScalar * > _scalar_vars
list of all scalar, non-finite element variables

◆ setActiveVariableCoupleableVectorTags()

void VariableWarehouse::setActiveVariableCoupleableVectorTags ( const std::set< TagID > &  vtags)

Set the active vector tags for the variables.

Definition at line 309 of file VariableWarehouse.C.

310 {
311  for (auto * var : _vars)
312  var->setActiveTags(vtags);
313 }
std::vector< MooseVariableFieldBase * > _vars
list of finite element variables

◆ subdomainSetup()

void VariableWarehouse::subdomainSetup ( )

Call subdomainSetup for all variables.

Definition at line 281 of file VariableWarehouse.C.

282 {
283  for (auto & pair : _all_objects)
284  pair.second->subdomainSetup();
285 }
std::map< unsigned int, std::shared_ptr< MooseVariableBase > > _all_objects
All instances of objects.

◆ timestepSetup()

void VariableWarehouse::timestepSetup ( )

Call timestepSetup for all variables.

Definition at line 267 of file VariableWarehouse.C.

268 {
269  for (auto & pair : _all_objects)
270  pair.second->timestepSetup();
271 }
std::map< unsigned int, std::shared_ptr< MooseVariableBase > > _all_objects
All instances of objects.

Member Data Documentation

◆ _all_objects

std::map<unsigned int, std::shared_ptr<MooseVariableBase> > VariableWarehouse::_all_objects
protected

◆ _array_vars_by_name

HashMap<std::string, ArrayMooseVariable *> VariableWarehouse::_array_vars_by_name
protected

map of vector finite element variables with name keys

Definition at line 250 of file VariableWarehouse.h.

Referenced by add().

◆ _array_vars_by_number

HashMap<unsigned, ArrayMooseVariable *> VariableWarehouse::_array_vars_by_number
protected

map of vector finite element variables with unsigned keys

Definition at line 253 of file VariableWarehouse.h.

Referenced by add().

◆ _boundary_vars

std::map<BoundaryID, std::set<const MooseVariableFieldBase *> > VariableWarehouse::_boundary_vars
protected

Map to variables that need to be evaluated on a boundary.

Definition at line 259 of file VariableWarehouse.h.

Referenced by addBoundaryVar(), and boundaryVars().

◆ _fv_vars_by_name

HashMap<std::string, MooseVariableFVReal *> VariableWarehouse::_fv_vars_by_name
protected

map of non-vector finite element variables with name keys

Definition at line 229 of file VariableWarehouse.h.

Referenced by add(), getActualFieldVariable(), and getFVVariable().

◆ _fv_vars_by_number

HashMap<unsigned, MooseVariableFVReal *> VariableWarehouse::_fv_vars_by_number
protected

map of non-vector finite element variables with unsigned keys

Definition at line 238 of file VariableWarehouse.h.

Referenced by add(), and getActualFieldVariable().

◆ _linear_fv_vars_by_name

HashMap<std::string, MooseLinearVariableFVReal *> VariableWarehouse::_linear_fv_vars_by_name
protected

map of non-vector linear finite volume variables with name keys

Definition at line 232 of file VariableWarehouse.h.

Referenced by add(), and getActualFieldVariable().

◆ _linear_fv_vars_by_number

HashMap<unsigned, MooseLinearVariableFVReal *> VariableWarehouse::_linear_fv_vars_by_number
protected

map of non-vector finite element variables with unsigned keys

Definition at line 241 of file VariableWarehouse.h.

Referenced by add(), and getActualFieldVariable().

◆ _names

std::vector<VariableName> VariableWarehouse::_names
protected

list of variable names

Definition at line 220 of file VariableWarehouse.h.

Referenced by add(), and names().

◆ _regular_vars_by_name

HashMap<std::string, MooseVariable *> VariableWarehouse::_regular_vars_by_name
protected

map of non-vector finite element variables with name keys

Definition at line 235 of file VariableWarehouse.h.

Referenced by add(), getActualFieldVariable(), and getFieldVariable().

◆ _regular_vars_by_number

HashMap<unsigned, MooseVariable *> VariableWarehouse::_regular_vars_by_number
protected

map of non-vector finite element variables with unsigned keys

Definition at line 226 of file VariableWarehouse.h.

Referenced by add(), getActualFieldVariable(), and getFieldVariable().

◆ _scalar_vars

std::vector<MooseVariableScalar *> VariableWarehouse::_scalar_vars
protected

list of all scalar, non-finite element variables

Definition at line 262 of file VariableWarehouse.h.

Referenced by add(), scalars(), and setActiveScalarVariableCoupleableVectorTags().

◆ _var_name

std::map<std::string, MooseVariableBase *> VariableWarehouse::_var_name
protected

Name to variable mapping.

Definition at line 256 of file VariableWarehouse.h.

Referenced by add(), and getVariable().

◆ _vars

std::vector<MooseVariableFieldBase *> VariableWarehouse::_vars
protected

list of finite element variables

Definition at line 223 of file VariableWarehouse.h.

Referenced by add(), clearAllDofIndices(), fieldVariables(), and setActiveVariableCoupleableVectorTags().

◆ _vector_vars_by_name

HashMap<std::string, VectorMooseVariable *> VariableWarehouse::_vector_vars_by_name
protected

map of vector finite element variables with name keys

Definition at line 244 of file VariableWarehouse.h.

Referenced by add().

◆ _vector_vars_by_number

HashMap<unsigned, VectorMooseVariable *> VariableWarehouse::_vector_vars_by_number
protected

map of vector finite element variables with unsigned keys

Definition at line 247 of file VariableWarehouse.h.

Referenced by add().


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