https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ACSEDGPoly Class Referenceabstract

#include <ACSEDGPoly.h>

Inheritance diagram for ACSEDGPoly:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ACSEDGPoly (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

enum  PFFunctionType
 

Protected Member Functions

virtual Real computeDFDOP (PFFunctionType type)
 
virtual Real precomputeQpResidual ()
 
virtual Real precomputeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual Real computeDFDOP (PFFunctionType type)=0
 

Protected Attributes

const unsigned int _op_num
 
const std::vector< const VariableValue * > _vals
 
const std::vector< unsigned int_vals_var
 
const MaterialProperty< Real > & _beta
 the prefactor needed to calculate the deformation energy from dislocation density
 
const MaterialProperty< Real > & _rho_eff
 the average/effective dislocation density
 
const MaterialProperty< Real > & _Disloc_Den_i
 dislocation density in grain i
 
unsigned int _deformed_grain_num
 number of deformed grains
 
const GrainTrackerInterface_grain_tracker
 Grain tracker object.
 
unsigned int _op_index
 index of the OP the kernel is currently acting on
 
const MaterialProperty< Real > & _L
 Mobility.
 
const MaterialProperty< Real > & _dLdop
 Mobility derivative w.r.t. order parameter.
 
std::vector< const MaterialProperty< Real > * > _dLdarg
 Mobility derivative w.r.t coupled variables.
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 

Detailed Description

Definition at line 27 of file ACSEDGPoly.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 37 of file ACBulk.h.

38 {
41 };

Constructor & Destructor Documentation

◆ ACSEDGPoly()

ACSEDGPoly::ACSEDGPoly ( const InputParameters parameters)

Definition at line 30 of file ACSEDGPoly.C.

31 : ACBulk<Real>(parameters),
32 _op_num(coupledComponents("v")),
33 _vals(coupledValues("v")),
34 _vals_var(coupledIndices("v")),
35 _beta(getMaterialProperty<Real>("beta")),
36 _rho_eff(getMaterialProperty<Real>("rho_eff")),
37 _Disloc_Den_i(getMaterialProperty<Real>("Disloc_Den_i")),
38 _deformed_grain_num(getParam<unsigned int>("deformed_grain_num")),
39 _grain_tracker(getUserObject<GrainTrackerInterface>("grain_tracker")),
40 _op_index(getParam<unsigned int>("op_index"))
41{
42}
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition ACBulk.h:25
unsigned int _deformed_grain_num
number of deformed grains
Definition ACSEDGPoly.h:52
const std::vector< unsigned int > _vals_var
Definition ACSEDGPoly.h:40
const MaterialProperty< Real > & _Disloc_Den_i
dislocation density in grain i
Definition ACSEDGPoly.h:49
const unsigned int _op_num
Definition ACSEDGPoly.h:37
const GrainTrackerInterface & _grain_tracker
Grain tracker object.
Definition ACSEDGPoly.h:55
const MaterialProperty< Real > & _beta
the prefactor needed to calculate the deformation energy from dislocation density
Definition ACSEDGPoly.h:43
const std::vector< const VariableValue * > _vals
Definition ACSEDGPoly.h:39
unsigned int _op_index
index of the OP the kernel is currently acting on
Definition ACSEDGPoly.h:58
const MaterialProperty< Real > & _rho_eff
the average/effective dislocation density
Definition ACSEDGPoly.h:46

Member Function Documentation

◆ computeDFDOP() [1/2]

Real ACSEDGPoly::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Definition at line 45 of file ACSEDGPoly.C.

46{
47 Real SumEtaj = 0.0;
48 for (unsigned int i = 0; i < _op_num; ++i)
49 SumEtaj += (*_vals[i])[_qp] * (*_vals[i])[_qp];
50
51 // Add the current OP to the sum
52 Real SumEtai2 = SumEtaj + _u[_qp] * _u[_qp];
53 // Dislocation density in deformed grains
54 Real rho_i = _Disloc_Den_i[_qp];
55 // undeformed grains are dislocation-free
56 const auto & op_to_grain = _grain_tracker.getVarToFeatureVector(_current_elem->id());
57 const auto grn_index = op_to_grain[_op_index];
58 if (grn_index >= _deformed_grain_num)
59 rho_i = 0.0;
60
61 // Calculate the contributions of the deformation energy to the residual and Jacobian
62 Real drho_eff_detai = 2.0 * _u[_qp] * (rho_i - _rho_eff[_qp]) / SumEtai2;
63
64 // Calculate the Stored Energy contribution to either the residual or Jacobian of the grain growth
65 // free energy
66 switch (type)
67 {
68 case Residual:
69 return _beta[_qp] * drho_eff_detai;
70
71 case Jacobian:
72 return _beta[_qp] * _phi[_j][_qp] *
73 (2.0 * SumEtai2 * ((rho_i - _rho_eff[_qp]) - _u[_qp] * drho_eff_detai) -
74 4.0 * _u[_qp] * _u[_qp] * (rho_i - _rho_eff[_qp])) /
75 (SumEtai2 * SumEtai2);
76 }
77 mooseError("Invalid type passed in");
78}
void mooseError(Args &&... args)
virtual const std::vector< unsigned int > & getVarToFeatureVector(dof_id_type elem_id) const =0
Returns a list of active unique feature ids for a particular element.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ computeDFDOP() [2/2]

virtual Real ACBulk< Real >::computeDFDOP ( PFFunctionType  type)
protectedpure virtualinherited

◆ computeQpOffDiagJacobian()

Real ACBulk< Real >::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtualinherited

Reimplemented in ACGBPoly, ACGrGrPoly, ACGrGrPolyLinearizedInterface, AllenCahn, CoupledAllenCahn, KKSACBulkC, KKSACBulkF, KKSMultiACBulkC, KKSMultiACBulkF, NestedKKSACBulkC, NestedKKSACBulkF, NestedKKSMultiACBulkC, and NestedKKSMultiACBulkF.

Definition at line 35 of file ACBulk.h.

111{
112 // Get the coupled variable jvar is referring to
113 const unsigned int cvar = mapJvarToCvar(jvar);
114
115 // Set off-diagonal Jacobian term from mobility derivatives
116 return (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * computeDFDOP(Residual) * _test[_i][_qp];
117}
virtual Real computeDFDOP(PFFunctionType type)=0
std::vector< const MaterialProperty< Real > * > _dLdarg
Mobility derivative w.r.t coupled variables.
Definition ACBulk.h:52

◆ initialSetup()

void ACBulk< Real >::initialSetup ( )
virtualinherited

Reimplemented in AllenCahn, CoupledAllenCahn, KKSACBulkBase, and KKSMultiACBulkBase.

Definition at line 30 of file ACBulk.h.

80{
81 validateNonlinearCoupling<Real>("mob_name");
82}

◆ precomputeQpJacobian()

Real ACBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 34 of file ACBulk.h.

98{
99 // Get free energy derivative and Jacobian
100 Real dFdop = computeDFDOP(Residual);
101
102 Real JdFdop = computeDFDOP(Jacobian);
103
104 // Set Jacobian value using product rule
105 return _L[_qp] * JdFdop + _dLdop[_qp] * _phi[_j][_qp] * dFdop;
106}
const MaterialProperty< Real > & _L
Mobility.
Definition ACBulk.h:46
const MaterialProperty< Real > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition ACBulk.h:49

◆ precomputeQpResidual()

Real ACBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 33 of file ACBulk.h.

87{
88 // Get free energy derivative from function
89 Real dFdop = computeDFDOP(Residual);
90
91 // Set residual
92 return _L[_qp] * dFdop;
93}

◆ validParams()

InputParameters ACSEDGPoly::validParams ( )
static

Definition at line 17 of file ACSEDGPoly.C.

18{
20 params.addClassDescription("Stored Energy contribution to grain growth");
21 params.addRequiredCoupledVar("v", "Array of coupled variable names");
22 params.addRequiredParam<unsigned int>("deformed_grain_num",
23 "Number of OP representing deformed grains");
24 params.addRequiredParam<UserObjectName>("grain_tracker",
25 "The GrainTracker UserObject to get values from.");
26 params.addRequiredParam<unsigned int>("op_index", "The index for the current order parameter");
27 return params;
28}
static InputParameters validParams()
Definition ACBulk.h:69
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _beta

const MaterialProperty<Real>& ACSEDGPoly::_beta
protected

the prefactor needed to calculate the deformation energy from dislocation density

Definition at line 43 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _deformed_grain_num

unsigned int ACSEDGPoly::_deformed_grain_num
protected

number of deformed grains

Definition at line 52 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _Disloc_Den_i

const MaterialProperty<Real>& ACSEDGPoly::_Disloc_Den_i
protected

dislocation density in grain i

Definition at line 49 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _dLdarg

std::vector<const MaterialProperty<Real > *> ACBulk< Real >::_dLdarg
protectedinherited

Mobility derivative w.r.t coupled variables.

Definition at line 52 of file ACBulk.h.

◆ _dLdop

const MaterialProperty<Real >& ACBulk< Real >::_dLdop
protectedinherited

Mobility derivative w.r.t. order parameter.

Definition at line 49 of file ACBulk.h.

◆ _grain_tracker

const GrainTrackerInterface& ACSEDGPoly::_grain_tracker
protected

Grain tracker object.

Definition at line 55 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _L

const MaterialProperty<Real >& ACBulk< Real >::_L
protectedinherited

Mobility.

Definition at line 46 of file ACBulk.h.

◆ _op_index

unsigned int ACSEDGPoly::_op_index
protected

index of the OP the kernel is currently acting on

Definition at line 58 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _op_num

const unsigned int ACSEDGPoly::_op_num
protected

Definition at line 37 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _rho_eff

const MaterialProperty<Real>& ACSEDGPoly::_rho_eff
protected

the average/effective dislocation density

Definition at line 46 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _vals

const std::vector<const VariableValue *> ACSEDGPoly::_vals
protected

Definition at line 39 of file ACSEDGPoly.h.

Referenced by computeDFDOP().

◆ _vals_var

const std::vector<unsigned int> ACSEDGPoly::_vals_var
protected

Definition at line 40 of file ACSEDGPoly.h.


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