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 (MooseVariableFEBase &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 30 of file JvarMapInterface.h.

Constructor & Destructor Documentation

◆ JvarMapKernelInterface()

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

Definition at line 120 of file JvarMapInterface.h.

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

Member Function Documentation

◆ computeOffDiagJacobian()

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

Definition at line 133 of file JvarMapInterface.h.

134 {
135  // the Kernel is not coupled to the variable; no need to loop over QPs
136  if (this->_jvar_map[jvar.number()] < 0)
137  return;
138 
139  // call the underlying class' off-diagonal Jacobian
140  T::computeOffDiagJacobian(jvar);
141 }
unsigned int number() const
Get variable number coming from libMesh.
std::vector< int > _jvar_map
look-up table to determine the _coupled_moose_vars index for the jvar parameter

◆ mapJvarToCvar() [1/2]

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