23 InputParameters params = validParams<GeneralVectorPostprocessor>();
24 params.addClassDescription(
25 "Provide updated Euler angles after rigid body rotation of the grains.");
26 params.addRequiredParam<UserObjectName>(
"grain_tracker_object",
27 "The FeatureFloodCount UserObject to get values from.");
28 params.addParam<UserObjectName>(
"euler_angle_updater",
29 "Name of Euler angle provider user object");
30 params.addRequiredParam<UserObjectName>(
"grain_torques_object",
31 "Name of Euler angle provider user object");
32 params.addRequiredParam<VectorPostprocessorName>(
"grain_volumes",
33 "The feature volume VectorPostprocessorValue.");
34 params.addParam<Real>(
"rotation_constant", 1.0,
"constant value characterizing grain rotation");
39 : GeneralVectorPostprocessor(params),
40 _diff(declareVector(
"vec_diff")),
44 _grain_volumes(getVectorPostprocessorValue(
"grain_volumes",
"feature_volumes")),
45 _mr(getParam<Real>(
"rotation_constant"))
55 _diff.assign(3 * grain_num, 0.0);
57 for (
unsigned int i = 0; i < grain_num; ++i)
63 RealVectorValue a(1, 1, 1);
65 RealVectorValue a_rot = R * a;
68 RealVectorValue torque_rot = R0 * torque;
69 RealVectorValue a_rot0 = R0 * a;
80 RealVectorValue torque_rot1;
81 RealVectorValue angle_rot;
87 (torque_rot(0) * std::cos(angle_rot(0)) + torque_rot(1) * std::sin(angle_rot(0)));
90 torque_rot1(2) = (torque_rot(0) * std::sin(angle_rot(0)) * std::sin(angle_rot(1)) -
91 torque_rot(1) * std::cos(angle_rot(0)) * std::sin(angle_rot(1)) +
92 torque_rot(2) * std::cos(angle_rot(1)));
94 angle_rot *= (180.0 / libMesh::pi);
97 RealVectorValue a_rot1 = R4 * a_rot0;
101 _diff[3 * i + 0] = a_rot(0) - a_rot1(0);
102 _diff[3 * i + 1] = a_rot(1) - a_rot1(1);
103 _diff[3 * i + 2] = a_rot(2) - a_rot1(2);