48 MoFEMErrorCode
doWork(
int side, EntityType type,
49 EntitiesFieldData::EntData &data) {
54 if (data.getIndices().size() == 0)
61 const auto &dof_ptr = data.getFieldDofs()[0];
66 int def_block_id = -1;
68 MB_TAG_CREAT | MB_TAG_SPARSE,
75 string tag_name_piola1 = dof_ptr->getName() +
"_PIOLA1_STRESS";
76 string tag_name_energy = dof_ptr->getName() +
"_ENERGY_DENSITY";
79 double def_VAL[tag_length];
80 bzero(def_VAL, tag_length *
sizeof(
double));
81 Tag th_piola1, th_energy, th_cauchy;
83 MB_TYPE_DOUBLE, th_piola1,
84 MB_TAG_CREAT | MB_TAG_SPARSE, def_VAL);
86 MB_TYPE_DOUBLE, th_energy,
87 MB_TAG_CREAT | MB_TAG_SPARSE, def_VAL);
90 string tag_name_cauchy =
"MED_" + dof_ptr->getName() +
"_CAUCHY_STRESS";
92 MB_TYPE_DOUBLE, th_cauchy,
93 MB_TAG_CREAT | MB_TAG_SPARSE, def_VAL);
96 int nb_gauss_pts = data.getN().size1();
97 if (
mapGaussPts.size() != (
unsigned int)nb_gauss_pts) {
99 "Nb. of integration points is not equal to number points on "
100 "post-processing mesh");
104 "Gradient of field not found, filed <%s> not found",
108 MatrixDouble3by3
H, invH;
119 MatrixDouble3by3 maxP(3, 3);
122 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
129 for (
int dd = 0; dd != 3; dd++) {
134 (
unsigned int)nb_gauss_pts) {
138 detH = determinantTensor3by3(
H);
139 CHKERR invertTensor3by3(
H, detH, invH);
144 int nb_active_variables = 9;
146 nb_active_variables);
166 MatrixDouble3by3 P(3, 3);
167 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
171 if (!std::isnormal(val_energy)) {
176 for (
unsigned int r = 0; r != P.size1(); ++r) {
177 for (
unsigned int c = 0;
c != P.size2(); ++
c) {
178 if (!std::isnormal(P(r,
c)))
179 P(r,
c) = copysign(
maxVal, P(r,
c));