www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ACBulk< T > Class Template Referenceabstract

This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equation. More...

#include <ACBulk.h>

Inheritance diagram for ACBulk< T >:
[legend]

Public Member Functions

 ACBulk (const InputParameters &parameters)
 
virtual void initialSetup ()
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Types

enum  PFFunctionType { Jacobian, Residual }
 

Protected Member Functions

virtual Real precomputeQpResidual ()
 
virtual Real precomputeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual Real computeDFDOP (PFFunctionType type)=0
 

Protected Attributes

const MaterialProperty< T > & _L
 Mobility. More...
 
const MaterialProperty< T > & _dLdop
 Mobility derivative w.r.t. order parameter. More...
 
std::vector< const MaterialProperty< T > * > _dLdarg
 Mobility derivative w.r.t coupled variables. More...
 

Detailed Description

template<typename T>
class ACBulk< T >

This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equation.

It is templated on the type of the mobility, which can be either a number (Real) or a tensor (RealValueTensor). Note that the function computeDFDOP MUST be overridden in any kernel that inherits from ACBulk.

Definition at line 22 of file ACBulk.h.

Member Enumeration Documentation

template<typename T>
enum ACBulk::PFFunctionType
protected
Enumerator
Jacobian 
Residual 

Definition at line 35 of file ACBulk.h.

36  {
37  Jacobian,
38  Residual
39  };

Constructor & Destructor Documentation

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

Definition at line 54 of file ACBulk.h.

55  : DerivativeMaterialInterface<JvarMapKernelInterface<KernelValue>>(parameters),
56  _L(getMaterialProperty<T>("mob_name")),
57  _dLdop(getMaterialPropertyDerivative<T>("mob_name", _var.name()))
58 {
59  // Get number of coupled variables
60  unsigned int nvar = _coupled_moose_vars.size();
61 
62  // reserve space for derivatives
63  _dLdarg.resize(nvar);
64 
65  // Iterate over all coupled variables
66  for (unsigned int i = 0; i < nvar; ++i)
67  _dLdarg[i] = &getMaterialPropertyDerivative<T>("mob_name", _coupled_moose_vars[i]->name());
68 }
const MaterialProperty< T > & _L
Mobility.
Definition: ACBulk.h:44
std::vector< const MaterialProperty< T > * > _dLdarg
Mobility derivative w.r.t coupled variables.
Definition: ACBulk.h:50
const MaterialProperty< T > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition: ACBulk.h:47

Member Function Documentation

template<typename T>
virtual Real ACBulk< T >::computeDFDOP ( PFFunctionType  type)
protectedpure virtual
template<typename T >
Real ACBulk< T >::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented in CoupledAllenCahn, AllenCahn, KKSACBulkC, KKSACBulkF, KKSMultiACBulkC, KKSMultiACBulkF, ACGrGrMulti, ACGrGrPoly, and ACGBPoly.

Definition at line 114 of file ACBulk.h.

Referenced by AllenCahn::computeQpOffDiagJacobian(), KKSMultiACBulkF::computeQpOffDiagJacobian(), KKSACBulkC::computeQpOffDiagJacobian(), KKSACBulkF::computeQpOffDiagJacobian(), KKSMultiACBulkC::computeQpOffDiagJacobian(), CoupledAllenCahn::computeQpOffDiagJacobian(), and validParams< ACSwitching >().

115 {
116  // Get the coupled variable jvar is referring to
117  const unsigned int cvar = mapJvarToCvar(jvar);
118 
119  // Set off-diagonal Jacobian term from mobility derivatives
120  return (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * computeDFDOP(Residual) * _test[_i][_qp];
121 }
virtual Real computeDFDOP(PFFunctionType type)=0
std::vector< const MaterialProperty< T > * > _dLdarg
Mobility derivative w.r.t coupled variables.
Definition: ACBulk.h:50
template<typename T >
void ACBulk< T >::initialSetup ( )
virtual

Reimplemented in KKSMultiACBulkBase, CoupledAllenCahn, KKSACBulkBase, and AllenCahn.

Definition at line 83 of file ACBulk.h.

Referenced by AllenCahn::initialSetup(), KKSACBulkBase::initialSetup(), CoupledAllenCahn::initialSetup(), KKSMultiACBulkBase::initialSetup(), and validParams< ACSwitching >().

84 {
85  validateNonlinearCoupling<Real>("mob_name");
86 }
template<typename T >
Real ACBulk< T >::precomputeQpJacobian ( )
protectedvirtual

Definition at line 101 of file ACBulk.h.

102 {
103  // Get free energy derivative and Jacobian
104  Real dFdop = computeDFDOP(Residual);
105 
106  Real JdFdop = computeDFDOP(Jacobian);
107 
108  // Set Jacobian value using product rule
109  return _L[_qp] * JdFdop + _dLdop[_qp] * _phi[_j][_qp] * dFdop;
110 }
const MaterialProperty< T > & _L
Mobility.
Definition: ACBulk.h:44
virtual Real computeDFDOP(PFFunctionType type)=0
const MaterialProperty< T > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition: ACBulk.h:47
template<typename T >
Real ACBulk< T >::precomputeQpResidual ( )
protectedvirtual

Definition at line 90 of file ACBulk.h.

91 {
92  // Get free energy derivative from function
93  Real dFdop = computeDFDOP(Residual);
94 
95  // Set residual
96  return _L[_qp] * dFdop;
97 }
const MaterialProperty< T > & _L
Mobility.
Definition: ACBulk.h:44
virtual Real computeDFDOP(PFFunctionType type)=0
template<typename T >
InputParameters ACBulk< T >::validParams ( )
static

Definition at line 72 of file ACBulk.h.

Referenced by validParams< ACGBPoly >(), validParams< ACGrGrBase >(), validParams< ACGrGrElasticDrivingForce >(), validParams< ACSEDGPoly >(), validParams< ACSwitching >(), validParams< AllenCahn >(), validParams< CoupledAllenCahn >(), validParams< KKSACBulkBase >(), and validParams< KKSMultiACBulkBase >().

73 {
74  InputParameters params = ::validParams<KernelValue>();
75  params.addClassDescription("Allen-Cahn base Kernel");
76  params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
77  params.addCoupledVar("args", "Vector of arguments of the mobility");
78  return params;
79 }

Member Data Documentation

template<typename T>
std::vector<const MaterialProperty<T> *> ACBulk< T >::_dLdarg
protected

Mobility derivative w.r.t coupled variables.

Definition at line 50 of file ACBulk.h.

Referenced by ACBulk< T >::ACBulk(), and ACBulk< T >::computeQpOffDiagJacobian().

template<typename T>
const MaterialProperty<T>& ACBulk< T >::_dLdop
protected

Mobility derivative w.r.t. order parameter.

Definition at line 47 of file ACBulk.h.

Referenced by ACBulk< T >::precomputeQpJacobian().

template<typename T>
const MaterialProperty<T>& ACBulk< T >::_L
protected

Mobility.

Definition at line 44 of file ACBulk.h.

Referenced by ACBulk< T >::precomputeQpJacobian(), and ACBulk< T >::precomputeQpResidual().


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