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 24 of file ACBulk.h.

Member Enumeration Documentation

◆ PFFunctionType

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

Definition at line 37 of file ACBulk.h.

38  {
39  Jacobian,
40  Residual
41  };

Constructor & Destructor Documentation

◆ ACBulk()

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

Definition at line 56 of file ACBulk.h.

57  : DerivativeMaterialInterface<JvarMapKernelInterface<KernelValue>>(parameters),
58  _L(getMaterialProperty<T>("mob_name")),
59  _dLdop(getMaterialPropertyDerivative<T>("mob_name", _var.name()))
60 {
61  // Get number of coupled variables
62  unsigned int nvar = _coupled_moose_vars.size();
63 
64  // reserve space for derivatives
65  _dLdarg.resize(nvar);
66 
67  // Iterate over all coupled variables
68  for (unsigned int i = 0; i < nvar; ++i)
69  _dLdarg[i] = &getMaterialPropertyDerivative<T>("mob_name", _coupled_moose_vars[i]->name());
70 }

Member Function Documentation

◆ computeDFDOP()

template<typename T>
virtual Real ACBulk< T >::computeDFDOP ( PFFunctionType  type)
protectedpure virtual

◆ computeQpOffDiagJacobian()

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

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

Definition at line 116 of file ACBulk.h.

117 {
118  // Get the coupled variable jvar is referring to
119  const unsigned int cvar = mapJvarToCvar(jvar);
120 
121  // Set off-diagonal Jacobian term from mobility derivatives
122  return (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * computeDFDOP(Residual) * _test[_i][_qp];
123 }

Referenced by AllenCahn::computeQpOffDiagJacobian(), KKSMultiACBulkF::computeQpOffDiagJacobian(), KKSMultiACBulkC::computeQpOffDiagJacobian(), KKSACBulkF::computeQpOffDiagJacobian(), KKSACBulkC::computeQpOffDiagJacobian(), and CoupledAllenCahn::computeQpOffDiagJacobian().

◆ initialSetup()

template<typename T >
void ACBulk< T >::initialSetup ( )
virtual

Reimplemented in KKSMultiACBulkBase, CoupledAllenCahn, KKSACBulkBase, and AllenCahn.

Definition at line 85 of file ACBulk.h.

86 {
87  validateNonlinearCoupling<Real>("mob_name");
88 }

Referenced by AllenCahn::initialSetup(), CoupledAllenCahn::initialSetup(), KKSACBulkBase::initialSetup(), and KKSMultiACBulkBase::initialSetup().

◆ precomputeQpJacobian()

template<typename T >
Real ACBulk< T >::precomputeQpJacobian ( )
protectedvirtual

Definition at line 103 of file ACBulk.h.

104 {
105  // Get free energy derivative and Jacobian
106  Real dFdop = computeDFDOP(Residual);
107 
108  Real JdFdop = computeDFDOP(Jacobian);
109 
110  // Set Jacobian value using product rule
111  return _L[_qp] * JdFdop + _dLdop[_qp] * _phi[_j][_qp] * dFdop;
112 }

◆ precomputeQpResidual()

template<typename T >
Real ACBulk< T >::precomputeQpResidual ( )
protectedvirtual

Definition at line 92 of file ACBulk.h.

93 {
94  // Get free energy derivative from function
95  Real dFdop = computeDFDOP(Residual);
96 
97  // Set residual
98  return _L[_qp] * dFdop;
99 }

◆ validParams()

template<typename T >
InputParameters ACBulk< T >::validParams ( )
static

Definition at line 74 of file ACBulk.h.

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

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

Member Data Documentation

◆ _dLdarg

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

Mobility derivative w.r.t coupled variables.

Definition at line 52 of file ACBulk.h.

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

◆ _dLdop

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

Mobility derivative w.r.t. order parameter.

Definition at line 49 of file ACBulk.h.

◆ _L

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

Mobility.

Definition at line 46 of file ACBulk.h.


The documentation for this class was generated from the following file:
ACBulk::Residual
Definition: ACBulk.h:40
ACBulk::_dLdarg
std::vector< const MaterialProperty< T > * > _dLdarg
Mobility derivative w.r.t coupled variables.
Definition: ACBulk.h:52
ACBulk::_dLdop
const MaterialProperty< T > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition: ACBulk.h:49
ACBulk::computeDFDOP
virtual Real computeDFDOP(PFFunctionType type)=0
name
const std::string name
Definition: Setup.h:21
ACBulk::Jacobian
Definition: ACBulk.h:39
ACBulk::_L
const MaterialProperty< T > & _L
Mobility.
Definition: ACBulk.h:46