23 "Provide updated euler angles after rigid body rotation of the grains.");
25 "The FeatureFloodCount UserObject to get values from.");
27 "Name of Euler angle provider user object");
29 "Name of Euler angle provider user object");
31 "The feature volume VectorPostprocessorValue.");
32 params.
addParam<
Real>(
"rotation_constant", 1.0,
"Constant value characterizing grain rotation");
41 _grain_volumes(getVectorPostprocessorValue(
"grain_volumes",
"feature_volumes")),
42 _mr(getParam<
Real>(
"rotation_constant")),
43 _first_time(declareRestartableData<bool>(
"first_time_euler_update", true)),
44 _first_time_recovered(_app.isRecovering()),
45 _t_step_old(declareRestartableData<
int>(
"euler_update_tstep_old", -1)),
46 _angles_old(declareRestartableData<
std::vector<
EulerAngles>>(
"euler_angles_old"))
59 for (
unsigned int i = 0; i < grain_num; ++i)
63 unsigned int angle_size =
_angles.size();
64 for (
unsigned int i = angle_size; i < grain_num; ++i)
67 for (
unsigned int i = 0; i < grain_num; ++i)
78 else if (i > angle_size)
96 angle_change(0) = omega(2) *
_dt;
98 (omega(0) * std::cos(angle_change(0)) + omega(1) * std::sin(angle_change(0))) *
_dt;
99 angle_change(2) = (omega(0) * std::sin(angle_change(0)) * std::sin(angle_change(1)) -
100 omega(1) * std::cos(angle_change(0)) * std::sin(angle_change(1)) +
101 omega(2) * std::cos(angle_change(1))) *
114 if (
R(2, 2) != 1.0 &&
R(2, 2) != -1.0)
120 else if (
R(2, 2) == 1.0)
127 _angles[i].phi1 = angle_change(0);
129 if (std::abs(
_angles[i].phi1) > 360.0)
131 int laps =
_angles[i].phi1 / 360.0;
132 _angles[i].phi1 -= laps * 360.0;
142 _angles[i].phi1 = angle_change(0);
144 if (std::abs(
_angles[i].phi1) > 360.0)
146 int laps =
_angles[i].phi1 / 360.0;
147 _angles[i].phi1 -= laps * 360.0;
170 mooseAssert(i <
getGrainNum(),
"Requesting Euler angles for an invalid grain id");
const GrainTrackerInterface & _grain_tracker
const GrainForceAndTorqueInterface & _grain_torque
This class defines the interface for the GrainTracking objects.
This class provides interface for extracting the forces and torques computed in other UserObjects...
const VectorPostprocessorValue & _grain_volumes
bool _first_time_recovered
Whether the simulation has recovered once.
virtual const std::vector< RealGradient > & getTorqueValues() const =0
std::vector< EulerAngles > & _angles_old
std::vector< EulerAngles > & _angles
virtual std::size_t getTotalFeatureCount() const =0
Returns a number large enough to contain the largest ID for all grains in use.
FEProblemBase & _fe_problem
TensorValue< Real > RealTensorValue
static InputParameters validParams()
virtual bool converged(const unsigned int sys_num)
const EulerAngleProvider & _euler
registerMooseObject("PhaseFieldApp", EulerAngleUpdater)
virtual const EulerAngles & getEulerAnglesOld(unsigned int) const
static InputParameters validParams()
unsigned int number() const
virtual unsigned int getGrainNum() const
Update Euler angles of each grains after rigid body rotation This class estimates the rotation of pri...
This is a RealTensor version of a rotation matrix It is instantiated with the Euler angles...
EulerAngleUpdater(const InputParameters ¶meters)
virtual void initialize() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool & _first_time
Whether this is the first time updating angles, in which case the initial euler angle provider should...
int & _t_step_old
Used to determine whether a timestep is being repeated.
virtual const EulerAngles & getEulerAngles(unsigned int i) const
void mooseError(Args &&... args) const
Abstract base class for user objects that implement the Euler Angle provider interface.
void ErrorVector unsigned int