17template <
int KelvinVectorSize>
19 Eigen::Matrix<double, KelvinVectorSize, 1>
const& deviatoric_v)
21 assert(std::abs(trace(deviatoric_v)) <=
22 4e-12 * diagonal(deviatoric_v).norm());
23 return std::sqrt(3 * J2(deviatoric_v));
26template <
int KelvinVectorSize>
28 Eigen::Matrix<double, KelvinVectorSize, 1>
const& deviatoric_v)
30 return std::sqrt(deviatoric_v.transpose() * deviatoric_v);
33template <
int KelvinVectorSize>
35 Eigen::Matrix<double, KelvinVectorSize, 1>
const& deviatoric_v)
37 assert(std::abs(trace(deviatoric_v)) <=
38 4e-12 * diagonal(deviatoric_v).norm());
39 return 0.5 * deviatoric_v.transpose() * deviatoric_v;
44template <
int KelvinVectorSize>
46 Eigen::Matrix<double, KelvinVectorSize, 1>
const& deviatoric_v)
48 assert(std::abs(trace(deviatoric_v)) <=
49 4e-12 * diagonal(deviatoric_v).norm());
50 return determinant(deviatoric_v);
53template <
int KelvinVectorSize>
55 Eigen::Matrix<double, KelvinVectorSize, 1>
const&
v)
57 return v.template topLeftCorner<3, 1>();
61template <
int KelvinVectorSize>
63 Eigen::Matrix<double, KelvinVectorSize, 1>
const&
v)
65 return diagonal(
v).sum();
72namespace KelvinVector_detail
74template <
int KelvinVectorSize>
75Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>
78 Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize> P_dev =
79 Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>::Identity();
81 P_dev.template topLeftCorner<3, 3>() -=
82 1. / 3. * Eigen::Matrix<double, 3, 3>::Ones();
86template <
int KelvinVectorSize>
87Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>
90 Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize> P_sph =
91 Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>::Zero();
93 P_sph.template topLeftCorner<3, 3>().setConstant(1. / 3.);
97template <
int KelvinVectorSize>
100 Eigen::Matrix<double, KelvinVectorSize, 1> ivec =
101 Eigen::Matrix<double, KelvinVectorSize, 1>::Zero();
103 ivec.template topLeftCorner<3, 1>().setConstant(1.);
108template <
int KelvinVectorSize>
109const Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>
113template <
int KelvinVectorSize>
114Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>
const
118template <
int KelvinVectorSize>
119const Eigen::Matrix<double, KelvinVectorSize, 1>
Eigen::Matrix< double, KelvinVectorSize, KelvinVectorSize > initSphericalProjection()
Eigen::Matrix< double, KelvinVectorSize, KelvinVectorSize > initDeviatoricProjection()
Eigen::Matrix< double, KelvinVectorSize, 1 > initIdentity2()
static double FrobeniusNorm(Eigen::Matrix< double, KelvinVectorSize, 1 > const &deviatoric_v)
Get the norm of the deviatoric stress.
static Eigen::Matrix< double, KelvinVectorSize, 1 > const identity2
Kelvin mapping of 2nd order identity tensor.
static Eigen::Vector3d diagonal(Eigen::Matrix< double, KelvinVectorSize, 1 > const &v)
static double trace(Eigen::Matrix< double, KelvinVectorSize, 1 > const &v)
Trace of the corresponding tensor.
static Eigen::Matrix< double, KelvinVectorSize, KelvinVectorSize > const spherical_projection
static double J2(Eigen::Matrix< double, KelvinVectorSize, 1 > const &deviatoric_v)
static Eigen::Matrix< double, KelvinVectorSize, KelvinVectorSize > const deviatoric_projection
static double equivalentStress(Eigen::Matrix< double, KelvinVectorSize, 1 > const &deviatoric_v)
static double J3(Eigen::Matrix< double, KelvinVectorSize, 1 > const &deviatoric_v)