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

Constructor & Destructor Documentation

◆ JvarMapInterfaceBase()

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

Definition at line 89 of file JvarMapInterface.h.

90  : T(parameters), _jvar_map(this->_fe_problem.getNonlinearSystemBase().nVariables(), -1)
91 {
92  // populate map;
93  for (auto it : Moose::enumerate(this->_coupled_moose_vars))
94  {
95  auto number = it.value()->number();
96 
97  // skip AuxVars as off-diagonal jacobian entries are not calculated for them
98  if (number < _jvar_map.size())
99  _jvar_map[number] = it.index();
100  }
101 
102  // mark the kernel variable for the check in computeOffDiagJacobian
103  _jvar_map[this->_var.number()] = 0;
104 }
_enumerate_range< Iterator > enumerate(Iterator first, Iterator last, typename std::iterator_traits< Iterator >::difference_type initial)
Enumerate function for iterating over a range and obtaining both a reference to the underlying type a...
Definition: Enumerate.h:53
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 108 of file JvarMapInterface.h.

109 {
110  mooseAssert(jvar < _jvar_map.size(),
111  "Calling mapJvarToCvar for an invalid Moose variable number. Maybe an AuxVariable?");
112  int cit = _jvar_map[jvar];
113 
114  mooseAssert(cit >= 0, "Calling mapJvarToCvar for a variable not coupled to this kernel.");
115  return cit;
116 }
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 85 of file JvarMapInterface.h.

◆ JvarMapKernelInterface< T >

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

Definition at line 84 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: