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

ComputeElasticityTensorCP defines an elasticity tensor material object for crystal plasticity models. More...

#include <ComputeElasticityTensorCP.h>

Inheritance diagram for ComputeElasticityTensorCP:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ComputeElasticityTensorCP (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
 
bool hasGuarantee (const MaterialPropertyName &prop_name, Guarantee guarantee)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void computeQpElasticityTensor () override
 Defines the constant rotation matrix from the user specified Bunge Euler Angles or user-supplied rotation matrix.
 
virtual void assignEulerAngles ()
 
virtual void computeQpProperties ()
 
void issueGuarantee (const MaterialPropertyName &prop_name, Guarantee guarantee)
 
void revokeGuarantee (const MaterialPropertyName &prop_name, Guarantee guarantee)
 

Protected Attributes

const PropertyReadFile *const _read_prop_user_object
 Element property read user object used to read in Euler angles.
 
MaterialProperty< RealVectorValue > & _Euler_angles_mat_prop
 Material property that stores the values of the Euler Angles for postprocessing.
 
MaterialProperty< RankTwoTensor > & _crysrot
 Crystal Rotation Matrix used to rotate the slip system direction and normal.
 
RotationTensor _R
 Rotation matrix.
 
bool _user_provided_rotation_matrix
 flag for user-defined rotation matrix, supplied in input file
 
unsigned int _n_euler_angle_vars
 
const std::vector< const VariableValue * > _euler_angle_vars
 
RankFourTensor _Cijkl
 Individual material information.
 
RealVectorValue _Euler_angles
 
const RealTensorValue _rotation_matrix
 
const std::string _base_name
 Base name of the material system.
 
std::string _elasticity_tensor_name
 
GenericMaterialProperty< T, is_ad > & _elasticity_tensor
 
GenericMaterialProperty< Real, is_ad > & _effective_stiffness
 
const Function *const _prefactor_function
 prefactor function to multiply the elasticity tensor with
 

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
 
std::map< MaterialPropertyName, std::set< Guarantee > > _guarantees
 

Detailed Description

ComputeElasticityTensorCP defines an elasticity tensor material object for crystal plasticity models.

This class accepts either Bunge Euler angles or a 3x3 rotation matrix, from which the 'passive' rotation matrix is generated. This rotation matrix is used by the crystal plasticity models to rotate the crystal slip system direction and plane normals into the user-specified orientation.

Definition at line 25 of file ComputeElasticityTensorCP.h.

Constructor & Destructor Documentation

◆ ComputeElasticityTensorCP()

ComputeElasticityTensorCP::ComputeElasticityTensorCP ( const InputParameters parameters)

Definition at line 29 of file ComputeElasticityTensorCP.C.

30 : ComputeElasticityTensor(parameters),
31 _read_prop_user_object(isParamValid("read_prop_user_object")
32 ? &getUserObject<PropertyReadFile>("read_prop_user_object")
33 : nullptr),
34 _Euler_angles_mat_prop(declareProperty<RealVectorValue>("Euler_angles")),
35 _crysrot(declareProperty<RankTwoTensor>(_base_name + "crysrot")),
37 _n_euler_angle_vars(coupledComponents("euler_angle_variables")),
38 _euler_angle_vars(coupledValues("euler_angle_variables"))
39{
40 // the base class guarantees constant in time, but in this derived class the
41 // tensor will rotate over time once plastic deformation sets in
43
44 // the base class performs a passive rotation, but the crystal plasticity
45 // materials use active rotation: recover unrotated _Cijkl here
46 if (parameters.isParamValid("rotation_matrix"))
47 {
49 _Cijkl.rotate(_rotation_matrix.transpose());
50 }
51 else
52 {
54 _Cijkl.rotate(_R.transpose());
55 }
56
58 (_read_prop_user_object || (parameters.isParamSetByUser("euler_angle_1")) ||
59 (parameters.isParamSetByUser("euler_angle_2")) ||
60 (parameters.isParamSetByUser("euler_angle_3"))))
61 mooseError("Bunge Euler angle information and the rotation_matrix cannot both be specified. "
62 "Provide only one type of orientation information in the input file.");
63
64 // Check if source of Euler angle values has a conflict
66 paramError("euler_angle_variables",
67 "Euler angles cannot be supplied from both coupled variables and auxiliary input "
68 "file in the option `read_prop_user_object`.");
69
70 if (isCoupled("euler_angle_variables") && _n_euler_angle_vars != 3)
71 paramError("euler_angle_variables", "The Euler angles should have three components.");
72}
ComputeElasticityTensorTempl< false > ComputeElasticityTensor
@ CONSTANT_IN_TIME
void mooseError(Args &&... args)
const std::string _base_name
Base name of the material system.
MaterialProperty< RankTwoTensor > & _crysrot
Crystal Rotation Matrix used to rotate the slip system direction and normal.
const std::vector< const VariableValue * > _euler_angle_vars
const PropertyReadFile *const _read_prop_user_object
Element property read user object used to read in Euler angles.
bool _user_provided_rotation_matrix
flag for user-defined rotation matrix, supplied in input file
MaterialProperty< RealVectorValue > & _Euler_angles_mat_prop
Material property that stores the values of the Euler Angles for postprocessing.
RotationTensor _R
Rotation matrix.
RankFourTensor _Cijkl
Individual material information.
void revokeGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
bool isParamSetByUser(const std::string &name) const
bool isParamValid(const std::string &name) const
void rotate(const TypeTensor< T > &R)
VectorValue< Real > RealVectorValue

Member Function Documentation

◆ assignEulerAngles()

void ComputeElasticityTensorCP::assignEulerAngles ( )
protectedvirtual

Definition at line 75 of file ComputeElasticityTensorCP.C.

76{
78 {
79 _Euler_angles_mat_prop[_qp](0) = _read_prop_user_object->getData(_current_elem, 0);
80 _Euler_angles_mat_prop[_qp](1) = _read_prop_user_object->getData(_current_elem, 1);
81 _Euler_angles_mat_prop[_qp](2) = _read_prop_user_object->getData(_current_elem, 2);
82 }
83 else if (_n_euler_angle_vars)
84 {
85 _Euler_angles_mat_prop[_qp](0) = (*_euler_angle_vars[0])[_qp];
86 _Euler_angles_mat_prop[_qp](1) = (*_euler_angle_vars[1])[_qp];
87 _Euler_angles_mat_prop[_qp](2) = (*_euler_angle_vars[2])[_qp];
88 }
89 else
91
93}
Real getData(const Elem *const elem, const unsigned int prop_num) const
void update(Axis axis, Real angle)
reforms the rotation matrix according to axis and angle.

Referenced by computeQpElasticityTensor().

◆ computeQpElasticityTensor()

void ComputeElasticityTensorCP::computeQpElasticityTensor ( )
overrideprotectedvirtual

Defines the constant rotation matrix from the user specified Bunge Euler Angles or user-supplied rotation matrix.

Reimplemented from ComputeElasticityTensorTempl< is_ad >.

Definition at line 96 of file ComputeElasticityTensorCP.C.

97{
98 // Properties assigned at the beginning of every call to material calculation
99 // is required by the monolithic and user object versions. If those classes
100 // are deprecated, these update can be removed and save time
102 {
104 _crysrot[_qp] = _R.transpose();
105 }
106 else
107 _crysrot[_qp] = _rotation_matrix.transpose();
108
111}
GenericMaterialProperty< T, is_ad > & _elasticity_tensor

◆ computeQpProperties()

template<bool is_ad, typename T = RankFourTensor>
virtual void ComputeElasticityTensorBaseTempl< is_ad, T >::computeQpProperties ( )
protectedvirtualinherited

◆ hasGuarantee()

bool GuaranteeProvider::hasGuarantee ( const MaterialPropertyName &  prop_name,
Guarantee  guarantee 
)
inherited

Definition at line 16 of file GuaranteeProvider.C.

17{
18 auto it = _guarantees.find(prop_name);
19 if (it == _guarantees.end())
20 return false;
21
22 auto it2 = it->second.find(guarantee);
23 return it2 != it->second.end();
24}
std::map< MaterialPropertyName, std::set< Guarantee > > _guarantees

◆ issueGuarantee()

void GuaranteeProvider::issueGuarantee ( const MaterialPropertyName &  prop_name,
Guarantee  guarantee 
)
protectedinherited

◆ revokeGuarantee()

void GuaranteeProvider::revokeGuarantee ( const MaterialPropertyName &  prop_name,
Guarantee  guarantee 
)
protectedinherited

Definition at line 34 of file GuaranteeProvider.C.

35{
36 auto it = _guarantees.find(prop_name);
37 if (it != _guarantees.end())
38 it->second.erase(guarantee);
39}

Referenced by ComputeElasticityTensorCP().

◆ validParams()

InputParameters ComputeElasticityTensorCP::validParams ( )
static

Definition at line 16 of file ComputeElasticityTensorCP.C.

17{
19 params.addClassDescription("Compute an elasticity tensor for crystal plasticity.");
20 params.addParam<UserObjectName>("read_prop_user_object",
21 "The ElementReadPropertyFile "
22 "GeneralUserObject to read element "
23 "specific property values from file");
24 params.addCoupledVar("euler_angle_variables",
25 "Vector of coupled variables representing the Euler angles' components.");
26 return params;
27}
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)

Member Data Documentation

◆ _base_name

template<bool is_ad, typename T = RankFourTensor>
const std::string ComputeElasticityTensorBaseTempl< is_ad, T >::_base_name
protectedinherited

◆ _Cijkl

template<bool is_ad>
RankFourTensor ComputeElasticityTensorTempl< is_ad >::_Cijkl
protectedinherited

◆ _crysrot

MaterialProperty<RankTwoTensor>& ComputeElasticityTensorCP::_crysrot
protected

Crystal Rotation Matrix used to rotate the slip system direction and normal.

Definition at line 48 of file ComputeElasticityTensorCP.h.

Referenced by computeQpElasticityTensor().

◆ _effective_stiffness

template<bool is_ad, typename T = RankFourTensor>
GenericMaterialProperty<Real, is_ad>& ComputeElasticityTensorBaseTempl< is_ad, T >::_effective_stiffness
protectedinherited

Definition at line 40 of file ComputeElasticityTensorBase.h.

◆ _elasticity_tensor

template<bool is_ad, typename T = RankFourTensor>
GenericMaterialProperty<T, is_ad>& ComputeElasticityTensorBaseTempl< is_ad, T >::_elasticity_tensor
protectedinherited

◆ _elasticity_tensor_name

template<bool is_ad, typename T = RankFourTensor>
std::string ComputeElasticityTensorBaseTempl< is_ad, T >::_elasticity_tensor_name
protectedinherited

◆ _euler_angle_vars

const std::vector<const VariableValue *> ComputeElasticityTensorCP::_euler_angle_vars
protected

Definition at line 58 of file ComputeElasticityTensorCP.h.

Referenced by assignEulerAngles().

◆ _Euler_angles

template<bool is_ad>
RealVectorValue ComputeRotatedElasticityTensorBaseTempl< is_ad >::_Euler_angles
protectedinherited

◆ _Euler_angles_mat_prop

MaterialProperty<RealVectorValue>& ComputeElasticityTensorCP::_Euler_angles_mat_prop
protected

Material property that stores the values of the Euler Angles for postprocessing.

Definition at line 45 of file ComputeElasticityTensorCP.h.

Referenced by assignEulerAngles().

◆ _guarantees

std::map<MaterialPropertyName, std::set<Guarantee> > GuaranteeProvider::_guarantees
privateinherited

◆ _n_euler_angle_vars

unsigned int ComputeElasticityTensorCP::_n_euler_angle_vars
protected

Definition at line 57 of file ComputeElasticityTensorCP.h.

Referenced by assignEulerAngles(), and ComputeElasticityTensorCP().

◆ _prefactor_function

template<bool is_ad, typename T = RankFourTensor>
const Function* const ComputeElasticityTensorBaseTempl< is_ad, T >::_prefactor_function
protectedinherited

prefactor function to multiply the elasticity tensor with

Definition at line 43 of file ComputeElasticityTensorBase.h.

Referenced by ComputeLayeredCosseratElasticityTensor::computeQpElasticityTensor().

◆ _R

RotationTensor ComputeElasticityTensorCP::_R
protected

Rotation matrix.

Definition at line 51 of file ComputeElasticityTensorCP.h.

Referenced by assignEulerAngles(), ComputeElasticityTensorCP(), and computeQpElasticityTensor().

◆ _read_prop_user_object

const PropertyReadFile* const ComputeElasticityTensorCP::_read_prop_user_object
protected

Element property read user object used to read in Euler angles.

Definition at line 42 of file ComputeElasticityTensorCP.h.

Referenced by assignEulerAngles(), and ComputeElasticityTensorCP().

◆ _rotation_matrix

template<bool is_ad>
const RealTensorValue ComputeRotatedElasticityTensorBaseTempl< is_ad >::_rotation_matrix
protectedinherited

◆ _user_provided_rotation_matrix

bool ComputeElasticityTensorCP::_user_provided_rotation_matrix
protected

flag for user-defined rotation matrix, supplied in input file

Definition at line 54 of file ComputeElasticityTensorCP.h.

Referenced by ComputeElasticityTensorCP(), and computeQpElasticityTensor().


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