OGS
LinearElasticOrthotropic.cpp
Go to the documentation of this file.
1
11
12#include <Eigen/LU>
13
15
16namespace MPL = MaterialPropertyLib;
17
18namespace MaterialLib
19{
20namespace Solids
21{
22template <int DisplacementDim>
23std::optional<std::tuple<typename MechanicsBase<DisplacementDim>::KelvinVector,
24 std::unique_ptr<typename MechanicsBase<
25 DisplacementDim>::MaterialStateVariables>,
28 MaterialPropertyLib::VariableArray const& variable_array_prev,
29 MaterialPropertyLib::VariableArray const& variable_array, double const t,
30 ParameterLib::SpatialPosition const& x, double const /*dt*/,
32 MaterialStateVariables const& /*material_state_variables*/) const
33{
34 auto const& eps_m = std::get<MPL::SymmetricTensor<DisplacementDim>>(
35 variable_array.mechanical_strain);
36 auto const& eps_m_prev = std::get<MPL::SymmetricTensor<DisplacementDim>>(
37 variable_array_prev.mechanical_strain);
38 auto const& sigma_prev = std::get<MPL::SymmetricTensor<DisplacementDim>>(
39 variable_array_prev.stress);
40 auto const& T = variable_array_prev.temperature;
41
42 KelvinMatrix C = getElasticTensor(t, x, T);
43
44 KelvinVector sigma = sigma_prev + C * (eps_m - eps_m_prev);
45
46 return {std::make_tuple(
47 sigma,
48 std::make_unique<
50 C)};
51}
52
53template <int DisplacementDim>
56 double const t, ParameterLib::SpatialPosition const& x,
57 double const /*T*/) const
58{
59 using namespace MathLib::KelvinVector;
60
61 auto const& mp = _mp.evaluate(t, x);
62 auto const E = [&mp](int const i) { return mp.E(i); };
63 auto const G = [&mp](int const i, int const j) { return mp.G(i, j); };
64 auto const nu = [&mp](int const i, int const j) { return mp.nu(i, j); };
65
67 // clang-format off
68 S_ortho.template topLeftCorner<3, 3>() <<
69 1. / E(1), -nu(2, 1) / E(2), -nu(3, 1) / E(3),
70 -nu(1, 2) / E(1), 1. / E(2), -nu(3, 2) / E(3),
71 -nu(1, 3) / E(1), -nu(2, 3) / E(2), 1. / E(3);
72
73 S_ortho.template bottomRightCorner<3, 3>().diagonal() <<
74 1. / (2 * G(1, 2)),
75 1. / (2 * G(2, 3)),
76 1. / (2 * G(1, 3));
77 // clang-format on
78
79 KelvinMatrixType<3> const C_ortho = S_ortho.inverse();
80 auto const Q = [this, &x]() -> KelvinMatrixType<3>
81 {
82 if (!_local_coordinate_system)
83 {
85 }
86 Eigen::Matrix3d R = Eigen::Matrix3d::Identity();
87 R.template topLeftCorner<DisplacementDim, DisplacementDim>().noalias() =
88 _local_coordinate_system->transformation<DisplacementDim>(x);
89 return fourthOrderRotationMatrix(R);
90 }();
91
92 // Rotate the forth-order tenser in Kelvin mapping with Q*C_ortho*Q^T and
93 // return the top left corner block of size 4x4 for two-dimensional case or
94 // the full 6x6 matrix is returned in the three-dimensional case.
95 return (Q * C_ortho * Q.transpose())
96 .template topLeftCorner<kelvin_vector_dimensions(DisplacementDim),
97 kelvin_vector_dimensions(DisplacementDim)>();
98}
99
100template class LinearElasticOrthotropic<2>;
101template class LinearElasticOrthotropic<3>;
102
103} // namespace Solids
104} // namespace MaterialLib
MathLib::KelvinVector::KelvinMatrixType< DisplacementDim > KelvinMatrix
std::optional< std::tuple< typename MechanicsBase< DisplacementDim >::KelvinVector, std::unique_ptr< typename MechanicsBase< DisplacementDim >::MaterialStateVariables >, typename MechanicsBase< DisplacementDim >::KelvinMatrix > > integrateStress(MaterialPropertyLib::VariableArray const &variable_array_prev, MaterialPropertyLib::VariableArray const &variable_array, double const t, ParameterLib::SpatialPosition const &x, double const, typename MechanicsBase< DisplacementDim >::MaterialStateVariables const &material_state_variables) const override
MathLib::KelvinVector::KelvinVectorType< DisplacementDim > KelvinVector
KelvinMatrix getElasticTensor(double const t, ParameterLib::SpatialPosition const &x, double const T) const
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor > KelvinMatrixType
MathLib::KelvinVector::KelvinMatrixType< DisplacementDim > KelvinMatrix