https://mooseframework.inl.gov
ComputeUpdatedEulerAngle.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 
12 registerMooseObject("SolidMechanicsApp", ComputeUpdatedEulerAngle);
13 
16 {
18  params.addClassDescription(
19  "This class computes the updated Euler angle for crystal plasticity simulations. This needs "
20  "to be used together with the ComputeMultipleCrystalPlasticityStress class, where the "
21  "updated rotation material property is computed. ");
22  params.addParam<bool>(
23  "radian_to_degree", true, "Whether to convert euler angles from radian to degree.");
24  return params;
25 }
26 
28  : Material(parameters),
29  _updated_rotation(getMaterialProperty<RankTwoTensor>("updated_rotation")),
30  _updated_euler_angle(declareProperty<RealVectorValue>("updated_Euler_angle"))
31 {
32 }
33 
34 void
36 {
37  _updated_euler_angle[_qp].zero();
38 }
39 
40 void
42 {
44 }
45 
46 void
48  RealVectorValue & euler_angle)
49 {
50  // transform RankTwoTensor to Eigen::Matrix
51  Eigen::Matrix<Real, 3, 3> rot_mat;
52 
53  for (unsigned int i = 0; i < 3; ++i)
54  for (unsigned int j = 0; j < 3; ++j)
55  rot_mat(i, j) = rot(i, j);
56 
57  // compute Quaternion from rotation matrix
58  Eigen::Quaternion<Real> q(rot_mat);
59  // construct Euler angle from Quaternion
60  EulerAngles ea(q);
61  // convert EulerAngles to RealVectorValue
62  euler_angle = (RealVectorValue)ea;
63 
64  if (!getParam<bool>("radian_to_degree"))
65  euler_angle *= libMesh::pi / 180.0;
66 }
const MaterialProperty< RankTwoTensor > & _updated_rotation
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
MaterialProperty< RealVectorValue > & _updated_euler_angle
ComputeUpdatedEulerAngle(const InputParameters &parameters)
registerMooseObject("SolidMechanicsApp", ComputeUpdatedEulerAngle)
unsigned int _qp
static InputParameters validParams()
Euler angle triplet.
Definition: EulerAngles.h:24
void addClassDescription(const std::string &doc_string)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
void computeEulerAngleFromRotationMatrix(const RankTwoTensor &rot, RealVectorValue &euler_angle)
static InputParameters validParams()
const Real pi