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

SplitCHWresBase implements the residual for the chemical potential in the split form of the Cahn-Hilliard equation in a general way that can be templated to a scalar or tensor mobility. More...

#include <SplitCHWResBase.h>

Inheritance diagram for SplitCHWResBase< T >:
[legend]

Public Member Functions

 SplitCHWResBase (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 

Protected Attributes

const MaterialPropertyName _mob_name
 
const MaterialProperty< T > & _mob
 
std::vector< const MaterialProperty< T > * > _dmobdarg
 

Detailed Description

template<typename T>
class SplitCHWResBase< T >

SplitCHWresBase implements the residual for the chemical potential in the split form of the Cahn-Hilliard equation in a general way that can be templated to a scalar or tensor mobility.

Definition at line 19 of file SplitCHWResBase.h.

Constructor & Destructor Documentation

◆ SplitCHWResBase()

template<typename T >
SplitCHWResBase< T >::SplitCHWResBase ( const InputParameters &  parameters)

Definition at line 48 of file SplitCHWResBase.h.

49  : DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
50  _mob_name(getParam<MaterialPropertyName>("mob_name")),
51  _mob(getMaterialProperty<T>("mob_name"))
52 {
53  // Get number of coupled variables
54  unsigned int nvar = _coupled_moose_vars.size();
55 
56  // reserve space for derivatives
57  _dmobdarg.resize(nvar);
58 
59  // Iterate over all coupled variables
60  for (unsigned int i = 0; i < nvar; ++i)
61  _dmobdarg[i] = &getMaterialPropertyDerivative<T>(_mob_name, _coupled_moose_vars[i]->name());
62 }
const std::string name
Definition: Setup.h:22
const MaterialProperty< T > & _mob
const MaterialPropertyName _mob_name
std::vector< const MaterialProperty< T > * > _dmobdarg

Member Function Documentation

◆ computeQpJacobian()

template<typename T >
Real SplitCHWResBase< T >::computeQpJacobian ( )
protectedvirtual

Definition at line 73 of file SplitCHWResBase.h.

74 {
75  return _mob[_qp] * _grad_phi[_j][_qp] * _grad_test[_i][_qp];
76 }
const MaterialProperty< T > & _mob

◆ computeQpOffDiagJacobian()

template<typename T >
Real SplitCHWResBase< T >::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 80 of file SplitCHWResBase.h.

81 {
82  // get the coupled variable jvar is referring to
83  const unsigned int cvar = mapJvarToCvar(jvar);
84 
85  return (*_dmobdarg[cvar])[_qp] * _phi[_j][_qp] * _grad_u[_qp] * _grad_test[_i][_qp];
86 }
std::vector< const MaterialProperty< T > * > _dmobdarg

◆ computeQpResidual()

template<typename T >
Real SplitCHWResBase< T >::computeQpResidual ( )
protectedvirtual

Definition at line 66 of file SplitCHWResBase.h.

67 {
68  return _mob[_qp] * _grad_u[_qp] * _grad_test[_i][_qp];
69 }
const MaterialProperty< T > & _mob

Member Data Documentation

◆ _dmobdarg

template<typename T>
std::vector<const MaterialProperty<T> *> SplitCHWResBase< T >::_dmobdarg
protected

Definition at line 44 of file SplitCHWResBase.h.

Referenced by SplitCHWResBase< Real >::SplitCHWResBase().

◆ _mob

template<typename T>
const MaterialProperty<T>& SplitCHWResBase< T >::_mob
protected

Definition at line 42 of file SplitCHWResBase.h.

◆ _mob_name

template<typename T>
const MaterialPropertyName SplitCHWResBase< T >::_mob_name
protected

Definition at line 41 of file SplitCHWResBase.h.

Referenced by SplitCHWResBase< Real >::SplitCHWResBase().


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