34 namespace ContinuumMechanics::CommonConstitutiveModels {
122 const double fc = 0 );
135 template <
typename T >
146 template <
typename T >
155 const double e2 =
e *
e;
156 const T cosTheta = cos( theta );
157 const T cos2Theta = cosTheta * cosTheta;
159 const T numerator = ( 4. * ( 1. - e2 ) * cos2Theta + ( 2. *
e - 1. ) * ( 2. *
e - 1. ) );
160 const T denominator = ( 2. * ( 1. - e2 ) * cosTheta +
161 ( 2. *
e - 1. ) * sqrt( 4. * ( 1. - e2 ) * cos2Theta + 5. * e2 - 4. *
e ) );
163 const T r = numerator / denominator;
172 template <
typename T >
183 template <
typename T >
195 return std::make_pair( r, dRdTheta );
198 const double e2 =
e *
e;
199 const T cosTheta = cos( theta );
200 const T cos2Theta = cosTheta * cosTheta;
202 T numerator = ( 4. * ( 1. - e2 ) * cos2Theta + ( 2. *
e - 1. ) * ( 2. *
e - 1. ) );
203 T denominator = ( 2. * ( 1. - e2 ) * cosTheta +
204 ( 2. *
e - 1. ) * sqrt( 4. * ( 1. - e2 ) * cos2Theta + 5. * e2 - 4. *
e ) );
206 r = numerator / denominator;
209 const T sinTheta = sin( theta );
211 const T a = numerator;
212 const T b = 1. / denominator;
213 const T aux = 4. * ( 1. - e2 ) * cos2Theta + 5. * e2 - 4. *
e;
214 const T dAuxdTheta = 4. * ( 1. - e2 ) * 2. * cosTheta * -sinTheta;
215 const T dadTheta = 2. * cosTheta * ( -sinTheta ) * 4. * ( 1. - e2 );
216 const T dbdTheta = -pow( denominator, -2. ) * ( 2. * ( 1. - e2 ) * -sinTheta +
217 ( 2. *
e - 1 ) * 1. / 2 * pow( aux, -1. / 2 ) * dAuxdTheta );
218 dRdTheta = b * dadTheta + a * dbdTheta;
220 return { r, dRdTheta };
223 template <
typename T >
227 const auto [r, dr_dTheta] = dPolarRadius_dTheta< T >( theta,
e );
229 return { r, dr_dTheta, 0 };
232 const double e2 = pow(
e, 2 );
233 const double e2m1 = e2 - 1;
234 const double tem1 = 2 *
e - 1;
236 const T cos_theta = cos( theta );
237 const T sin_theta = sin( theta );
238 const T cos_2_theta = cos_theta * cos_theta;
239 const T sin_2_theta = sin_theta * sin_theta;
241 const T x = 5. * e2 - 4. *
e - 4. * e2m1 * cos_2_theta;
242 const T sqrt_x = sqrt( x );
244 const T one_over_sqrt_x = 1. / sqrt_x;
246 const T d2r_dTheta2 = e2m1 *
247 ( -16. * e2m1 * ( 4.0 * tem1 * one_over_sqrt_x * cos_theta + 2. ) * sin_2_theta *
248 cos_theta / ( tem1 * sqrt_x - 2 * e2m1 * cos_theta ) -
249 8. * sin_2_theta + 8. * cos_2_theta +
250 ( pow( 2. *
e - 1., 2 ) - 4 * e2m1 * cos_2_theta ) *
251 ( 16.0 * tem1 * e2m1 * pow( x, -1.5 ) * sin_2_theta * cos_2_theta +
252 4.0 * tem1 * one_over_sqrt_x * sin_2_theta -
253 4.0 * tem1 * one_over_sqrt_x * cos_2_theta +
254 e2m1 * ( 4.0 * tem1 * one_over_sqrt_x * cos_theta + 2. ) *
255 ( 8.0 * tem1 * one_over_sqrt_x * cos_theta + 4. ) * sin_2_theta /
256 ( tem1 * sqrt_x - 2. * e2m1 * cos_theta ) -
258 ( tem1 * sqrt_x - 2. * e2m1 * cos_theta ) ) /
259 ( tem1 * sqrt_x - 2. * e2m1 * cos_theta );
261 return { r, dr_dTheta, d2r_dTheta2 };
272 template <
typename T >
274 const double varEps = 0.0 )
const
294 template <
typename T >
297 const double varEps = 0.0 )
const
301 T dFdXi, dFdRho, dFdTheta;
304 if ( varEps == 0.0 ) {
309 const T auxTerm1 =
param.
m * 0.5 *
314 dFdTheta = auxTerm1 * hw.
rho * dRdTheta_;
317 return { dFdXi, dFdRho, dFdTheta };
328 return varEps * 2 * std::sin( psi );
335 static inline double e(
const double fc,
const double ft ) {
return (
fc + 2 *
ft ) / ( 2 *
fc +
ft ); }
341 static inline double c(
const double fc,
const double ft )
343 const double phi_ =
phi(
fc,
ft );
344 return ft * ( 1 + std::sin( phi_ ) ) / ( 2 + std::cos( phi_ ) );
351 static inline double phi(
const double fc,
const double ft ) {
return std::asin( (
fc -
ft ) / (
fc +
ft ) ); }
356 static inline double ft(
const double c,
const double phi )
358 return 2 *
c * std::cos(
phi ) / ( 1 + std::sin(
phi ) );
364 static inline double fc(
const double c,
const double phi )
366 return 2 *
c * std::cos(
phi ) / ( 1 - std::sin(
phi ) );