1005                                                                              {
 1007 
 1014 
 1015  auto nb_integration_pts = 
stressPtr->size2();
 
 1016#ifndef NDEBUG
 1017  if (nb_integration_pts != getGaussPts().size2()) {
 1019            "inconsistent number of integration points");
 1020  }
 1021#endif 
 1022 
 1023  auto get_D = [&]() {
 
 1026 
 1027      if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
 1029        dataAtPts->lambda = b.bulkModulusK - 2 * b.shearModulusG / 3;
 
 1032            dataAtPts->getMatDeviatorDPtr(), b.bulkModulusK, b.shearModulusG);
 
 1034                                        b.bulkModulusK, b.shearModulusG);
 1036      }
 1037    }
 1038 
 1041 
 1044 
 1047 
 1054  };
 1055 
 1057 
 1059  auto t_strain = getFTensor2SymmetricFromMat<3>(*
strainPtr);
 
 1060  auto t_stress = getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(*
stressPtr);
 
 1061  auto t_inv_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
 1063#ifndef NDEBUG
 1064  auto t_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
 1066#endif
 1067 
 1071 
 1072  
 1073  
 1074  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
 1075    t_strain(
i, 
j) = t_inv_D(
i, 
j, 
k, 
l) * t_stress(
k, 
l);
 
 1076 
 1077#ifndef NDEBUG
 1079    t_stress_symm_debug(
i, 
j) = (t_stress(
i, 
j) || t_stress(
j, 
i)) / 2;
 
 1081    t_stress_symm_debug_diff(
i, 
j) =
 
 1082        t_D(
i, 
j, 
k, 
l) * t_strain(
k, 
l) - t_stress_symm_debug(
i, 
j);
 
 1083    double nrm =
 1084        t_stress_symm_debug_diff(
i, 
j) * t_stress_symm_debug_diff(
i, 
j);
 
 1085    double nrm0 = t_stress_symm_debug(
i, 
j) * t_stress_symm_debug(
i, 
j) +
 
 1086                  std::numeric_limits<double>::epsilon();
 1087    constexpr double eps = 1e-10;
 
 1088    if (std::fabs(std::sqrt(nrm / nrm0)) > 
eps) {
 
 1090          << "Stress symmetry check failed: " << std::endl
 1091          << t_stress_symm_debug_diff << std::endl
 1092          << t_stress;
 1094                        "Norm is too big: " + std::to_string(nrm / nrm0));
 1095    }
 1096    ++t_D;
 1097#endif
 1098 
 1099    ++t_strain;
 1100    ++t_stress;
 1101    ++t_inv_D;
 1102  }
 1103 
 1105}
#define FTENSOR_INDEX(DIM, I)
Kronecker Delta class symmetric.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
auto get_D
Create deviatoric stress tensor.
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static constexpr auto size_symm
FTensor::Index< 'm', 3 > m
std::vector< BlockData > blockData