diff --git a/MaterialLib/SolidModels/Ehlers.cpp b/MaterialLib/SolidModels/Ehlers.cpp index a320087e1da65a85cd7a3d30333934b52b6a0b72..2cda03b5f9d2ec6f0171092093526a12cba008ac 100644 --- a/MaterialLib/SolidModels/Ehlers.cpp +++ b/MaterialLib/SolidModels/Ehlers.cpp @@ -9,9 +9,10 @@ #include "Ehlers.h" #include <boost/math/special_functions/pow.hpp> - #include "MathLib/LinAlg/Eigen/EigenMapTools.h" +#include "LinearElasticIsotropic.h" + /** * Common convenitions for naming: * x_D - deviatoric part of tensor x @@ -53,19 +54,6 @@ template <int DisplacementDim> MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> sOdotS( MathLib::KelvinVector::KelvinVectorType<DisplacementDim> const& v); -template <int DisplacementDim> -MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> -elasticTangentStiffness(double const K, double const G) -{ - using KelvinMatrix = - MathLib::KelvinVector::KelvinMatrixType<DisplacementDim>; - - KelvinMatrix tangentStiffness = KelvinMatrix::Zero(); - tangentStiffness.template topLeftCorner<3, 3>().setConstant(K - 2. / 3 * G); - tangentStiffness.noalias() += 2 * G * KelvinMatrix::Identity(); - return tangentStiffness; -} - template <int DisplacementDim> struct PhysicalStressWithInvariants final { @@ -527,7 +515,8 @@ SolidEhlers<DisplacementDim>::integrateStress( calculateIsotropicHardening(mp.kappa, mp.hardening_coefficient, state.eps_p.eff)) < 0)) { - tangentStiffness = elasticTangentStiffness<DisplacementDim>(mp.K, mp.G); + tangentStiffness = elasticTangentStiffness<DisplacementDim>( + mp.K - 2. / 3 * mp.G, mp.G); } else { diff --git a/MaterialLib/SolidModels/LinearElasticIsotropic.cpp b/MaterialLib/SolidModels/LinearElasticIsotropic.cpp index e28133f1c425211b6c55bc8a9494df9d72286e1c..23ea50f6e273fdacda830b7e22a7a87cc22fcde9 100644 --- a/MaterialLib/SolidModels/LinearElasticIsotropic.cpp +++ b/MaterialLib/SolidModels/LinearElasticIsotropic.cpp @@ -47,12 +47,8 @@ LinearElasticIsotropic<DisplacementDim>::getElasticTensor( double const t, ProcessLib::SpatialPosition const& x, double const /*T*/) const { - KelvinMatrix C = KelvinMatrix::Zero(); - - C.template topLeftCorner<3, 3>().setConstant(_mp.lambda(t, x)); - C.noalias() += 2 * _mp.mu(t, x) * KelvinMatrix::Identity(); - - return C; + return elasticTangentStiffness<DisplacementDim>(_mp.lambda(t, x), + _mp.mu(t, x)); } template class LinearElasticIsotropic<2>; diff --git a/MaterialLib/SolidModels/LinearElasticIsotropic.h b/MaterialLib/SolidModels/LinearElasticIsotropic.h index 5e9271dc0192cb4a000497de952495ebbd183ad6..ae1d1db22eeee3dbe0f09773e2404bbd357edaf8 100644 --- a/MaterialLib/SolidModels/LinearElasticIsotropic.h +++ b/MaterialLib/SolidModels/LinearElasticIsotropic.h @@ -133,5 +133,20 @@ protected: extern template class LinearElasticIsotropic<2>; extern template class LinearElasticIsotropic<3>; +template <int DisplacementDim> +MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> +elasticTangentStiffness(double const first_lame_parameter, + double const shear_modulus) +{ + using KelvinMatrix = + MathLib::KelvinVector::KelvinMatrixType<DisplacementDim>; + + KelvinMatrix tangentStiffness = KelvinMatrix::Zero(); + tangentStiffness.template topLeftCorner<3, 3>().setConstant( + first_lame_parameter); + tangentStiffness.noalias() += 2 * shear_modulus * KelvinMatrix::Identity(); + return tangentStiffness; +} + } // namespace Solids } // namespace MaterialLib