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