10 #include "libmesh/ignore_warnings.h"
12 #include "MooseRandom.h"
23 phi1 = std::atan2((q.x() * q.z() + q.w() * q.y()), -(-q.w() * q.x() + q.y() * q.z())) *
24 (180.0 / libMesh::pi);
27 std::pow(q.w() * q.w() - q.x() * q.x() - q.y() * q.y() + q.z() * q.z(), 2.0)),
28 q.w() * q.w() - q.x() * q.x() - q.y() * q.y() + q.z() * q.z()) *
29 (180.0 / libMesh::pi);
30 phi2 = std::atan2((q.x() * q.z() - q.w() * q.y()), (q.w() * q.x() + q.y() * q.z())) *
31 (180.0 / libMesh::pi);
40 mooseError(
"Euler angle out of range.");
43 Eigen::Quaternion<Real>
46 Eigen::Quaternion<Real> q;
48 Real cPhi1PlusPhi2, cphi, cPhi1MinusPhi2;
49 Real sPhi1PlusPhi2, sphi, sPhi1MinusPhi2;
56 cPhi1PlusPhi2 = std::cos((
phi1 * libMesh::pi / 180.0 +
phi2 * libMesh::pi / 180.0) / 2.0);
57 cphi = std::cos(
Phi * libMesh::pi / 360.0);
58 cPhi1MinusPhi2 = std::cos((
phi1 * libMesh::pi / 180.0 -
phi2 * libMesh::pi / 180.0) / 2.0);
60 sPhi1PlusPhi2 = std::sin((
phi1 * libMesh::pi / 180.0 +
phi2 * libMesh::pi / 180.0) / 2.0);
61 sphi = std::sin(
Phi * libMesh::pi / 360.0);
62 sPhi1MinusPhi2 = std::sin((
phi1 * libMesh::pi / 180.0 -
phi2 * libMesh::pi / 180.0) / 2.0);
64 q.w() = cphi * cPhi1PlusPhi2;
65 q.x() = sphi * cPhi1MinusPhi2;
66 q.y() = sphi * sPhi1MinusPhi2;
67 q.z() = cphi * sPhi1PlusPhi2;
75 phi1 = MooseRandom::rand() * 360.0;
76 Phi = std::acos(1.0 - 2.0 * MooseRandom::rand()) / libMesh::pi * 180.0;
77 phi2 = MooseRandom::rand() * 360;
84 Phi = std::acos(1.0 - 2.0 *
random.rand(0)) / libMesh::pi * 180.0;
87 #include "libmesh/restore_warnings.h"