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

SplitCHWRes creates the residual of the Cahn-Hilliard equation with a scalar (isotropic) mobility. More...

#include <CahnHilliardAniso.h>

Inheritance diagram for CahnHilliardAniso:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 CahnHilliardAniso (const InputParameters &parameters)
 
virtual void initialSetup ()
 
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 Types

typedef CHBulk< RealTensorValue >::PFFunctionType PFFunctionType
 

Protected Member Functions

virtual RealGradient computeGradDFDCons (PFFunctionType type)
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual RealGradient precomputeQpResidual ()
 
virtual RealGradient precomputeQpJacobian ()
 

Protected Attributes

const MaterialProperty< RealTensorValue > & _M
 Mobility. More...
 
const MaterialProperty< RealTensorValue > & _dMdc
 Mobility derivative w.r.t. concentration. More...
 
std::vector< const MaterialProperty< RealTensorValue > *> _dMdarg
 Mobility derivative w.r.t coupled variables. More...
 

Detailed Description

SplitCHWRes creates the residual of the Cahn-Hilliard equation with a scalar (isotropic) mobility.

Definition at line 18 of file CahnHilliardAniso.h.

Member Typedef Documentation

◆ PFFunctionType

Definition at line 29 of file CahnHilliardBase.h.

Constructor & Destructor Documentation

◆ CahnHilliardAniso()

CahnHilliardAniso::CahnHilliardAniso ( const InputParameters parameters)

Definition at line 23 of file CahnHilliardAniso.C.

Member Function Documentation

◆ computeGradDFDCons()

RealGradient CahnHilliardBase< RealTensorValue >::computeGradDFDCons ( PFFunctionType  type)
protectedvirtualinherited

Implements CHBulk< RealTensorValue >.

Definition at line 133 of file CahnHilliardBase.h.

134 {
135  RealGradient res = 0.0;
136 
137  switch (type)
138  {
139  case CHBulk<T>::Residual:
140  for (unsigned int i = 0; i <= _nvar; ++i)
141  res += (*_grad_vars[i])[_qp] * (*_second_derivatives[i])[_qp];
142  return res;
143 
144  case CHBulk<T>::Jacobian:
145  res = _grad_phi[_j][_qp] * (*_second_derivatives[0])[_qp];
146  for (unsigned int i = 0; i <= _nvar; ++i)
147  res += _phi[_j][_qp] * (*_grad_vars[i])[_qp] * (*_third_derivatives[i])[_qp];
148  return res;
149  }
150 
151  mooseError("Internal error");
152 }
void mooseError(Args &&... args)
This is the Cahn-Hilliard equation base class that implements the bulk or local energy term of the eq...
Definition: CHBulk.h:25
std::vector< const MaterialProperty< Real > *> _second_derivatives
std::vector< const VariableGradient *> _grad_vars
std::vector< const MaterialProperty< Real > *> _third_derivatives

◆ computeQpOffDiagJacobian()

Real CahnHilliardBase< RealTensorValue >::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtualinherited

Reimplemented from CHBulk< RealTensorValue >.

Definition at line 156 of file CahnHilliardBase.h.

157 {
158  // get the coupled variable jvar is referring to
159  const unsigned int cvar = this->mapJvarToCvar(jvar);
160 
161  RealGradient J = _grad_u[_qp] * _phi[_j][_qp] * (*_third_derivatives[cvar + 1])[_qp] +
162  _grad_phi[_j][_qp] * (*_second_derivatives[cvar + 1])[_qp];
163 
164  for (unsigned int i = 0; i < _nvar; ++i)
165  J += _phi[_j][_qp] * (*_grad_vars[i + 1])[_qp] * (*_third_cross_derivatives[i][cvar])[_qp];
166 
167  return CHBulk<T>::computeQpOffDiagJacobian(jvar) + _M[_qp] * _grad_test[_i][_qp] * J;
168 }
const MaterialProperty< RealTensorValue > & _M
Mobility.
Definition: CHBulk.h:47
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: CHBulk.h:111
std::vector< const MaterialProperty< Real > *> _second_derivatives
std::vector< const VariableGradient *> _grad_vars
std::vector< const MaterialProperty< Real > *> _third_derivatives
std::vector< std::vector< const MaterialProperty< Real > *> > _third_cross_derivatives

◆ initialSetup()

void CahnHilliardBase< RealTensorValue >::initialSetup ( )
virtualinherited

Check if both the non-linear as well as the auxiliary variables variables are coupled. Derivatives with respect to both types of variables contribute the residual.

Reimplemented from CHBulk< RealTensorValue >.

Definition at line 120 of file CahnHilliardBase.h.

121 {
127  this->template validateCoupling<Real>("f_name", _var.name());
128  this->template validateDerivativeMaterialPropertyBase<Real>("f_name");
129 }

◆ precomputeQpJacobian()

RealGradient CHBulk< RealTensorValue >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 101 of file CHBulk.h.

102 {
103  RealGradient grad_value = _M[_qp] * computeGradDFDCons(Jacobian) +
104  _dMdc[_qp] * _phi[_j][_qp] * computeGradDFDCons(Residual);
105 
106  return grad_value;
107 }
virtual RealGradient computeGradDFDCons(PFFunctionType type)=0
const MaterialProperty< RealTensorValue > & _M
Mobility.
Definition: CHBulk.h:47
const MaterialProperty< RealTensorValue > & _dMdc
Mobility derivative w.r.t. concentration.
Definition: CHBulk.h:50

◆ precomputeQpResidual()

RealGradient CHBulk< RealTensorValue >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 94 of file CHBulk.h.

95 {
96  return _M[_qp] * computeGradDFDCons(Residual);
97 }
virtual RealGradient computeGradDFDCons(PFFunctionType type)=0
const MaterialProperty< RealTensorValue > & _M
Mobility.
Definition: CHBulk.h:47

◆ validParams()

InputParameters CahnHilliardAniso::validParams ( )
static

Definition at line 15 of file CahnHilliardAniso.C.

16 {
18  params.addClassDescription("Cahn-Hilliard Kernel that uses a DerivativeMaterial Free Energy and "
19  "a tensor (anisotropic) mobility");
20  return params;
21 }
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _dMdarg

std::vector<const MaterialProperty<RealTensorValue > *> CHBulk< RealTensorValue >::_dMdarg
protectedinherited

Mobility derivative w.r.t coupled variables.

Definition at line 53 of file CHBulk.h.

◆ _dMdc

const MaterialProperty<RealTensorValue >& CHBulk< RealTensorValue >::_dMdc
protectedinherited

Mobility derivative w.r.t. concentration.

Definition at line 50 of file CHBulk.h.

◆ _M

const MaterialProperty<RealTensorValue >& CHBulk< RealTensorValue >::_M
protectedinherited

Mobility.

Definition at line 47 of file CHBulk.h.


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