OGS
LinearElasticOrthotropic.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <limits>
13
14#include "MechanicsBase.h"
16
17namespace MaterialLib
18{
19namespace Solids
20{
21template <int DisplacementDim>
22class LinearElasticOrthotropic : public MechanicsBase<DisplacementDim>
23{
24public:
26 {
28 constexpr double E(int const i) const
29 {
30 assert(i == 1 || i == 2 || i == 3);
31 return youngs_moduli[i - 1];
32 }
33
35 constexpr double G(int const i, int const j) const
36 {
37 assert(i == 1 || i == 2 || i == 3);
38 assert(j == 1 || j == 2 || j == 3);
39 if (i == 1 && j == 2)
40 {
41 return shear_moduli[0];
42 }
43 if (i == 2 && j == 3)
44 {
45 return shear_moduli[1];
46 }
47 if (i == 1 && j == 3)
48 {
49 return shear_moduli[2];
50 }
51
52 return std::numeric_limits<double>::quiet_NaN();
53 }
54
56 constexpr double nu(int const i, int const j) const
57 {
58 assert(i == 1 || i == 2 || i == 3);
59 assert(j == 1 || j == 2 || j == 3);
60 if (i == 1 && j == 2)
61 {
62 return poissons_ratios[0];
63 }
64 if (i == 2 && j == 3)
65 {
66 return poissons_ratios[1];
67 }
68 if (i == 1 && j == 3)
69 {
70 return poissons_ratios[2];
71 }
72
73 // The next set is scaled by Youngs modulus s.t.
74 // nu_ji = nu_ij * E_j/E_i.
75 if (i == 2 && j == 1)
76 {
77 return poissons_ratios[0] * E(i) / E(j);
78 }
79 if (i == 3 && j == 2)
80 {
81 return poissons_ratios[1] * E(i) / E(j);
82 }
83 if (i == 3 && j == 1)
84 {
85 return poissons_ratios[2] * E(i) / E(j);
86 }
87
88 return std::numeric_limits<double>::quiet_NaN();
89 }
90
91 std::array<double, 3> youngs_moduli;
92 std::array<double, 3> shear_moduli;
93 std::array<double, 3> poissons_ratios;
94 };
95
98 {
101
102 MaterialProperties(P const& youngs_moduli_, P const& shear_moduli_,
103 P const& poissons_ratios_)
104 : youngs_moduli(youngs_moduli_),
105 shear_moduli(shear_moduli_),
106 poissons_ratios(poissons_ratios_)
107 {
108 }
109
111 double const t, ParameterLib::SpatialPosition const& x) const
112 {
113 auto const E = youngs_moduli(t, x);
114 auto const G = shear_moduli(t, x);
115 auto const nu = poissons_ratios(t, x);
116 return {
117 {E[0], E[1], E[2]}, {G[0], G[1], G[2]}, {nu[0], nu[1], nu[2]}};
118 }
119
122 P const& poissons_ratios; // Stored as nu_12, nu_23, nu_13
123 };
124
125public:
126 static int const KelvinVectorSize =
132
134 MaterialProperties material_properties,
135 std::optional<ParameterLib::CoordinateSystem> const&
136 local_coordinate_system)
137 : _mp(std::move(material_properties)),
138 _local_coordinate_system(local_coordinate_system)
139 {
140 }
141
143 double const /*t*/,
145 double const /*dt*/,
146 KelvinVector const& eps,
147 KelvinVector const& sigma,
149 MaterialStateVariables const& /* material_state_variables */)
150 const override
151 {
152 return eps.dot(sigma) / 2;
153 }
154
155 std::optional<
156 std::tuple<typename MechanicsBase<DisplacementDim>::KelvinVector,
157 std::unique_ptr<typename MechanicsBase<
158 DisplacementDim>::MaterialStateVariables>,
161 MaterialPropertyLib::VariableArray const& variable_array_prev,
162 MaterialPropertyLib::VariableArray const& variable_array,
163 double const t, ParameterLib::SpatialPosition const& x,
164 double const /*dt*/,
166 material_state_variables) const override;
167
168 KelvinMatrix getElasticTensor(double const t,
170 double const T) const;
171
173
174 double getBulkModulus(double const t,
176 KelvinMatrix const* const /*C*/) const override
177 {
178 auto const& mp = _mp.evaluate(t, x);
179 auto const E = [&mp](int const i) { return mp.E(i); };
180 auto const nu = [&mp](int const i, int const j) { return mp.nu(i, j); };
181 // corresponds to 1/(I:S:I) --> Reuss bound.
182 // Voigt bound would proceed as (I:C:I)/9. Use MFront model if you
183 // prefer that.
184 return E(1) * E(2) * E(3) /
185 (E(1) * E(2) + E(1) * E(3) * (1 - 2 * nu(2, 3)) +
186 E(2) * E(3) * (1 - 2 * nu(1, 2) * nu(1, 3)));
187 }
188
189protected:
191 std::optional<ParameterLib::CoordinateSystem> const&
193};
194
195extern template class LinearElasticOrthotropic<2>;
196extern template class LinearElasticOrthotropic<3>;
197
198} // namespace Solids
199} // namespace MaterialLib
double getBulkModulus(double const t, ParameterLib::SpatialPosition const &x, KelvinMatrix const *const) const override
LinearElasticOrthotropic(MaterialProperties material_properties, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system)
double computeFreeEnergyDensity(double const, ParameterLib::SpatialPosition const &, double const, KelvinVector const &eps, KelvinVector const &sigma, typename MechanicsBase< DisplacementDim >::MaterialStateVariables const &) const override
std::optional< ParameterLib::CoordinateSystem > const & _local_coordinate_system
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
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
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor > KelvinMatrixType
constexpr double G(int const i, int const j) const
Shear moduli for 1-based indices.
constexpr double E(int const i) const
Youngs moduli for 1-based indices.
constexpr double nu(int const i, int const j) const
Poisson's ratios for 1-based indices.
EvaluatedMaterialProperties evaluate(double const t, ParameterLib::SpatialPosition const &x) const
MaterialProperties(P const &youngs_moduli_, P const &shear_moduli_, P const &poissons_ratios_)
MathLib::KelvinVector::KelvinMatrixType< DisplacementDim > KelvinMatrix