239 int nb_integration_pts = getGaussPts().size2();
247 dataAtPts->hAtPts.resize(9, nb_integration_pts,
false);
248 dataAtPts->hdOmegaAtPts.resize(9 * 3, nb_integration_pts,
false);
249 dataAtPts->hdLogStretchAtPts.resize(9 * 6, nb_integration_pts,
false);
250 dataAtPts->leviKirchhoffAtPts.resize(3, nb_integration_pts,
false);
251 dataAtPts->leviKirchhoffPAtPts.resize(9 * 3, nb_integration_pts,
false);
252 dataAtPts->leviKirchhoffOmegaAtPts.resize(9, nb_integration_pts,
false);
254 dataAtPts->adjointPdstretchAtPts.resize(9, nb_integration_pts,
false);
259 dataAtPts->rotMatAtPts.resize(9, nb_integration_pts,
false);
260 dataAtPts->diffRotMatAtPts.resize(27, nb_integration_pts,
false);
261 dataAtPts->stretchTensorAtPts.resize(6, nb_integration_pts,
false);
262 dataAtPts->diffStretchTensorAtPts.resize(36, nb_integration_pts,
false);
263 dataAtPts->eigenVals.resize(3, nb_integration_pts,
false);
264 dataAtPts->eigenVecs.resize(9, nb_integration_pts,
false);
265 dataAtPts->nbUniq.resize(nb_integration_pts,
false);
267 dataAtPts->logStretch2H1AtPts.resize(6, nb_integration_pts,
false);
268 dataAtPts->logStretchTotalTensorAtPts.resize(6, nb_integration_pts,
false);
270 auto t_h = getFTensor2FromMat<3, 3>(
dataAtPts->hAtPts);
271 auto t_h_domega = getFTensor3FromMat<3, 3, 3>(
dataAtPts->hdOmegaAtPts);
273 getFTensor3FromMat<3, 3, size_symm>(
dataAtPts->hdLogStretchAtPts);
274 auto t_levi_kirchoff = getFTensor1FromMat<3>(
dataAtPts->leviKirchhoffAtPts);
275 auto t_levi_kirchoff_dP =
276 getFTensor3FromMat<3, 3, 3>(
dataAtPts->leviKirchhoffPAtPts);
277 auto t_levi_kirchoff_domega =
278 getFTensor2FromMat<3, 3>(
dataAtPts->leviKirchhoffOmegaAtPts);
279 auto t_approx_P_adjont_dstretch =
280 getFTensor2FromMat<3, 3>(
dataAtPts->adjointPdstretchAtPts);
281 auto t_approx_P_adjont_log_du =
282 getFTensor1FromMat<size_symm>(
dataAtPts->adjointPdUAtPts);
283 auto t_approx_P_adjont_log_du_dP =
284 getFTensor3FromMat<3, 3, size_symm>(
dataAtPts->adjointPdUdPAtPts);
285 auto t_approx_P_adjont_log_du_domega =
286 getFTensor2FromMat<3, size_symm>(
dataAtPts->adjointPdUdOmegaAtPts);
287 auto t_omega = getFTensor1FromMat<3>(
dataAtPts->rotAxisAtPts);
288 auto t_R = getFTensor2FromMat<3, 3>(
dataAtPts->rotMatAtPts);
289 auto t_diff_R = getFTensor3FromMat<3, 3, 3>(
dataAtPts->diffRotMatAtPts);
291 getFTensor2SymmetricFromMat<3>(
dataAtPts->logStretchTensorAtPts);
292 auto t_u = getFTensor2SymmetricFromMat<3>(
dataAtPts->stretchTensorAtPts);
293 auto t_approx_P = getFTensor2FromMat<3, 3>(
dataAtPts->approxPAtPts);
295 getFTensor4DdgFromMat<3, 3, 1>(
dataAtPts->diffStretchTensorAtPts);
296 auto t_eigen_vals = getFTensor1FromMat<3>(
dataAtPts->eigenVals);
297 auto t_eigen_vecs = getFTensor2FromMat<3, 3>(
dataAtPts->eigenVecs);
300 auto t_grad_h1 = getFTensor2FromMat<3, 3>(
dataAtPts->wGradH1AtPts);
301 auto t_log_stretch_total =
302 getFTensor2SymmetricFromMat<3>(
dataAtPts->logStretchTotalTensorAtPts);
304 getFTensor2SymmetricFromMat<3>(
dataAtPts->logStretch2H1AtPts);
307 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
329 auto calculate_rotation = [&]() {
333 t_diff_R(
i,
j,
k) = t0_diff(
i,
j,
k);
334 t_R(
i,
j) = t0(
i,
j);
337 auto calculate_stretch = [&]() {
340 t_u(
i,
j) = t_log_u(
i,
j) + t_kd_sym(
i,
j);
341 t_diff_u(
i,
j,
k,
l) = (t_kd_sym(
i,
k) ^ t_kd_sym(
j,
l)) / 4.;
342 t_Ldiff_u(
i,
j,
L) = t_diff_u(
i,
j,
m,
n) * t_L(
m,
n,
L);
344 eigen_vec(
i,
j) = t_log_u(
i,
j);
347 nbUniq[gg] = get_uniq_nb<3>(&eig(0));
348 if (nbUniq[gg] < 3) {
349 sort_eigen_vals<3>(eig, eigen_vec);
351 t_eigen_vals(
i) = eig(
i);
352 t_eigen_vecs(
i,
j) = eigen_vec(
i,
j);
355 t_u(
i,
j) = t_u_tmp(
i,
j);
359 t_diff_u(
i,
j,
k,
l) = t_diff_u_tmp(
i,
j,
k,
l);
360 t_Ldiff_u(
i,
j,
L) = t_diff_u(
i,
j,
m,
n) * t_L(
m,
n,
L);
364 calculate_rotation();
375 t_Ru(
i,
m) = t_R(
i,
l) * t_u(
l,
m);
376 t_h(
i,
j) = t_Ru(
i,
m) * t_h1(
m,
j);
377 t_h_domega(
i,
j,
k) = (t_diff_R(
i,
l,
k) * t_u(
l,
m)) * t_h1(
m,
j);
378 t_h_dlog_u(
i,
j,
L) = (t_R(
i,
l) * t_Ldiff_u(
l,
m,
L)) * t_h1(
m,
j);
381 t_approx_P_intermidiate(
i,
m) = t_approx_P(
i,
j) * t_h1(
m,
j);
382 t_approx_P_adjont_dstretch(
l,
m) =
383 t_approx_P_intermidiate(
i,
m) * t_R(
i,
l);
387 t_levi_kirchoff_dP(
i,
j,
k) =
389 t_levi_kirchoff_domega(
k,
n) =
391 (t_approx_P_intermidiate(
i,
m) * t_diff_R(
i,
l,
n));
393 t_approx_P_adjont_log_du(
L) =
394 t_Ldiff_u(
l,
m,
L) * t_approx_P_adjont_dstretch(
l,
m);
395 t_approx_P_adjont_log_du_dP(
i,
j,
L) = t_h_dlog_u(
i,
j,
L);
396 t_approx_P_adjont_log_du_domega(
n,
L) =
398 (t_approx_P_intermidiate(
i,
m) * t_diff_R(
i,
l,
n));
407 t_Omega(
i,
j) = FTensor::levi_civita<double>(
i,
j,
k) * t_omega(
k);
408 t_Ru(
i,
m) = t_Omega(
i,
m) + t_u(
i,
m);
409 t_h(
i,
j) = t_Ru(
i,
m) * t_h1(
m,
j);
410 t_h_domega(
i,
j,
k) =
411 FTensor::levi_civita<double>(
i,
m,
k) * t_h1(
m,
j);
412 t_h_dlog_u(
i,
j,
L) = t_Ldiff_u(
i,
m,
L) * t_h1(
m,
j);
415 t_approx_P_intermidiate(
i,
m) = t_approx_P(
i,
j) * t_h1(
m,
j);
416 t_approx_P_adjont_dstretch(
i,
m) = t_approx_P_intermidiate(
i,
m);
421 t_levi_kirchoff_domega(
k,
n) = 0;
423 t_approx_P_adjont_log_du(
L) =
424 t_Ldiff_u(
i,
m,
L) * t_approx_P_adjont_dstretch(
i,
m);
425 t_approx_P_adjont_log_du_dP(
i,
j,
L) = t_h_dlog_u(
i,
j,
L);
426 t_approx_P_adjont_log_du_domega(
n,
L) = 0;
438 t_Omega(
i,
j) = FTensor::levi_civita<double>(
i,
j,
k) * t_omega(
k);
439 t_h(
i,
j) = t_Omega(
i,
j) + t_u(
i,
j);
440 t_h_domega(
i,
j,
k) = FTensor::levi_civita<double>(
i,
j,
k);
441 t_h_dlog_u(
i,
j,
L) = t_Ldiff_u(
i,
j,
L);
446 t_levi_kirchoff_domega(
k,
l) = 0;
448 t_approx_P_adjont_dstretch(
i,
j) = t_approx_P(
i,
j);
449 t_approx_P_adjont_log_du(
L) =
450 t_Ldiff_u(
i,
j,
L) * t_approx_P_adjont_dstretch(
i,
j);
451 t_approx_P_adjont_log_du_dP(
i,
j,
L) = t_h_dlog_u(
i,
j,
L);
452 t_approx_P_adjont_log_du_domega(
m,
L) = 0;
460 t_C_h1(
i,
j) = t_h1(
k,
i) * t_h1(
k,
j);
461 eigen_vec(
i,
j) = t_C_h1(
i,
j);
477 t_log_u2_h1(
i,
j) = 0;
478 t_log_stretch_total(
i,
j) = t_log_u(
i,
j);
482 auto t_log_u2_h1_tmp =
484 t_log_u2_h1(
i,
j) = t_log_u2_h1_tmp(
i,
j);
485 t_log_stretch_total(
i,
j) = t_log_u2_h1_tmp(
i,
j) / 2 + t_log_u(
i,
j);
488 t_log_u2_h1(
i,
j) = 0;
489 t_log_stretch_total(
i,
j) = t_log_u(
i,
j);
498 t_Omega(
i,
j) = FTensor::levi_civita<double>(
i,
j,
k) * t_omega(
k);
500 t_h(
i,
j) = t_Omega(
i,
j) + t_u(
i,
j);
501 t_h_domega(
i,
j,
k) = FTensor::levi_civita<double>(
i,
j,
k);
506 t_levi_kirchoff_domega(
k,
l) = 0;
508 t_log_stretch_total(
i,
j) = t_log_u(
i,
j);
515 ++t_levi_kirchoff_dP;
516 ++t_levi_kirchoff_domega;
517 ++t_approx_P_adjont_dstretch;
518 ++t_approx_P_adjont_log_du;
519 ++t_approx_P_adjont_log_du_dP;
520 ++t_approx_P_adjont_log_du_domega;
532 ++t_log_stretch_total;