www.mooseframework.org
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ACKappaFunction Class Reference

#include <ACKappaFunction.h>

Inheritance diagram for ACKappaFunction:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ACKappaFunction (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 
virtual GenericReal< is_ad > computeQpResidual () override
 
GenericReal< is_ad > computeFg ()
 

Protected Attributes

const MaterialProperty< Real > & _dLdvar
 
const MaterialProperty< Real > & _d2kappadvar2
 
JvarMap _v_map
 
std::vector< const MaterialProperty< Real > * > _dLdv
 
std::vector< const MaterialProperty< Real > * > _d2kappadvardv
 
const GenericMaterialProperty< Real, is_ad > & _L
 
const MaterialPropertyName _kappa_name
 
const GenericMaterialProperty< Real, is_ad > & _dkappadvar
 
const unsigned int _v_num
 
std::vector< const GenericVariableGradient< is_ad > *> _grad_v
 

Detailed Description

Definition at line 50 of file ACKappaFunction.h.

Constructor & Destructor Documentation

◆ ACKappaFunction()

ACKappaFunction::ACKappaFunction ( const InputParameters parameters)

Definition at line 40 of file ACKappaFunction.C.

41  : ACKappaFunctionTempl<false>(parameters),
42  _dLdvar(getMaterialPropertyDerivative<Real>("mob_name", _var.name())),
43  _d2kappadvar2(getMaterialPropertyDerivative<Real>(_kappa_name, _var.name(), _var.name())),
44  _v_map(getParameterJvarMap("v")),
45  _dLdv(_v_num),
47 {
48  for (unsigned int i = 0; i < _v_num; ++i)
49  {
50  auto v_name = coupledName("v", i);
51  _dLdv[i] = &getMaterialPropertyDerivative<Real>("mob_name", v_name);
52  _d2kappadvardv[i] = &getMaterialPropertyDerivative<Real>(_kappa_name, _var.name(), v_name);
53  }
54 }
const MaterialProperty< Real > & _dLdvar
std::vector< const MaterialProperty< Real > * > _dLdv
std::vector< const MaterialProperty< Real > * > _d2kappadvardv
const MaterialProperty< Real > & _d2kappadvar2
const MaterialPropertyName _kappa_name

Member Function Documentation

◆ computeFg()

GenericReal< is_ad > ACKappaFunctionTempl< is_ad >::computeFg ( )
protectedinherited

Definition at line 90 of file ACKappaFunction.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

91 {
92  GenericReal<is_ad> sum_grad_etai2 = 0.0;
93  for (unsigned int i = 0; i < _v_num; ++i)
94  sum_grad_etai2 += (*_grad_v[i])[_qp] * (*_grad_v[i])[_qp];
95 
96  return sum_grad_etai2 + _grad_u[_qp] * _grad_u[_qp];
97 }
std::vector< const GenericVariableGradient< is_ad > *> _grad_v
typename Moose::GenericType< Real, is_ad > GenericReal

◆ computeQpJacobian()

Real ACKappaFunction::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 64 of file ACKappaFunction.C.

65 {
66  Real pre_jac = 0.5 * _test[_i][_qp] * _phi[_j][_qp] * computeFg();
67  Real term1 = _test[_i][_qp] * _L[_qp] * _dkappadvar[_qp] * _grad_u[_qp] * _grad_phi[_j][_qp];
68 
69  return pre_jac * (_dLdvar[_qp] * _dkappadvar[_qp] + _L[_qp] * _d2kappadvar2[_qp]) + term1;
70 }
const MaterialProperty< Real > & _dLdvar
GenericReal< is_ad > computeFg()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const GenericMaterialProperty< Real, is_ad > & _L
const MaterialProperty< Real > & _d2kappadvar2
const GenericMaterialProperty< Real, is_ad > & _dkappadvar

◆ computeQpOffDiagJacobian()

Real ACKappaFunction::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 73 of file ACKappaFunction.C.

74 {
75  auto i = mapJvarToCvar(jvar, _v_map);
76  if (i >= 0)
77  {
78  const Real pre_jac = 0.5 * _test[_i][_qp] * _phi[_j][_qp] * computeFg();
79  const Real term1 =
80  _test[_i][_qp] * _L[_qp] * _dkappadvar[_qp] * (*_grad_v[i])[_qp] * _grad_phi[_j][_qp];
81  return pre_jac * ((*_dLdv[i])[_qp] * _dkappadvar[_qp] + _L[_qp] * (*_d2kappadvardv[i])[_qp]) +
82  term1;
83  }
84 
85  return 0.0;
86 }
std::vector< const GenericVariableGradient< is_ad > *> _grad_v
std::vector< const MaterialProperty< Real > * > _dLdv
GenericReal< is_ad > computeFg()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const GenericMaterialProperty< Real, is_ad > & _L
std::vector< const MaterialProperty< Real > * > _d2kappadvardv
const GenericMaterialProperty< Real, is_ad > & _dkappadvar

◆ computeQpResidual()

GenericReal< is_ad > ACKappaFunctionTempl< is_ad >::computeQpResidual ( )
overrideprotectedvirtualinherited

Definition at line 58 of file ACKappaFunction.C.

59 {
60  return 0.5 * _test[_i][_qp] * _L[_qp] * _dkappadvar[_qp] * computeFg();
61 }
GenericReal< is_ad > computeFg()
const GenericMaterialProperty< Real, is_ad > & _L
const GenericMaterialProperty< Real, is_ad > & _dkappadvar

◆ validParams()

InputParameters ACKappaFunctionTempl< is_ad >::validParams ( )
staticinherited

Definition at line 17 of file ACKappaFunction.C.

18 {
20  params.addClassDescription("Gradient energy term for when kappa as a function of the variable");
21  params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
22  params.addParam<MaterialPropertyName>("kappa_name", "kappa_op", "The kappa function name");
23  params.addCoupledVar("v", "Vector of order parameters");
24  return params;
25 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _d2kappadvar2

const MaterialProperty<Real>& ACKappaFunction::_d2kappadvar2
protected

Definition at line 60 of file ACKappaFunction.h.

Referenced by computeQpJacobian().

◆ _d2kappadvardv

std::vector<const MaterialProperty<Real> *> ACKappaFunction::_d2kappadvardv
protected

Definition at line 64 of file ACKappaFunction.h.

Referenced by ACKappaFunction(), and computeQpOffDiagJacobian().

◆ _dkappadvar

const GenericMaterialProperty<Real, is_ad>& ACKappaFunctionTempl< is_ad >::_dkappadvar
protectedinherited

Definition at line 36 of file ACKappaFunction.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ _dLdv

std::vector<const MaterialProperty<Real> *> ACKappaFunction::_dLdv
protected

Definition at line 63 of file ACKappaFunction.h.

Referenced by ACKappaFunction(), and computeQpOffDiagJacobian().

◆ _dLdvar

const MaterialProperty<Real>& ACKappaFunction::_dLdvar
protected

Definition at line 59 of file ACKappaFunction.h.

Referenced by computeQpJacobian().

◆ _grad_v

std::vector<const GenericVariableGradient<is_ad> *> ACKappaFunctionTempl< is_ad >::_grad_v
protectedinherited

Definition at line 39 of file ACKappaFunction.h.

Referenced by computeQpOffDiagJacobian().

◆ _kappa_name

const MaterialPropertyName ACKappaFunctionTempl< is_ad >::_kappa_name
protectedinherited

Definition at line 35 of file ACKappaFunction.h.

Referenced by ACKappaFunction().

◆ _L

const GenericMaterialProperty<Real, is_ad>& ACKappaFunctionTempl< is_ad >::_L
protectedinherited

Definition at line 33 of file ACKappaFunction.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ _v_map

JvarMap ACKappaFunction::_v_map
protected

Definition at line 62 of file ACKappaFunction.h.

Referenced by computeQpOffDiagJacobian().

◆ _v_num

const unsigned int ACKappaFunctionTempl< is_ad >::_v_num
protectedinherited

Definition at line 38 of file ACKappaFunction.h.

Referenced by ACKappaFunction().


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