https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CoupledSwitchingTimeDerivative Class Reference

#include <CoupledSwitchingTimeDerivative.h>

Inheritance diagram for CoupledSwitchingTimeDerivative:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 CoupledSwitchingTimeDerivative (const InputParameters &parameters)
 
virtual void initialSetup () override
 
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 computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 

Protected Attributes

std::vector< const MaterialProperty< Real > * > _prop_dFjdv
 Derivatives of the functions wrt the nonlinear variable for this kernel. More...
 
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFjdarg
 Derivatives of the functions (needed for off-diagonal Jacobians) More...
 
std::vector< const MaterialProperty< Real > * > _prop_d2hjdetai2
 Second derivatives of the switching functions wrt the order parameter for this kernel. More...
 
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_d2hjdetaidarg
 Second derivatives of the switching functions (needed for off-diagonal Jacobians) More...
 
const VariableName _v_name
 name of order parameter that derivatives are taken wrt (needed to retrieve the derivative material properties) More...
 
std::vector< MaterialPropertyName > _Fj_names
 Names of functions for each phase \( F_j \). More...
 
const unsigned int _num_j
 Number of phases. More...
 
std::vector< const GenericMaterialProperty< Real, is_ad > *> _prop_Fj
 Values of the functions for each phase \( F_j \). More...
 
std::vector< MaterialPropertyName > _hj_names
 switching function names More...
 
std::vector< const GenericMaterialProperty< Real, is_ad > *> _prop_dhjdetai
 Derivatives of the switching functions wrt the order parameter for this kernel. More...
 

Detailed Description

Definition at line 68 of file CoupledSwitchingTimeDerivative.h.

Constructor & Destructor Documentation

◆ CoupledSwitchingTimeDerivative()

CoupledSwitchingTimeDerivative::CoupledSwitchingTimeDerivative ( const InputParameters parameters)

Definition at line 59 of file CoupledSwitchingTimeDerivative.C.

65 {
66  // reserve space and set phase material properties
67  for (unsigned int n = 0; n < _num_j; ++n)
68  {
69  // get phase free energy and derivatives
70  _prop_dFjdv[n] = &getMaterialPropertyDerivative<Real>(_Fj_names[n], _var.name());
71  _prop_dFjdarg[n].resize(_n_args);
72 
73  // get switching function and derivatives wrt eta_i, the nonlinear variable
74  _prop_d2hjdetai2[n] = &getMaterialPropertyDerivative<Real>(_hj_names[n], _v_name, _v_name);
75  _prop_d2hjdetaidarg[n].resize(_n_args);
76 
77  for (unsigned int i = 0; i < _n_args; ++i)
78  {
79  // Get derivatives of all Fj wrt all coupled variables
80  _prop_dFjdarg[n][i] = &getMaterialPropertyDerivative<Real>(_Fj_names[n], i);
81 
82  // Get second derivatives of all hj wrt eta_i and all coupled variables
83  _prop_d2hjdetaidarg[n][i] = &getMaterialPropertyDerivative<Real>(_hj_names[n], _v_name, i);
84  }
85  }
86 }
std::vector< MaterialPropertyName > _hj_names
switching function names
std::vector< MaterialPropertyName > _Fj_names
Names of functions for each phase .
std::vector< const MaterialProperty< Real > * > _prop_dFjdv
Derivatives of the functions wrt the nonlinear variable for this kernel.
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_d2hjdetaidarg
Second derivatives of the switching functions (needed for off-diagonal Jacobians) ...
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFjdarg
Derivatives of the functions (needed for off-diagonal Jacobians)
const VariableName _v_name
name of order parameter that derivatives are taken wrt (needed to retrieve the derivative material pr...
std::vector< const MaterialProperty< Real > * > _prop_d2hjdetai2
Second derivatives of the switching functions wrt the order parameter for this kernel.

Member Function Documentation

◆ computeQpJacobian()

Real CoupledSwitchingTimeDerivative::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 125 of file CoupledSwitchingTimeDerivative.C.

126 {
127  Real sum = 0.0;
128  for (unsigned int n = 0; n < _num_j; ++n)
129  sum += (*_prop_dhjdetai[n])[_qp] * (*_prop_dFjdv[n])[_qp];
130 
131  return CoupledTimeDerivative::computeQpResidual() * sum * _phi[_j][_qp];
132 }
std::vector< const GenericMaterialProperty< Real, is_ad > *> _prop_dhjdetai
Derivatives of the switching functions wrt the order parameter for this kernel.
std::vector< const MaterialProperty< Real > * > _prop_dFjdv
Derivatives of the functions wrt the nonlinear variable for this kernel.
virtual Real computeQpResidual() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ computeQpOffDiagJacobian()

Real CoupledSwitchingTimeDerivative::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 135 of file CoupledSwitchingTimeDerivative.C.

136 {
137  // get the coupled variable jvar is referring to
138  const unsigned int cvar = mapJvarToCvar(jvar);
139 
140  if (jvar == _v_var)
141  {
142  Real sum = 0.0;
143 
144  for (unsigned int n = 0; n < _num_j; ++n)
145  sum +=
146  ((*_prop_d2hjdetai2[n])[_qp] * _v_dot[_qp] + (*_prop_dhjdetai[n])[_qp] * _dv_dot[_qp]) *
147  (*_prop_Fj[n])[_qp];
148 
149  return _phi[_j][_qp] * sum * _test[_i][_qp];
150  }
151 
152  Real sum = 0.0;
153  for (unsigned int n = 0; n < _num_j; ++n)
154  sum += (*_prop_d2hjdetaidarg[n][cvar])[_qp] * (*_prop_Fj[n])[_qp] +
155  (*_prop_dhjdetai[n])[_qp] * (*_prop_dFjdarg[n][cvar])[_qp];
156 
157  return CoupledTimeDerivative::computeQpResidual() * sum * _phi[_j][_qp];
158 }
std::vector< const GenericMaterialProperty< Real, is_ad > *> _prop_dhjdetai
Derivatives of the switching functions wrt the order parameter for this kernel.
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_d2hjdetaidarg
Second derivatives of the switching functions (needed for off-diagonal Jacobians) ...
virtual Real computeQpResidual() override
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFjdarg
Derivatives of the functions (needed for off-diagonal Jacobians)
std::vector< const GenericMaterialProperty< Real, is_ad > *> _prop_Fj
Values of the functions for each phase .
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< const MaterialProperty< Real > * > _prop_d2hjdetai2
Second derivatives of the switching functions wrt the order parameter for this kernel.

◆ computeQpResidual()

Real CoupledSwitchingTimeDerivative::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 105 of file CoupledSwitchingTimeDerivative.C.

106 {
107  Real sum = 0.0;
108  for (unsigned int n = 0; n < _num_j; ++n)
109  sum += (*_prop_dhjdetai[n])[_qp] * (*_prop_Fj[n])[_qp];
110 
112 }
std::vector< const GenericMaterialProperty< Real, is_ad > *> _prop_dhjdetai
Derivatives of the switching functions wrt the order parameter for this kernel.
virtual Real computeQpResidual() override
std::vector< const GenericMaterialProperty< Real, is_ad > *> _prop_Fj
Values of the functions for each phase .
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ initialSetup()

void CoupledSwitchingTimeDerivative::initialSetup ( )
overridevirtual

Reimplemented from CoupledSwitchingTimeDerivativeTempl< false >.

Definition at line 97 of file CoupledSwitchingTimeDerivative.C.

98 {
100  for (unsigned int n = 0; n < _num_j; ++n)
101  validateNonlinearCoupling<Real>(_Fj_names[n]);
102 }
std::vector< MaterialPropertyName > _Fj_names
Names of functions for each phase .

◆ validParams()

InputParameters CoupledSwitchingTimeDerivativeTempl< is_ad >::validParams ( )
staticinherited

Definition at line 17 of file CoupledSwitchingTimeDerivative.C.

18 {
20  params.addClassDescription(
21  "Coupled time derivative Kernel that multiplies the time derivative by "
22  "$\\frac{dh_\\alpha}{d\\eta_i} F_\\alpha + \\frac{dh_\\beta}{d\\eta_i} F_\\beta + \\dots$");
23  params.addRequiredParam<std::vector<MaterialPropertyName>>(
24  "Fj_names", "List of functions for each phase. Place in same order as hj_names!");
25  params.addRequiredParam<std::vector<MaterialPropertyName>>(
26  "hj_names", "Switching Function Materials that provide h. Place in same order as Fj_names!");
27  params.addCoupledVar("args", "Vector of variable arguments of Fj and hj");
28  params.deprecateCoupledVar("args", "coupled_variables", "02/27/2024");
29  return params;
30 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters validParams()
void deprecateCoupledVar(const std::string &old_name, const std::string &new_name, const std::string &removal_date)
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _Fj_names

std::vector<MaterialPropertyName> CoupledSwitchingTimeDerivativeTempl< is_ad >::_Fj_names
protectedinherited

Names of functions for each phase \( F_j \).

Definition at line 51 of file CoupledSwitchingTimeDerivative.h.

Referenced by CoupledSwitchingTimeDerivative(), and initialSetup().

◆ _hj_names

std::vector<MaterialPropertyName> CoupledSwitchingTimeDerivativeTempl< is_ad >::_hj_names
protectedinherited

switching function names

Definition at line 60 of file CoupledSwitchingTimeDerivative.h.

Referenced by CoupledSwitchingTimeDerivative().

◆ _num_j

const unsigned int CoupledSwitchingTimeDerivativeTempl< is_ad >::_num_j
protectedinherited

◆ _prop_d2hjdetai2

std::vector<const MaterialProperty<Real> *> CoupledSwitchingTimeDerivative::_prop_d2hjdetai2
protected

Second derivatives of the switching functions wrt the order parameter for this kernel.

Definition at line 85 of file CoupledSwitchingTimeDerivative.h.

Referenced by computeQpOffDiagJacobian(), and CoupledSwitchingTimeDerivative().

◆ _prop_d2hjdetaidarg

std::vector<std::vector<const MaterialProperty<Real> *> > CoupledSwitchingTimeDerivative::_prop_d2hjdetaidarg
protected

Second derivatives of the switching functions (needed for off-diagonal Jacobians)

Definition at line 88 of file CoupledSwitchingTimeDerivative.h.

Referenced by computeQpOffDiagJacobian(), and CoupledSwitchingTimeDerivative().

◆ _prop_dFjdarg

std::vector<std::vector<const MaterialProperty<Real> *> > CoupledSwitchingTimeDerivative::_prop_dFjdarg
protected

Derivatives of the functions (needed for off-diagonal Jacobians)

Definition at line 82 of file CoupledSwitchingTimeDerivative.h.

Referenced by computeQpOffDiagJacobian(), and CoupledSwitchingTimeDerivative().

◆ _prop_dFjdv

std::vector<const MaterialProperty<Real> *> CoupledSwitchingTimeDerivative::_prop_dFjdv
protected

Derivatives of the functions wrt the nonlinear variable for this kernel.

Definition at line 79 of file CoupledSwitchingTimeDerivative.h.

Referenced by computeQpJacobian(), and CoupledSwitchingTimeDerivative().

◆ _prop_dhjdetai

std::vector<const GenericMaterialProperty<Real, is_ad> *> CoupledSwitchingTimeDerivativeTempl< is_ad >::_prop_dhjdetai
protectedinherited

Derivatives of the switching functions wrt the order parameter for this kernel.

Definition at line 63 of file CoupledSwitchingTimeDerivative.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _prop_Fj

std::vector<const GenericMaterialProperty<Real, is_ad> *> CoupledSwitchingTimeDerivativeTempl< is_ad >::_prop_Fj
protectedinherited

Values of the functions for each phase \( F_j \).

Definition at line 57 of file CoupledSwitchingTimeDerivative.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _v_name

const VariableName CoupledSwitchingTimeDerivativeTempl< is_ad >::_v_name
protectedinherited

name of order parameter that derivatives are taken wrt (needed to retrieve the derivative material properties)

Definition at line 48 of file CoupledSwitchingTimeDerivative.h.

Referenced by CoupledSwitchingTimeDerivative().


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