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 17 of file JvarMapInterface.h.

Constructor & Destructor Documentation

◆ JvarMapInterfaceBase()

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

Definition at line 88 of file JvarMapInterface.h.

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

Member Function Documentation

◆ mapJvarToCvar() [1/2]

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 109 of file JvarMapInterface.h.

110 {
111  mooseAssert(jvar < _jvar_map.size(),
112  "Calling mapJvarToCvar for an invalid Moose variable number. Maybe an AuxVariable?");
113  int cit = _jvar_map[jvar];
114 
115  mooseAssert(cit >= 0, "Calling mapJvarToCvar for a variable not coupled to this kernel.");
116  return cit;
117 }
std::vector< int > _jvar_map
look-up table to determine the _coupled_moose_vars index for the jvar parameter

◆ mapJvarToCvar() [2/2]

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

◆ JvarMapIntegratedBCInterface< T >

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

Definition at line 84 of file JvarMapInterface.h.

◆ JvarMapKernelInterface< T >

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

Definition at line 83 of file JvarMapInterface.h.

Member Data Documentation

◆ _jvar_map

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

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