Skip to content
Snippets Groups Projects
Commit 4d5fce91 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MaL] KV; Add 2D case of fourth order rotation mat

With the assumption of e3 = z-axis being the third
basis vector in the 2D case.
parent 1b479c49
No related branches found
No related tags found
No related merge requests found
...@@ -180,8 +180,27 @@ kelvinVectorToSymmetricTensor(Eigen::Matrix<double, ...@@ -180,8 +180,27 @@ kelvinVectorToSymmetricTensor(Eigen::Matrix<double,
v.size()); v.size());
} }
KelvinMatrixType<3> fourthOrderRotationMatrix( template <>
Eigen::Matrix3d const& transformation) KelvinMatrixType<2> fourthOrderRotationMatrix<2>(
Eigen::Matrix<double, 2, 2> const& transformation)
{
// 1-based index access for convenience.
auto Q = [&](int const i, int const j) {
return transformation(i - 1, j - 1);
};
MathLib::KelvinVector::KelvinMatrixType<2> R;
R << Q(1, 1) * Q(1, 1), Q(1, 2) * Q(1, 2), 0,
std::sqrt(2) * Q(1, 1) * Q(1, 2), Q(2, 1) * Q(2, 1), Q(2, 2) * Q(2, 2),
0, std::sqrt(2) * Q(2, 1) * Q(2, 2), 0, 0, 1, 0,
std::sqrt(2) * Q(1, 1) * Q(2, 1), std::sqrt(2) * Q(1, 2) * Q(2, 2), 0,
Q(1, 1) * Q(2, 2) + Q(1, 2) * Q(2, 1);
return R;
}
template <>
KelvinMatrixType<3> fourthOrderRotationMatrix<3>(
Eigen::Matrix<double, 3, 3> const& transformation)
{ {
// 1-based index access for convenience. // 1-based index access for convenience.
auto Q = [&](int const i, int const j) { auto Q = [&](int const i, int const j) {
......
...@@ -238,8 +238,11 @@ KelvinVectorType<DisplacementDim> symmetricTensorToKelvinVector( ...@@ -238,8 +238,11 @@ KelvinVectorType<DisplacementDim> symmetricTensorToKelvinVector(
/// Rotation tensor for Kelvin mapped vectors and tensors. It is meant to be /// Rotation tensor for Kelvin mapped vectors and tensors. It is meant to be
/// used for rotation of stress/strain tensors epsilon:Q and tangent stiffness /// used for rotation of stress/strain tensors epsilon:Q and tangent stiffness
/// tensors Q*C*Q^t. /// tensors Q*C*Q^t.
KelvinMatrixType<3> fourthOrderRotationMatrix( /// 2D and 3D implementations available.
Eigen::Matrix3d const& transformation); template <int DisplacementDim>
KelvinMatrixType<DisplacementDim> fourthOrderRotationMatrix(
Eigen::Matrix<double, DisplacementDim, DisplacementDim> const&
transformation);
} // namespace KelvinVector } // namespace KelvinVector
} // namespace MathLib } // namespace MathLib
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment