17#include <unsupported/Eigen/MatrixFunctions>
25 template <
typename Derived>
26 decltype(
auto) mayTransformFromVoigt(
const Eigen::MatrixBase<Derived>& e,
bool isStrain =
true) {
27 if constexpr (Concepts::EigenVector<Derived>)
45template <StrainTags tag,
typename Derived>
47 const auto& e = eMB.derived();
48 static_assert(Concepts::EigenMatrix33<Derived>);
52 return (0.5 * (e.transpose() * e - Derived::Identity())).eval();
54 return (0.5 * (e + e.transpose() + e.transpose() * e)).eval();
56 return (0.5 * (e - Derived::Identity())).eval();
70template <StrainTags tag,
typename Derived>
72 const auto& e = eMB.derived();
74 static_assert(Concepts::EigenMatrix33<Derived>);
80 return ((2 * e + Derived::Identity()).sqrt()).eval();
84 return (e + Derived::Identity()).eval();
86 return (e.sqrt()).eval();
101template <StrainTags tag,
typename Derived>
103 const auto& e = eMB.derived();
104 static_assert(Concepts::EigenMatrix33<Derived>);
109 return (2 * e + Derived::Identity()).eval();
111 return (e.transpose() * e).eval();
113 const auto F = e + Derived::Identity();
114 return (F.transpose() * F).eval();
131template <StrainTags from, StrainTags to,
typename Derived>
134 "No useful transformation available for linear strains.");
135 decltype(
auto) e = Impl::mayTransformFromVoigt(eRaw.eval(),
true);
136 if constexpr (from == to)
139 return createGreenLagrangianStrains<from>(e);
141 return createDeformationGradient<from>(e);
143 return createRightCauchyGreen<from>(e);
Helper for the Eigen::Tensor types.
Definition of several material related enums.
decltype(auto) createDeformationGradient(const Eigen::MatrixBase< Derived > &eMB)
Create the deformation gradient based on the input.
Definition: strainconversions.hh:71
auto createGreenLagrangianStrains(const Eigen::MatrixBase< Derived > &eMB)
Create Green-Lagrangian strain based on the input.
Definition: strainconversions.hh:46
decltype(auto) createRightCauchyGreen(const Eigen::MatrixBase< Derived > &eMB)
Create right Cauchy-Green tensor based on the input.
Definition: strainconversions.hh:102
decltype(auto) transformStrain(const Eigen::MatrixBase< Derived > &eRaw)
Transform strain from one type to another.
Definition: strainconversions.hh:132
auto fromVoigt(const Eigen::Matrix< ST, size, 1, Options, maxSize, 1 > &EVoigt, bool isStrain=true)
Converts a vector given in Voigt notation to a matrix.
Definition: tensorutils.hh:271
Definition: assemblermanipulatorbuildingblocks.hh:22