485 {
487
492
494
495
496 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
497#ifdef HENCKY_SMALL_STRAIN
498 auto t_D = getFTensor4DdgFromMat<DIM, DIM, S>(*
commonDataPtr->matDPtr);
499#endif
500 auto t_logC = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->matLogC);
501 auto t_logC_dC = getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->matLogCdC);
502 constexpr auto size_symm = (DIM * (DIM + 1)) / 2;
503 commonDataPtr->matFirstPiolaStress.resize(DIM * DIM, nb_gauss_pts,
false);
505 auto t_P = getFTensor2FromMat<DIM, DIM>(
commonDataPtr->matFirstPiolaStress);
506 auto t_T = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->matHenckyStress);
507 auto t_S =
508 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->matSecondPiolaStress);
509 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(
commonDataPtr->matGradPtr));
510
511 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
512
513#ifdef HENCKY_SMALL_STRAIN
514 t_P(
i,
j) = t_D(
i,
j,
k,
l) * t_grad(
k,
l);
515#else
518 t_S(
k,
l) = t_T(
i,
j) * t_logC_dC(
i,
j,
k,
l);
519 t_P(
i,
l) = t_F(
i,
k) * t_S(
k,
l);
520#endif
521
522 ++t_grad;
523 ++t_logC;
524 ++t_logC_dC;
525 ++t_P;
526 ++t_T;
527 ++t_S;
528#ifdef HENCKY_SMALL_STRAIN
529 ++t_D;
530#endif
531 }
532
534 }
#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