Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
ComputeElasticityTensorCP.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "RotationTensor.h"
12 
14 
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 }
28 
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")),
36  _R(_Euler_angles),
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 }
73 
74 void
76 {
78  {
82  }
83  else if (_n_euler_angle_vars)
84  {
88  }
89  else
91 
93 }
94 
95 void
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 }
virtual bool isCoupled(const std::string &var_name, unsigned int i=0) const
registerMooseObject("SolidMechanicsApp", ComputeElasticityTensorCP)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
MaterialProperty< RealVectorValue > & _Euler_angles_mat_prop
Material property that stores the values of the Euler Angles for postprocessing.
ComputeElasticityTensorCP(const InputParameters &parameters)
GenericMaterialProperty< RankFourTensor, is_ad > & _elasticity_tensor
static InputParameters validParams()
RotationTensor _R
Rotation matrix.
ComputeElasticityTensorCP defines an elasticity tensor material object for crystal plasticity models...
Real getData(const Elem *const elem, const unsigned int prop_num) const
RankFourTensor _Cijkl
Individual material information.
void revokeGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
MaterialProperty< RankTwoTensor > & _crysrot
Crystal Rotation Matrix used to rotate the slip system direction and normal.
const std::vector< const VariableValue * > _euler_angle_vars
ComputeElasticityTensor defines an elasticity tensor material object with a given base name...
void paramError(const std::string &param, Args... args) const
void rotate(const TypeTensor< T > &R)
void addCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
bool isParamSetByUser(const std::string &name) const
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
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
const InputParameters & parameters() const
virtual void computeQpElasticityTensor() override
Defines the constant rotation matrix from the user specified Bunge Euler Angles or user-supplied rota...
void update(Axis axis, Real angle)
reforms the rotation matrix according to axis and angle.
bool isParamValid(const std::string &name) const