11#include <dune/common/float_cmp.hh>
26 C(0, 0) = C(1, 1) = 1;
27 C(0, 1) = C(1, 0) = nu;
28 C(2, 2) = (1 - nu) / 2;
29 C *= E / (1 - nu * nu);
41 Eigen::Matrix<double, 6, 6> C;
43 C(0, 0) = C(1, 1) = C(2, 2) = 1 - nu;
44 C(0, 1) = C(1, 0) = C(2, 0) = C(0, 2) = C(1, 2) = C(2, 1) = nu;
45 C(3, 3) = C(4, 4) = C(5, 5) = (1 - 2 * nu) / 2;
46 C *= E / ((1 + nu) * (1 - 2 * nu));
100 std::is_same_v<MP, YoungsModulusAndPoissonsRatio> or std::is_same_v<MP, YoungsModulusAndBulkModulus> or
101 std::is_same_v<MP, YoungsModulusAndLamesFirstParameter> or std::is_same_v<MP, BulkModulusAndLamesFirstParameter> or
102 std::is_same_v<MP, LamesFirstParameterAndShearModulus> or std::is_same_v<MP, YoungsModulusAndShearModulus>;
109template <
typename ValuePair>
113 requires(!std::is_same_v<ValuePair, YoungsModulusAndLamesFirstParameter> and
114 !std::is_same_v<ValuePair, BulkModulusAndLamesFirstParameter> and
115 !std::is_same_v<ValuePair, LamesFirstParameterAndShearModulus>)
117 if constexpr (std::is_same_v<ValuePair, YoungsModulusAndPoissonsRatio>) {
118 const auto& E = vp_.emodul;
119 const auto& nu = vp_.nu;
120 return Dune::FloatCmp::eq(nu, 0.5) ? std::numeric_limits<double>::infinity()
121 : E * nu / ((1.0 + nu) * (1.0 - 2.0 * nu));
122 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndShearModulus>) {
123 const auto& E = vp_.emodul;
124 const auto& mu = vp_.mu;
125 return mu * (E - 2.0 * mu) / (3.0 * mu - E);
126 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndBulkModulus>) {
127 const auto& E = vp_.emodul;
128 const auto& K = vp_.K;
129 return 3.0 * K * (3.0 * K - E) / (9.0 * K - E);
131 assert(
false &&
"Your LameParameter request is not implemented");
135 requires(!std::is_same_v<ValuePair, YoungsModulusAndBulkModulus> and
136 !std::is_same_v<ValuePair, BulkModulusAndLamesFirstParameter>)
138 if constexpr (std::is_same_v<ValuePair, YoungsModulusAndPoissonsRatio>) {
139 const auto& E = vp_.emodul;
140 const auto& nu = vp_.nu;
141 return E / (3.0 * (1.0 - 2.0 * nu));
142 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndShearModulus>) {
143 const auto& E = vp_.emodul;
144 const auto& mu = vp_.mu;
145 return E * mu / (3.0 * (3.0 * mu - E));
146 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndLamesFirstParameter>) {
147 const auto& E = vp_.emodul;
148 const auto& lambda = vp_.lambda;
149 return (E + 3.0 * lambda + calcR(vp_)) / 6.0;
150 }
else if constexpr (std::is_same_v<ValuePair, LamesFirstParameterAndShearModulus>) {
151 const auto& lambda = vp_.lambda;
152 const auto& mu = vp_.mu;
153 return lambda + 2.0 * mu / 3.0;
155 assert(
false &&
"Your LameParameter request is not implemented");
159 requires(!std::is_same_v<ValuePair, YoungsModulusAndShearModulus> and
160 !std::is_same_v<ValuePair, LamesFirstParameterAndShearModulus>)
162 if constexpr (std::is_same_v<ValuePair, YoungsModulusAndPoissonsRatio>) {
163 const auto& E = vp_.emodul;
164 const auto& nu = vp_.nu;
165 return E / (2.0 * (1.0 + nu));
166 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndBulkModulus>) {
167 const auto& E = vp_.emodul;
168 const auto& K = vp_.K;
169 return 3.0 * K * E / (9.0 * K - E);
170 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndLamesFirstParameter>) {
171 const auto& E = vp_.emodul;
172 const auto& lambda = vp_.lambda;
173 return (E - 3.0 * lambda + calcR(vp_)) / 4.0;
174 }
else if constexpr (std::is_same_v<ValuePair, BulkModulusAndLamesFirstParameter>) {
175 const auto& K = vp_.K;
176 const auto& lambda = vp_.lambda;
177 return 3.0 * (K - lambda) / 2.0;
179 assert(
false &&
"Your LameParameter request is not implemented");
183 if constexpr (std::is_same_v<ValuePair, YoungsModulusAndPoissonsRatio>) {
184 const auto& E = vp_.emodul;
185 const auto& nu = vp_.nu;
186 return E * (1.0 - nu) / ((1.0 + nu) * (1.0 - 2.0 * nu));
187 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndShearModulus>) {
188 const auto& E = vp_.emodul;
189 const auto& mu = vp_.mu;
190 return mu * (4.0 * mu - E) / (3.0 * mu - E);
191 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndBulkModulus>) {
192 const auto& E = vp_.emodul;
193 const auto& K = vp_.K;
194 return 3.0 * K * (3.0 * K + E) / (9.0 * K - E);
195 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndLamesFirstParameter>) {
196 const auto& E = vp_.emodul;
197 const auto& lambda = vp_.lambda;
198 return (E - lambda + calcR(vp_)) / 2.0;
199 }
else if constexpr (std::is_same_v<ValuePair, BulkModulusAndLamesFirstParameter>) {
200 const auto& K = vp_.K;
201 const auto& lambda = vp_.lambda;
202 return 3.0 * K - 2.0 * lambda;
203 }
else if constexpr (std::is_same_v<ValuePair, LamesFirstParameterAndShearModulus>) {
204 const auto& lambda = vp_.lambda;
205 const auto& mu = vp_.mu;
206 return lambda + 2.0 * mu;
208 assert(
false &&
"Your LameParameter request is not implemented");
212 requires(!std::is_same_v<ValuePair, YoungsModulusAndPoissonsRatio>)
214 if constexpr (std::is_same_v<ValuePair, YoungsModulusAndShearModulus>) {
215 const auto& E = vp_.emodul;
216 const auto& mu = vp_.mu;
217 return E / (2.0 * mu) - 1.0;
218 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndBulkModulus>) {
219 const auto& E = vp_.emodul;
220 const auto& K = vp_.K;
221 return (3.0 * K - E) / (6.0 * K);
222 }
else if constexpr (std::is_same_v<ValuePair, YoungsModulusAndLamesFirstParameter>) {
223 const auto& E = vp_.emodul;
224 const auto& lambda = vp_.lambda;
225 return 2.0 * lambda / (E + lambda + calcR(vp_));
226 }
else if constexpr (std::is_same_v<ValuePair, BulkModulusAndLamesFirstParameter>) {
227 const auto& K = vp_.K;
228 const auto& lambda = vp_.lambda;
229 return lambda / (3 * K - lambda);
230 }
else if constexpr (std::is_same_v<ValuePair, LamesFirstParameterAndShearModulus>) {
231 const auto& lambda = vp_.lambda;
232 const auto& mu = vp_.mu;
233 return lambda / (2.0 * (lambda + mu));
235 assert(
false &&
"Your LameParameter request is not implemented");
239 requires(!std::is_same_v<ValuePair, YoungsModulusAndPoissonsRatio> and
240 !std::is_same_v<ValuePair, YoungsModulusAndShearModulus> and
241 !std::is_same_v<ValuePair, YoungsModulusAndBulkModulus> and
242 !std::is_same_v<ValuePair, YoungsModulusAndLamesFirstParameter>)
244 if constexpr (std::is_same_v<ValuePair, BulkModulusAndLamesFirstParameter>) {
245 return 9.0 * vp_.K * (vp_.K - vp_.lambda) / (3.0 * vp_.K - vp_.lambda);
246 }
else if constexpr (std::is_same_v<ValuePair, LamesFirstParameterAndShearModulus>) {
247 const auto& lambda = vp_.lambda;
248 const auto& mu = vp_.mu;
249 return mu * (3.0 * lambda + 2.0 * mu) / (lambda + mu);
251 assert(
false &&
"Your LameParameter request is not implemented");
270 ConvertLameConstants(
const ValuePair& valuePair)
273 double calcR(
const YoungsModulusAndLamesFirstParameter& valuePair) {
274 const auto& E = valuePair.emodul;
275 const auto& lambda = valuePair.lambda;
276 return std::sqrt(E * E + 9 * lambda * lambda + 2 * E * lambda);
Definition: simpleassemblers.hh:22
auto toLamesFirstParameterAndShearModulus(const YoungsModulusAndPoissonsRatio &matParameter)
Converts Young's modulus and Poisson's ratio to Lame's first parameter and shear modulus.
Definition: physicshelper.hh:307
auto toYoungsModulusAndPoissonsRatio(const LamesFirstParameterAndShearModulus &matParameter)
Converts Lame's first parameter and shear modulus to Young's modulus and Poisson's ratio.
Definition: physicshelper.hh:320
ConvertLameConstants< YoungsModulusAndPoissonsRatio > convertLameConstants(const YoungsModulusAndPoissonsRatio &valuePair)
Definition: physicshelper.hh:280
Eigen::Matrix3d planeStressLinearElasticMaterialTangent(double E, double nu)
Computes the plane stress linear elastic material tangent matrix.
Definition: physicshelper.hh:23
Eigen::Matrix< double, 6, 6 > linearElasticMaterialTangent3D(double E, double nu)
Computes the 3D linear elastic material tangent matrix.
Definition: physicshelper.hh:40
Structure representing Young's modulus and shear modulus.
Definition: physicshelper.hh:53
double emodul
Definition: physicshelper.hh:54
double nu
Definition: physicshelper.hh:55
Structure representing Young's modulus and bulk modulus.
Definition: physicshelper.hh:60
double mu
Definition: physicshelper.hh:62
double emodul
Definition: physicshelper.hh:61
Structure representing Young's modulus and Lame's first parameter.
Definition: physicshelper.hh:67
double emodul
Definition: physicshelper.hh:68
double K
Definition: physicshelper.hh:69
Structure representing bulk modulus and Lame's first parameter.
Definition: physicshelper.hh:74
double lambda
Definition: physicshelper.hh:76
double emodul
Definition: physicshelper.hh:75
Structure representing Lame's first parameter and shear modulus.
Definition: physicshelper.hh:81
double K
Definition: physicshelper.hh:82
double lambda
Definition: physicshelper.hh:83
Definition: physicshelper.hh:88
double lambda
Definition: physicshelper.hh:89
double mu
Definition: physicshelper.hh:90
Conversion utility for Lame's constants.
Definition: physicshelper.hh:111
constexpr double toYoungsModulus()
Definition: physicshelper.hh:238
constexpr double toBulkModulus()
Definition: physicshelper.hh:134
constexpr double toPoissonsRatio()
Definition: physicshelper.hh:211
friend ConvertLameConstants< YoungsModulusAndPoissonsRatio > convertLameConstants(const YoungsModulusAndPoissonsRatio &valuePair)
Definition: physicshelper.hh:280
constexpr double toLamesFirstParameter()
Definition: physicshelper.hh:112
constexpr double toPWaveModulus()
Definition: physicshelper.hh:182
constexpr double toShearModulus()
Definition: physicshelper.hh:158
Concept for checking if a type is a valid material parameter tuple.
Definition: physicshelper.hh:99