445 {
447
452
454
455
456 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
457#ifdef HENCKY_SMALL_STRAIN
458 auto t_D = getFTensor4DdgFromMat<DIM, DIM, S>(*
commonDataPtr->matDPtr);
459#endif
460 auto t_logC = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->matLogC);
461 auto t_logC_dC = getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->matLogCdC);
462 constexpr auto size_symm = (DIM * (DIM + 1)) / 2;
463 commonDataPtr->matFirstPiolaStress.resize(nb_gauss_pts, DIM * DIM,
false);
465 auto t_P = getFTensor2FromMat<DIM, DIM>(
commonDataPtr->matFirstPiolaStress);
466 auto t_T = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->matHenckyStress);
467 auto t_S =
468 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->matSecondPiolaStress);
469 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(
commonDataPtr->matGradPtr));
470
471 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
472
473#ifdef HENCKY_SMALL_STRAIN
474 t_P(
i,
j) = t_D(
i,
j,
k,
l) * t_grad(
k,
l);
475#else
478 t_S(
k,
l) = t_T(
i,
j) * t_logC_dC(
i,
j,
k,
l);
479 t_P(
i,
l) = t_F(
i,
k) * t_S(
k,
l);
480#endif
481
482 ++t_grad;
483 ++t_logC;
484 ++t_logC_dC;
485 ++t_P;
486 ++t_T;
487 ++t_S;
488#ifdef HENCKY_SMALL_STRAIN
489 ++t_D;
490#endif
491 }
492
494 }
#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