13 #include "libmesh/mesh_tools.h" 22 "calculating the maximum misorientation within the grain.");
29 _updated_rotation(getMaterialProperty<
RankTwoTensor>(
"updated_rotation")),
30 _misorient(getMaterialProperty<
Real>(
"misorientation"))
49 for (
unsigned int _qp = 0; _qp <
_qrule->n_points(); _qp++)
58 Eigen::Matrix<Real, 3, 3> rot_mat;
60 for (
unsigned int i = 0; i < 3; ++i)
61 for (
unsigned int j = 0;
j < 3; ++
j)
62 rot_mat(i,
j) = rot(i,
j);
65 Eigen::JacobiSVD<Eigen::Matrix<Real, 3, 3>> svd(rot_mat,
66 Eigen::ComputeFullU | Eigen::ComputeFullV);
68 Eigen::Matrix<Real, 3, 3> U = svd.matrixU();
69 Eigen::Matrix<Real, 3, 3> V = svd.matrixV();
72 Eigen::Matrix<Real, 3, 3>
R = U * V.transpose();
73 if (
R.determinant() < 0.0)
75 Eigen::Matrix<Real, 3, 3> D = Eigen::Matrix<Real, 3, 3>::Identity();
77 R = U * D * V.transpose();
81 Eigen::Quaternion<Real> q(
R);
105 Real max_misorientation = 0.0;
107 bool has_update =
false;
110 if (misorientation > max_misorientation)
112 max_misorientation = misorientation;
std::map< SubdomainID, EulerAngles > _block_ea_values
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
static InputParameters validParams()
const MooseArray< Real > & _coord
const MaterialProperty< Real > & _misorient
ComputeBlockOrientationByMisorientation(const InputParameters ¶meters)
const Parallel::Communicator & _communicator
const Real & _current_elem_volume
EulerAngles computeSubdomainEulerAngles(const SubdomainID &sid)
FEProblemBase & _fe_problem
Computes the average value of a variable on each block.
static InputParameters validParams()
virtual void initialize() override
This is called before execute so you can reset any internal data.
std::unordered_map< SubdomainID, std::vector< std::tuple< Real, Real, Real, Real > > > _grain_misorientation
Computes the average value of a variable on each block.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const QBase *const & _qrule
const Elem *const & _current_elem
const MooseArray< Real > & _JxW
virtual void initialize() override
Clear internal Euler angle and misorientationdata.
virtual MooseMesh & mesh() override
const MaterialProperty< RankTwoTensor > & _updated_rotation
registerMooseObject("SolidMechanicsApp", ComputeBlockOrientationByMisorientation)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
virtual void execute() override
Compute the average of the rotation matrix, Euler angles, and misorientation in each element...
virtual void finalize() override
Sync data from all processors (gather the maximum misorientation and the corresponding EulerAngle fro...
const std::set< SubdomainID > & meshSubdomains() const