www.mooseframework.org
ComputeElasticityTensorCP.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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  return params;
25 }
26 
28  : ComputeElasticityTensor(parameters),
29  _read_prop_user_object(isParamValid("read_prop_user_object")
30  ? &getUserObject<PropertyReadFile>("read_prop_user_object")
31  : nullptr),
32  _Euler_angles_mat_prop(declareProperty<RealVectorValue>("Euler_angles")),
33  _crysrot(declareProperty<RankTwoTensor>(_base_name + "crysrot")),
34  _R(_Euler_angles)
35 {
36  // the base class guarantees constant in time, but in this derived class the
37  // tensor will rotate over time once plastic deformation sets in
39 
40  // the base class performs a passive rotation, but the crystal plasticity
41  // materials use active rotation: recover unrotated _Cijkl here
42  if (parameters.isParamValid("rotation_matrix"))
43  {
45  _Cijkl.rotate(_rotation_matrix.transpose());
46  }
47  else
48  {
50  _Cijkl.rotate(_R.transpose());
51  }
52 
54  (_read_prop_user_object || (parameters.isParamSetByUser("euler_angle_1")) ||
55  (parameters.isParamSetByUser("euler_angle_2")) ||
56  (parameters.isParamSetByUser("euler_angle_3"))))
57  mooseError("Bunge Euler angle information and the rotation_matrix cannot both be specified. "
58  "Provide only one type of orientation information in the input file.");
59 }
60 
61 void
63 {
65  {
69  }
70  else
72 
74 }
75 
76 void
78 {
79  // Properties assigned at the beginning of every call to material calculation
80  // is required by the monolithic and user object versions. If those classes
81  // are deprecated, these update can be removed and save time
83  {
85  _crysrot[_qp] = _R.transpose();
86  }
87  else
88  _crysrot[_qp] = _rotation_matrix.transpose();
89 
92 }
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.
ComputeElasticityTensor defines an elasticity tensor material object with a given base name...
void rotate(const TypeTensor< T > &R)
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