24 "Provide updated Euler angles after rigid body rotation of the grains.");
26 "The FeatureFloodCount UserObject to get values from.");
27 params.
addParam<UserObjectName>(
"euler_angle_updater",
28 "Name of Euler angle provider user object");
30 "Name of Euler angle provider user object");
32 "The feature volume VectorPostprocessorValue.");
33 params.
addParam<Real>(
"rotation_constant", 1.0,
"constant value characterizing grain rotation");
39 _diff(declareVector(
"vec_diff")),
43 _grain_volumes(getVectorPostprocessorValue(
"grain_volumes",
"feature_volumes")),
44 _mr(getParam<Real>(
"rotation_constant"))
54 _diff.assign(3 * grain_num, 0.0);
56 for (
unsigned int i = 0; i < grain_num; ++i)
62 RealVectorValue
a(1, 1, 1);
64 RealVectorValue a_rot =
R *
a;
67 RealVectorValue torque_rot = R0 * torque;
68 RealVectorValue a_rot0 = R0 *
a;
79 RealVectorValue torque_rot1;
80 RealVectorValue angle_rot;
86 (torque_rot(0) * std::cos(angle_rot(0)) + torque_rot(1) * std::sin(angle_rot(0)));
89 torque_rot1(2) = (torque_rot(0) * std::sin(angle_rot(0)) * std::sin(angle_rot(1)) -
90 torque_rot(1) * std::cos(angle_rot(0)) * std::sin(angle_rot(1)) +
91 torque_rot(2) * std::cos(angle_rot(1)));
96 RealVectorValue a_rot1 = R4 * a_rot0;
100 _diff[3 * i + 0] = a_rot(0) - a_rot1(0);
101 _diff[3 * i + 1] = a_rot(1) - a_rot1(1);
102 _diff[3 * i + 2] = a_rot(2) - a_rot1(2);
registerMooseObject("PhaseFieldApp", EulerAngleUpdaterCheck)
virtual const EulerAngles & getEulerAngles(unsigned int i) const
This is a unit test to check the correctness of the updated euler angles An unit vector is rotated as...
const EulerAngleUpdater & _euler
VectorPostprocessorValue & _diff
std::vector< RealVectorValue > _angles_old
virtual void initialize() override
const GrainTrackerInterface & _grain_tracker
std::vector< RealVectorValue > _angles
static InputParameters validParams()
const GrainForceAndTorqueInterface & _grain_torque
EulerAngleUpdaterCheck(const InputParameters ¶meters)
const VectorPostprocessorValue & _grain_volumes
Update Euler angles of each grains after rigid body rotation This class estimates the rotation of pri...
virtual const EulerAngles & getEulerAnglesOld(unsigned int) const
static InputParameters validParams()
This class provides interface for extracting the forces and torques computed in other UserObjects.
virtual const std::vector< RealGradient > & getTorqueValues() const =0
This class defines the interface for the GrainTracking objects.
virtual std::size_t getTotalFeatureCount() const =0
Returns a number large enough to contain the largest ID for all grains in use.
This is a RealTensor version of a rotation matrix It is instantiated with the Euler angles,...