https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
74void
94
95void
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}
registerMooseObject("SolidMechanicsApp", ComputeElasticityTensorCP)
@ CONSTANT_IN_TIME
void mooseError(Args &&... args)
GenericMaterialProperty< T, is_ad > & _elasticity_tensor
ComputeElasticityTensorCP defines an elasticity tensor material object for crystal plasticity models.
MaterialProperty< RankTwoTensor > & _crysrot
Crystal Rotation Matrix used to rotate the slip system direction and normal.
virtual void computeQpElasticityTensor() override
Defines the constant rotation matrix from the user specified Bunge Euler Angles or user-supplied rota...
const std::vector< const VariableValue * > _euler_angle_vars
static InputParameters validParams()
const PropertyReadFile *const _read_prop_user_object
Element property read user object used to read in Euler angles.
ComputeElasticityTensorCP(const InputParameters &parameters)
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.
ComputeElasticityTensor defines an elasticity tensor material object with a given base name.
RankFourTensor _Cijkl
Individual material information.
static InputParameters validParams()
void revokeGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
bool isParamSetByUser(const std::string &name) const
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)
bool isParamValid(const std::string &name) const
Real getData(const Elem *const elem, const unsigned int prop_num) const
void rotate(const TypeTensor< T > &R)
void update(Axis axis, Real angle)
reforms the rotation matrix according to axis and angle.