https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
13
16{
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 "degree_to_radian", false, "Whether to convert euler angles from degree to radian.");
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 _degree_to_radian(getParam<bool>("degree_to_radian"))
32{
33}
34
35void
40
41void
46
47void
49 RealVectorValue & euler_angle)
50{
51 // transform RankTwoTensor to Eigen::Matrix
52 Eigen::Matrix<Real, 3, 3> rot_mat;
53
54 for (unsigned int i = 0; i < 3; ++i)
55 for (unsigned int j = 0; j < 3; ++j)
56 rot_mat(i, j) = rot(i, j);
57
58 // compute Quaternion from rotation matrix
59 Eigen::Quaternion<Real> q(rot_mat);
60 // construct Euler angle from Quaternion
61 EulerAngles ea(q);
62 // convert EulerAngles to RealVectorValue
63 euler_angle = (RealVectorValue)ea;
64
66 euler_angle *= libMesh::pi / 180.0;
67}
registerMooseObject("SolidMechanicsApp", ComputeUpdatedEulerAngle)
const MaterialProperty< RankTwoTensor > & _updated_rotation
ComputeUpdatedEulerAngle(const InputParameters &parameters)
MaterialProperty< RealVectorValue > & _updated_euler_angle
void computeEulerAngleFromRotationMatrix(const RankTwoTensor &rot, RealVectorValue &euler_angle)
static InputParameters validParams()
Euler angle triplet.
Definition EulerAngles.h:25
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)
unsigned int _qp
static InputParameters validParams()
const Real pi