www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private 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)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

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

Private 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 21 of file SplitCHWResBase.h.

Constructor & Destructor Documentation

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

Definition at line 41 of file SplitCHWResBase.h.

42  : DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
43  _mob_name(getParam<MaterialPropertyName>("mob_name")),
44  _mob(getMaterialProperty<T>("mob_name"))
45 {
46  // Get number of coupled variables
47  unsigned int nvar = _coupled_moose_vars.size();
48 
49  // reserve space for derivatives
50  _dmobdarg.resize(nvar);
51 
52  // Iterate over all coupled variables
53  for (unsigned int i = 0; i < nvar; ++i)
54  _dmobdarg[i] = &getMaterialPropertyDerivative<T>(_mob_name, _coupled_moose_vars[i]->name());
55 }
const MaterialProperty< T > & _mob
const MaterialPropertyName _mob_name
std::vector< const MaterialProperty< T > * > _dmobdarg

Member Function Documentation

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

Definition at line 78 of file SplitCHWResBase.h.

79 {
80  return _mob[_qp] * _grad_phi[_j][_qp] * _grad_test[_i][_qp];
81 }
const MaterialProperty< T > & _mob
template<typename T >
Real SplitCHWResBase< T >::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 85 of file SplitCHWResBase.h.

86 {
87  // get the coupled variable jvar is referring to
88  const unsigned int cvar = mapJvarToCvar(jvar);
89 
90  return (*_dmobdarg[cvar])[_qp] * _phi[_j][_qp] * _grad_u[_qp] * _grad_test[_i][_qp];
91 }
std::vector< const MaterialProperty< T > * > _dmobdarg
template<typename T >
Real SplitCHWResBase< T >::computeQpResidual ( )
protectedvirtual

Definition at line 71 of file SplitCHWResBase.h.

72 {
73  return _mob[_qp] * _grad_u[_qp] * _grad_test[_i][_qp];
74 }
const MaterialProperty< T > & _mob
template<typename T >
InputParameters SplitCHWResBase< T >::validParams ( )
static

Definition at line 59 of file SplitCHWResBase.h.

Referenced by validParams< SplitCHWRes >(), and validParams< SplitCHWResAniso >().

60 {
61  InputParameters params = ::validParams<Kernel>();
62  params.addClassDescription(
63  "Split formulation Cahn-Hilliard Kernel for the chemical potential variable");
64  params.addParam<MaterialPropertyName>("mob_name", "mobtemp", "The mobility used with the kernel");
65  params.addCoupledVar("args", "Vector of arguments of the mobility");
66  return params;
67 }

Member Data Documentation

template<typename T>
std::vector<const MaterialProperty<T> *> SplitCHWResBase< T >::_dmobdarg
private
template<typename T>
const MaterialProperty<T>& SplitCHWResBase< T >::_mob
private
template<typename T>
const MaterialPropertyName SplitCHWResBase< T >::_mob_name
private

Definition at line 34 of file SplitCHWResBase.h.

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


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