www.mooseframework.org
Public Member Functions | List of all members
JvarMapKernelInterface< T > Class Template Reference

Interface class ("Veneer") for Kernel to provide a mapping from 'jvar' in computeQpOffDiagJacobian into the _coupled_moose_vars array. More...

#include <JvarMapInterface.h>

Inheritance diagram for JvarMapKernelInterface< T >:
[legend]

Public Member Functions

 JvarMapKernelInterface (const InputParameters &parameters)
 
virtual void computeOffDiagJacobian (unsigned int jvar) override
 
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...
 

Detailed Description

template<class T>
class JvarMapKernelInterface< T >

Interface class ("Veneer") for Kernel to provide a mapping from 'jvar' in computeQpOffDiagJacobian into the _coupled_moose_vars array.

This class is useful in conjunction with DerivativeMaterialInterface, where vectors of material property derviatives with respect to all coupled variables (iterating over _coupled_moose_vars array) are generated. The mapping enabled the look up of the correct material property derivatives for the current jvar.

Definition at line 27 of file JvarMapInterface.h.

Constructor & Destructor Documentation

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

Definition at line 116 of file JvarMapInterface.h.

117  : JvarMapInterfaceBase<T>(parameters)
118 {
119 }
Base class ("Veneer") that implements the actual mapping from &#39;jvar&#39; in into the _coupled_moose_vars ...

Member Function Documentation

template<class T >
void JvarMapKernelInterface< T >::computeOffDiagJacobian ( unsigned int  jvar)
overridevirtual

Definition at line 129 of file JvarMapInterface.h.

130 {
131  // the Kernel is not coupled to the variable; no need to loop over QPs
132  if (this->_jvar_map[jvar] < 0)
133  return;
134 
135  // call the underlying class' off-diagonal Jacobian
136  T::computeOffDiagJacobian(jvar);
137 }
std::vector< int > _jvar_map
look-up table to determine the _coupled_moose_vars index for the jvar parameter
template<class T >
unsigned int JvarMapInterfaceBase< T >::mapJvarToCvar ( unsigned int  jvar)
inherited

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 
)
inherited

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

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