11 return F.transpose() * F;
18 Eigen::SelfAdjointEigenSolver <Matrix3d> eigen_solver(C);
19 Matrix3d U = eigen_solver.operatorSqrt();
20 eigenvalues = eigen_solver.eigenvalues();
21 eigenvectors = eigen_solver.eigenvectors();
29 Eigen::Vector3d eigenvalues;
36 return 0.5 * (F.transpose() * F - Eigen::MatrixXd::Identity(3, 3));
42 Eigen::SelfAdjointEigenSolver<Matrix3d> es(2 * E + Eigen::MatrixXd::Identity(3, 3));
43 return es.eigenvectors() * es.eigenvalues().array().sqrt().matrix().asDiagonal() * es.eigenvectors().inverse();
55 return B + Eigen::MatrixXd::Identity(3, 3);
61 Eigen::SelfAdjointEigenSolver<Matrix3d> es(F.transpose()*F);
62 return es.eigenvectors() * es.eigenvalues().array().log().matrix().asDiagonal() * es.eigenvectors().inverse() / 2.0;
74 Eigen::SelfAdjointEigenSolver<Matrix3d> es(H);
75 return es.eigenvectors() * es.eigenvalues().array().exp().matrix().asDiagonal() * es.eigenvectors().inverse();
81 return 0.5 * (Eigen::MatrixXd::Identity(3, 3) - (F * F.transpose()).
inverse());
87 Eigen::SelfAdjointEigenSolver<Matrix3d> es((Eigen::MatrixXd::Identity(3, 3) - 2 * A).
inverse());
88 return es.eigenvectors() * es.eigenvalues().array().sqrt().matrix().asDiagonal() * es.eigenvectors().inverse();
106 else if(MODE ==
BIOT) {
122 std::cerr <<
"CRITICAL ERROR: In StrainConverter::strain_metric. Unrecognized strain metric" << std::endl;
123 std::cerr <<
" Your only options are GREEN_LAGRANGE, BIOT, HENCKY, EULER_ALMANSI, and DISP_GRAD" << std::endl;
124 std::cerr <<
" Exiting..." << std::endl;
133 assert(
curr_metric_func &&
"StrainConverter object improperly initialized!");
204 if(mode_name ==
"STRAIN_GL" || mode_name ==
"GL") {
211 else if(mode_name ==
"STRAIN_B" || mode_name ==
"B") {
218 else if(mode_name ==
"STRAIN_H" || mode_name ==
"H") {
225 else if(mode_name ==
"STRAIN_EA" || mode_name ==
"EA") {
232 else if(mode_name ==
"STRAIN_F" || mode_name ==
"F") {
239 std::cerr <<
"CRITICAL ERROR: In StrainConverter::set_mode(). Unrecognized strain metric '" << mode_name <<
"'" << std::endl;
240 std::cerr <<
" Your only options are STRAIN_GL, STRAIN_B, STRAIN_H, STRAIN_EA, and STRAIN_F" << std::endl;
241 std::cerr <<
" Exiting..." << std::endl;
262 for(
auto &w : wedges) {
277 for(
Index i = 0; i < tvec.size(); i++) {
281 tmat = pg[g].matrix() * tmat * pg[g].matrix().transpose();
287 breathing.normalize();
290 bigmat.col(0) = breathing;
293 Eigen::HouseholderQR<Eigen::MatrixXd> QR(bigmat);
308 m_sop_transf_mat << 1.0 / sqrt(3.0), 1.0 / sqrt(3.0), 1.0 / sqrt(3.0), 0, 0, 0,
309 1.0 / sqrt(2.0), -1.0 / sqrt(2.0), 0, 0, 0, 0,
310 -1.0 / sqrt(6.0), -1.0 / sqrt(6.0), 2.0 / sqrt(6.0), 0, 0, 0,
349 for(
Index i = 0; i < 3; i++) {
350 for(
Index j = 0; j < 3; j++) {
void set_mode(const std::string &mode_name)
static Matrix3d hencky(const Matrix3d &F)
HENCKY = log(C)/2.
static Matrix3d biot(const Matrix3d &F)
BIOT = (U-I)
std::vector< Eigen::MatrixXd > irreducible_wedges(const SymGroup &head_group, std::vector< Index > &multiplicities) const
static Matrix3d green_lagrange(const Matrix3d &F)
GREEN_LAGRANGE = (C-I)/2.
MetricFuncPtr curr_inv_metric_func
MatrixXd m_sop_transf_mat
const MasterSymGroup & master_group() const
bool empty() const
Returns true if SymGroupRepID has not been initialized with valid group_index or rep_index.
static Matrix3d disp_grad_to_F(const Matrix3d &F)
static Matrix3d strain_metric(const Matrix3d &F, STRAIN_METRIC MODE)
static Matrix3d hencky_to_F(const Matrix3d &H)
HENCKY = log(C)/2.
Matrix3d rollup_E(const VectorXd &_unrolled_E) const
Matrix3d unrolled_strain_metric_to_F(const VectorXd &E) const
VectorXd unroll_E(const Matrix3d &E) const
Unrolls the green-lagrange metric ( or any symmetric metric)
void set_conventional_sop_transf_mat()
SymGroupRepID m_symrep_ID
Matrix3d strain_metric_to_F(const Matrix3d &E) const
Array< Array< int > > m_order_strain
static Matrix3d euler_almansi_to_F(const Matrix3d &A)
EULER_ALMANSI = (I-(F F^{T})^(-1))/2.
Eigen::MatrixXd get_irrep_trans_mat(const SymGroup &head_group) const
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
static Matrix3d euler_almansi(const Matrix3d &F)
EULER_ALMANSI = (I-(F F^{T})^(-1))/2.
static Matrix3d disp_grad(const Matrix3d &F)
DISP_GRAD = F.
EigenIndex Index
For long integer indexing:
Eigen::Matrix< typename Derived::Scalar, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > inverse(const Eigen::MatrixBase< Derived > &M)
Return the integer inverse matrix of an invertible integer matrix.
STRAIN_METRIC STRAIN_METRIC_MODE
void set_symmetrized_sop(const SymGroup &pg)
Array< double > m_weight_strain
void set_conventional_order_symmetric()
VectorXd sop(Matrix3d &E, Matrix3d &C, Matrix3d &U, Eigen::Vector3d &eigenvalues, Matrix3d &eigenvectors, const Matrix3d &F) const
Array & append(const Array &new_tail)
Generalized symmetry matrix representation for arbitrary dimension Can be used to describe applicatio...
std::vector< Eigen::MatrixXd > irreducible_wedges(const SymGroup &pg, std::vector< Index > &multiplicities)
void set_conventional_order_unsymmetric()
SymGroupRep coord_transformed_copy(const Eigen::MatrixXd &trans_mat) const
static Matrix3d metric_tensor(const Matrix3d &F)
SymGroupRep is an alternative representation of a SymGroup for something other than real space...
static Matrix3d green_lagrange_to_F(const Matrix3d &E)
GREEN_LAGRANGE = 1/2 * (F^{T} F - I)
static Matrix3d biot_to_F(const Matrix3d &B)
BIOT = (U-I)
VectorXd unrolled_strain_metric(const Matrix3d &F) const
static Matrix3d right_stretch_tensor(Matrix3d &C, Eigen::Vector3d &eigenvalues, Matrix3d &eigenvectors, const Matrix3d &F)
std::vector< Eigen::MatrixXd > irreducible_sop_wedges(const SymGroup &pg, std::vector< Index > &multiplicities)
MetricFuncPtr curr_metric_func
SymGroupRep const & representation(SymGroupRepID i) const
Const access of alternate Representations of a SymGroup.
void set_rep(const SymOpRepresentation &base_rep, const SymOpRepresentation &new_rep) const