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(declareRestartableData<
std::vector<
EulerAngles>>(
"euler_angles")),
47 _angles_old(declareRestartableData<
std::vector<
EulerAngles>>(
"euler_angles_old"))
60 for (
unsigned int i = 0; i < grain_num; ++i)
64 unsigned int angle_size =
_angles.size();
65 for (
unsigned int i = angle_size; i < grain_num; ++i)
68 for (
unsigned int i = 0; i < grain_num; ++i)
79 else if (i > angle_size)
97 angle_change(0) = omega(2) *
_dt;
99 (omega(0) * std::cos(angle_change(0)) + omega(1) * std::sin(angle_change(0))) *
_dt;
100 angle_change(2) = (omega(0) * std::sin(angle_change(0)) * std::sin(angle_change(1)) -
101 omega(1) * std::cos(angle_change(0)) * std::sin(angle_change(1)) +
102 omega(2) * std::cos(angle_change(1))) *
115 if (
R(2, 2) != 1.0 &&
R(2, 2) != -1.0)
121 else if (
R(2, 2) == 1.0)
128 _angles[i].phi1 = angle_change(0);
130 if (std::abs(
_angles[i].phi1) > 360.0)
132 int laps =
_angles[i].phi1 / 360.0;
133 _angles[i].phi1 -= laps * 360.0;
143 _angles[i].phi1 = angle_change(0);
145 if (std::abs(
_angles[i].phi1) > 360.0)
147 int laps =
_angles[i].phi1 / 360.0;
148 _angles[i].phi1 -= laps * 360.0;
177 mooseAssert(i <
getGrainNum(),
"Requesting Euler angles for an invalid grain id");
184 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 unsigned int getGrainNum() const override
virtual const std::vector< RealGradient > & getTorqueValues() const =0
std::vector< EulerAngles > & _angles_old
Previous set of Euler angles, used when the time step failed to reset the angles (pre-update) ...
virtual std::size_t getTotalFeatureCount() const =0
Returns a number large enough to contain the largest ID for all grains in use.
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
Update Euler angles of each grains after rigid body rotation This class estimates the rotation of pri...
virtual const EulerAngles & getEulerAngles(unsigned int) const override
This is a RealTensor version of a rotation matrix It is instantiated with the Euler angles...
static const std::string R
EulerAngleUpdater(const InputParameters ¶meters)
virtual void initialize() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual const EulerAngles & getEulerAngles(unsigned int) const =0
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.
FEProblemBase & _fe_problem
void mooseError(Args &&... args) const
std::vector< EulerAngles > & _angles
Current set of Euler angles (one per grain), updated on initialize()
Abstract base class for user objects that implement the Euler Angle provider interface.
void ErrorVector unsigned int