www.mooseframework.org
Public Member Functions | Private Attributes | Friends | List of all members
JvarMapInterfaceBase< T > Class Template Reference

Base class ("Veneer") that implements the actual mapping from 'jvar' in into the _coupled_moose_vars array. More...

#include <JvarMapInterface.h>

Inheritance diagram for JvarMapInterfaceBase< T >:
[legend]

Public Member Functions

 JvarMapInterfaceBase (const InputParameters &parameters)
 
unsigned int mapJvarToCvar (unsigned int jvar)
 Return index into the _coupled_moose_vars array for a given jvar. More...
 
bool mapJvarToCvar (unsigned int jvar, unsigned int &cvar)
 Set the cvar value to the mapped jvar value and return true if the mapping exists. More...
 

Private Attributes

std::vector< int > _jvar_map
 look-up table to determine the _coupled_moose_vars index for the jvar parameter More...
 

Friends

class JvarMapKernelInterface< T >
 
class JvarMapIntegratedBCInterface< T >
 

Detailed Description

template<class T>
class JvarMapInterfaceBase< T >

Base class ("Veneer") that implements the actual mapping from 'jvar' in into the _coupled_moose_vars array.

Definition at line 14 of file JvarMapInterface.h.

Constructor & Destructor Documentation

template<class T >
JvarMapInterfaceBase< T >::JvarMapInterfaceBase ( const InputParameters parameters)

Definition at line 84 of file JvarMapInterface.h.

85  : T(parameters), _jvar_map(this->_fe_problem.getNonlinearSystemBase().nVariables(), -1)
86 {
87  auto nvar = this->_coupled_moose_vars.size();
88 
89  // populate map;
90  for (auto i = beginIndex(this->_coupled_moose_vars); i < nvar; ++i)
91  {
92  auto number = this->_coupled_moose_vars[i]->number();
93 
94  // skip AuxVars as off-diagonal jacobian entries are not calculated for them
95  if (number < _jvar_map.size())
96  _jvar_map[number] = i;
97  }
98 
99  // mark the kernel variable for the check in computeOffDiagJacobian
100  _jvar_map[this->_var.number()] = 0;
101 }
std::vector< int > _jvar_map
look-up table to determine the _coupled_moose_vars index for the jvar parameter

Member Function Documentation

template<class T >
unsigned int JvarMapInterfaceBase< T >::mapJvarToCvar ( unsigned int  jvar)

Return index into the _coupled_moose_vars array for a given jvar.

Definition at line 105 of file JvarMapInterface.h.

106 {
107  mooseAssert(jvar < _jvar_map.size(),
108  "Calling mapJvarToCvar for an invalid Moose variable number. Maybe an AuxVariable?");
109  int cit = _jvar_map[jvar];
110 
111  mooseAssert(cit >= 0, "Calling mapJvarToCvar for a variable not coupled to this kernel.");
112  return cit;
113 }
std::vector< int > _jvar_map
look-up table to determine the _coupled_moose_vars index for the jvar parameter
template<class T>
bool JvarMapInterfaceBase< T >::mapJvarToCvar ( unsigned int  jvar,
unsigned int &  cvar 
)

Set the cvar value to the mapped jvar value and return true if the mapping exists.

Otherwise return false.

Parameters
[in]jvarVariable number passed as argument to computeQpOffDiagJacobian
[out]cvarCorresponding index into the _coupled_moose_vars array
Returns
true if the requested variable is coupled, false otherwise

Friends And Related Function Documentation

template<class T>
friend class JvarMapIntegratedBCInterface< T >
friend

Definition at line 80 of file JvarMapInterface.h.

template<class T>
friend class JvarMapKernelInterface< T >
friend

Definition at line 79 of file JvarMapInterface.h.

Member Data Documentation

template<class T>
std::vector<int> JvarMapInterfaceBase< T >::_jvar_map
private

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