439 {
441
446
448
449
450 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
451#ifdef HENCKY_SMALL_STRAIN
452 auto t_D = getFTensor4DdgFromMat<DIM, DIM, S>(*
commonDataPtr->matDPtr);
453#endif
454 auto t_logC = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->matLogC);
455 auto t_logC_dC = getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->matLogCdC);
456 constexpr auto size_symm = (DIM * (DIM + 1)) / 2;
457 commonDataPtr->matFirstPiolaStress.resize(nb_gauss_pts, DIM * DIM,
false);
459 auto t_P = getFTensor2FromMat<DIM, DIM>(
commonDataPtr->matFirstPiolaStress);
460 auto t_T = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->matHenckyStress);
461 auto t_S =
462 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->matSecondPiolaStress);
463 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(
commonDataPtr->matGradPtr));
464
465 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
466
467#ifdef HENCKY_SMALL_STRAIN
468 t_P(
i,
j) = t_D(
i,
j,
k,
l) * t_grad(
k,
l);
469#else
472 t_S(
k,
l) = t_T(
i,
j) * t_logC_dC(
i,
j,
k,
l);
473 t_P(
i,
l) = t_F(
i,
k) * t_S(
k,
l);
474#endif
475
476 ++t_grad;
477 ++t_logC;
478 ++t_logC_dC;
479 ++t_P;
480 ++t_T;
481 ++t_S;
482#ifdef HENCKY_SMALL_STRAIN
483 ++t_D;
484#endif
485 }
486
488 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k