26 if (displacement_dim == 2)
30 else if (displacement_dim == 3)
35 "Cannot convert displacement dimension {} to kelvin vector dimension.",
46template <
int DisplacementDim>
54template <
int DisplacementDim>
60template <
int DisplacementDim>
67template <
int DisplacementDim>
74template <
int DisplacementDim>
78 std::numeric_limits<double>::quiet_NaN());
82template <
int DisplacementDim>
86 std::numeric_limits<double>::quiet_NaN());
92template <
int KelvinVectorSize>
95 static_assert(KelvinVectorSize == 4 || KelvinVectorSize == 6,
96 "KelvinVector invariants for vectors of size different than "
97 "4 or 6 is not allowed.");
100 static Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>
const
104 static Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>
const
107 static Eigen::Matrix<double, KelvinVectorSize, 1>
const identity2;
111 Eigen::Matrix<double, KelvinVectorSize, 1>
const&
v);
116 Eigen::Matrix<double, KelvinVectorSize, 1>
const& deviatoric_v);
120 Eigen::Matrix<double, KelvinVectorSize, 1>
const& deviatoric_v);
125 Eigen::Matrix<double, KelvinVectorSize, 1>
const& deviatoric_v);
130 Eigen::Matrix<double, KelvinVectorSize, 1>
const& deviatoric_v);
133 static double trace(Eigen::Matrix<double, KelvinVectorSize, 1>
const&
v);
138 Eigen::Matrix<double, KelvinVectorSize, 1>
const&
v);
147template <
int KelvinVectorSize>
148Eigen::Matrix<double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1>
158template <
int KelvinVectorSize>
168template <
int DisplacementDim>
170 Eigen::Matrix<double, 3, 3>
const& m);
183template <
int KelvinVectorSize>
184Eigen::Matrix<double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1>
199template <
typename Derived>
200Eigen::Matrix<double, Eigen::MatrixBase<Derived>::RowsAtCompileTime, 1>
204 (Eigen::MatrixBase<Derived>::ColsAtCompileTime == 1) ||
205 (Eigen::MatrixBase<Derived>::ColsAtCompileTime == Eigen::Dynamic),
206 "KelvinVector must be a column vector");
210 "KelvinVector must be a column vector, but input has {:d} columns.",
214 Eigen::Matrix<double, Eigen::MatrixBase<Derived>::RowsAtCompileTime, 1>
219 result <<
v[0],
v[1],
v[2],
v[3] * std::sqrt(2.);
221 else if (
v.rows() == 6)
224 result <<
v[0],
v[1],
v[2],
v[3] * std::sqrt(2.),
v[4] * std::sqrt(2.),
225 v[5] * std::sqrt(2.);
230 "Symmetric tensor to Kelvin vector conversion expected an input "
231 "vector of size 4 or 6, but a vector of size {:d} was given.",
241template <
int DisplacementDim>
243 std::vector<double>
const& values)
245 constexpr int kelvin_vector_size =
248 if (values.size() != kelvin_vector_size)
251 "Symmetric tensor to Kelvin vector conversion expected an input "
252 "vector of size {:d}, but a vector of size {:d} was given.",
253 kelvin_vector_size, values.size());
258 DisplacementDim>
const>(
265template <
int DisplacementDim>
266Eigen::Matrix<double, DisplacementDim,
272template <
int DisplacementDim>
274 Eigen::Matrix<
double, DisplacementDim,
281template <
int DisplacementDim>
283 Eigen::Matrix<
double, DisplacementDim, DisplacementDim, Eigen::ColMajor,
284 DisplacementDim, DisplacementDim>
const& transformation);
Eigen::Matrix< double, DisplacementDim, 1 > reduceKelvinToVector(Eigen::Matrix< double, DisplacementDim, kelvin_vector_dimensions(DisplacementDim)> const &m)
KelvinMatrixType< DisplacementDim > fourthOrderRotationMatrix(Eigen::Matrix< double, DisplacementDim, DisplacementDim, Eigen::ColMajor, DisplacementDim, DisplacementDim > const &transformation)
Eigen::Matrix< double, 4, 1 > kelvinVectorToSymmetricTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
constexpr auto KVnan()
Returns an expressions for a Kelvin vector filled with NaN.
Eigen::Matrix< double, Eigen::MatrixBase< Derived >::RowsAtCompileTime, 1 > symmetricTensorToKelvinVector(Eigen::MatrixBase< Derived > const &v)
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
constexpr auto KMzero()
Returns an expressions for a Kelvin matrix filled with zero.
constexpr auto KVzero()
Returns an expressions for a Kelvin vector filled with zero.
Eigen::Matrix< double, DisplacementDim, kelvin_vector_dimensions(DisplacementDim)> liftVectorToKelvin(Eigen::Matrix< double, DisplacementDim, 1 > const &v)
constexpr auto KMnan()
Returns an expressions for a Kelvin matrix filled with NaN.
KelvinVectorType< DisplacementDim > tensorToKelvin(Eigen::Matrix< double, 3, 3 > const &m)
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor > KelvinMatrixType
Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > inverse(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
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 determinant(Eigen::Matrix< double, KelvinVectorSize, 1 > const &v)
Determinant of a matrix in Kelvin vector representation.
static double equivalentStress(Eigen::Matrix< double, KelvinVectorSize, 1 > const &deviatoric_v)
static double J3(Eigen::Matrix< double, KelvinVectorSize, 1 > const &deviatoric_v)