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

[MatL] Solids; Extract elasticTangentStiffness().

Same function is used in Ehlers and in the LinearElasticIsotropic.
parent 5744cd1e
No related branches found
No related tags found
No related merge requests found
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
#include "Ehlers.h" #include "Ehlers.h"
#include <boost/math/special_functions/pow.hpp> #include <boost/math/special_functions/pow.hpp>
#include "MathLib/LinAlg/Eigen/EigenMapTools.h" #include "MathLib/LinAlg/Eigen/EigenMapTools.h"
#include "LinearElasticIsotropic.h"
/** /**
* Common convenitions for naming: * Common convenitions for naming:
* x_D - deviatoric part of tensor x * x_D - deviatoric part of tensor x
...@@ -53,19 +54,6 @@ template <int DisplacementDim> ...@@ -53,19 +54,6 @@ template <int DisplacementDim>
MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> sOdotS( MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> sOdotS(
MathLib::KelvinVector::KelvinVectorType<DisplacementDim> const& v); 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> template <int DisplacementDim>
struct PhysicalStressWithInvariants final struct PhysicalStressWithInvariants final
{ {
...@@ -527,7 +515,8 @@ SolidEhlers<DisplacementDim>::integrateStress( ...@@ -527,7 +515,8 @@ SolidEhlers<DisplacementDim>::integrateStress(
calculateIsotropicHardening(mp.kappa, mp.hardening_coefficient, calculateIsotropicHardening(mp.kappa, mp.hardening_coefficient,
state.eps_p.eff)) < 0)) state.eps_p.eff)) < 0))
{ {
tangentStiffness = elasticTangentStiffness<DisplacementDim>(mp.K, mp.G); tangentStiffness = elasticTangentStiffness<DisplacementDim>(
mp.K - 2. / 3 * mp.G, mp.G);
} }
else else
{ {
......
...@@ -47,12 +47,8 @@ LinearElasticIsotropic<DisplacementDim>::getElasticTensor( ...@@ -47,12 +47,8 @@ LinearElasticIsotropic<DisplacementDim>::getElasticTensor(
double const t, ProcessLib::SpatialPosition const& x, double const t, ProcessLib::SpatialPosition const& x,
double const /*T*/) const double const /*T*/) const
{ {
KelvinMatrix C = KelvinMatrix::Zero(); return elasticTangentStiffness<DisplacementDim>(_mp.lambda(t, x),
_mp.mu(t, x));
C.template topLeftCorner<3, 3>().setConstant(_mp.lambda(t, x));
C.noalias() += 2 * _mp.mu(t, x) * KelvinMatrix::Identity();
return C;
} }
template class LinearElasticIsotropic<2>; template class LinearElasticIsotropic<2>;
......
...@@ -133,5 +133,20 @@ protected: ...@@ -133,5 +133,20 @@ protected:
extern template class LinearElasticIsotropic<2>; extern template class LinearElasticIsotropic<2>;
extern template class LinearElasticIsotropic<3>; 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 Solids
} // namespace MaterialLib } // namespace MaterialLib
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