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

Compute the Allen-Cahn interface term with the weak form residual \( \left( \kappa_i \nabla\eta_i, \nabla (L_i \psi) \right) \). More...

#include <ADACInterface.h>

Inheritance diagram for ADACInterface< compute_stage >:
[legend]

Public Member Functions

 ADACInterface (const InputParameters &parameters)
 

Protected Member Functions

virtual ADReal computeQpResidual ()
 
const ADMaterialProperty (Real) &_prop_L
 Mobility. More...
 
const ADMaterialProperty (Real) &_kappa
 Interfacial parameter. More...
 
const ADMaterialProperty (Real) *_dLdop
 Mobility derivative w.r.t. order parameter. More...
 

Protected Attributes

const MaterialPropertyName & _name_L
 Mobility property name. More...
 
const bool _variable_L
 flag set if L is a function of non-linear variables in args More...
 
const unsigned int _nvar
 number of coupled variables More...
 
std::vector< const ADMaterialProperty(Real) * > _dLdarg
 Mobility derivative w.r.t. other coupled variables. More...
 
std::vector< const ADVariableGradient * > _gradarg
 Gradients for all coupled variables. More...
 
 usingKernelMembers
 

Detailed Description

template<ComputeStage compute_stage>
class ADACInterface< compute_stage >

Compute the Allen-Cahn interface term with the weak form residual \( \left( \kappa_i \nabla\eta_i, \nabla (L_i \psi) \right) \).

Definition at line 17 of file ADACInterface.h.

Constructor & Destructor Documentation

◆ ADACInterface()

template<ComputeStage compute_stage>
ADACInterface< compute_stage >::ADACInterface ( const InputParameters &  parameters)

Definition at line 28 of file ADACInterface.C.

29  : ADKernel<compute_stage>(parameters),
30  _prop_L(adGetADMaterialProperty<Real>("mob_name")),
31  _name_L(adGetParam<MaterialPropertyName>("mob_name")),
32  _kappa(adGetADMaterialProperty<Real>("kappa_name")),
33  _variable_L(adGetParam<bool>("variable_L")),
34  _dLdop(_variable_L
35  ? &adGetADMaterialProperty<Real>(derivativePropertyNameFirst(_name_L, _var.name()))
36  : nullptr),
37  _nvar(Coupleable::_coupled_standard_moose_vars.size()),
38  _dLdarg(_nvar),
40 {
41  // Get mobility and kappa derivatives and coupled variable gradients
42  if (_variable_L)
43  for (unsigned int i = 0; i < _nvar; ++i)
44  {
45  MooseVariable * ivar = _coupled_standard_moose_vars[i];
46  const VariableName iname = ivar->name();
47  if (iname == _var.name())
48  paramError("args",
49  "The kernel variable should not be specified in the coupled `args` parameter.");
50 
51  _dLdarg[i] = &adGetADMaterialProperty<Real>(derivativePropertyNameFirst(_name_L, iname));
52  _gradarg[i] = &(ivar->adGradSln<compute_stage>());
53  }
54 }
const MaterialPropertyName & _name_L
Mobility property name.
Definition: ADACInterface.h:37
std::vector< const ADMaterialProperty(Real) * > _dLdarg
Mobility derivative w.r.t. other coupled variables.
Definition: ADACInterface.h:52
const unsigned int _nvar
number of coupled variables
Definition: ADACInterface.h:49
const bool _variable_L
flag set if L is a function of non-linear variables in args
Definition: ADACInterface.h:43
std::vector< const ADVariableGradient * > _gradarg
Gradients for all coupled variables.
Definition: ADACInterface.h:55

Member Function Documentation

◆ ADMaterialProperty() [1/3]

template<ComputeStage compute_stage>
const ADACInterface< compute_stage >::ADMaterialProperty ( Real  ) &
protected

Mobility.

◆ ADMaterialProperty() [2/3]

template<ComputeStage compute_stage>
const ADACInterface< compute_stage >::ADMaterialProperty ( Real  ) &
protected

Interfacial parameter.

◆ ADMaterialProperty() [3/3]

template<ComputeStage compute_stage>
const ADACInterface< compute_stage >::ADMaterialProperty ( Real  )
protected

Mobility derivative w.r.t. order parameter.

◆ computeQpResidual()

template<ComputeStage compute_stage>
ADReal ADACInterface< compute_stage >::computeQpResidual ( )
protectedvirtual

Definition at line 58 of file ADACInterface.C.

59 {
60  // nabla_Lpsi is the product rule gradient \f$ \nabla (L\psi) \f$
61  ADRealVectorValue nabla_Lpsi = _prop_L[_qp] * _grad_test[_i][_qp];
62 
63  if (_variable_L)
64  {
65  ADRealVectorValue grad_L = _grad_u[_qp] * (*_dLdop)[_qp];
66  for (unsigned int i = 0; i < _nvar; ++i)
67  grad_L += (*_gradarg[i])[_qp] * (*_dLdarg[i])[_qp];
68 
69  nabla_Lpsi += grad_L * _test[_i][_qp];
70  }
71 
72  return _grad_u[_qp] * _kappa[_qp] * nabla_Lpsi;
73 }
std::vector< const ADMaterialProperty(Real) * > _dLdarg
Mobility derivative w.r.t. other coupled variables.
Definition: ADACInterface.h:52
const unsigned int _nvar
number of coupled variables
Definition: ADACInterface.h:49
const bool _variable_L
flag set if L is a function of non-linear variables in args
Definition: ADACInterface.h:43
std::vector< const ADVariableGradient * > _gradarg
Gradients for all coupled variables.
Definition: ADACInterface.h:55

Member Data Documentation

◆ _dLdarg

template<ComputeStage compute_stage>
std::vector<const ADMaterialProperty(Real) *> ADACInterface< compute_stage >::_dLdarg
protected

Mobility derivative w.r.t. other coupled variables.

Definition at line 52 of file ADACInterface.h.

Referenced by ADACInterface< compute_stage >::ADACInterface().

◆ _gradarg

template<ComputeStage compute_stage>
std::vector<const ADVariableGradient *> ADACInterface< compute_stage >::_gradarg
protected

Gradients for all coupled variables.

Definition at line 55 of file ADACInterface.h.

Referenced by ADACInterface< compute_stage >::ADACInterface().

◆ _name_L

template<ComputeStage compute_stage>
const MaterialPropertyName& ADACInterface< compute_stage >::_name_L
protected

Mobility property name.

Definition at line 37 of file ADACInterface.h.

Referenced by ADACInterface< compute_stage >::ADACInterface().

◆ _nvar

template<ComputeStage compute_stage>
const unsigned int ADACInterface< compute_stage >::_nvar
protected

number of coupled variables

Definition at line 49 of file ADACInterface.h.

Referenced by ADACInterface< compute_stage >::ADACInterface().

◆ _variable_L

template<ComputeStage compute_stage>
const bool ADACInterface< compute_stage >::_variable_L
protected

flag set if L is a function of non-linear variables in args

Definition at line 43 of file ADACInterface.h.

Referenced by ADACInterface< compute_stage >::ADACInterface().

◆ usingKernelMembers

template<ComputeStage compute_stage>
ADACInterface< compute_stage >::usingKernelMembers
protected

Definition at line 57 of file ADACInterface.h.


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