21 :
eP(ep),
dataFieldEval(ep.mField.getInterface<FieldEvaluatorInterface>()
24 ierr = ep.mField.getInterface<FieldEvaluatorInterface>()->buildTree3D(
26 CHKERRABORT(PETSC_COMM_WORLD,
ierr);
28 auto no_rule = [](
int,
int,
int) {
return -1; };
30 auto set_element_for_field_eval = [&]() {
32 boost::shared_ptr<Ele> vol_ele(
dataFieldEval->feMethodPtr.lock());
33 vol_ele->getRuleHook = no_rule;
34 vol_ele->getUserPolynomialBase() =
35 boost::make_shared<CGGUserPolynomialBase>();
37 vol_ele->getOpPtrVector(), {HDIV, H1, L2},
eP.materialH1Positions,
40 vol_ele->getOpPtrVector().push_back(
new OpCalculateHVecTensorField<3, 3>(
41 eP.piolaStress,
eP.dataAtPts->getApproxPAtPts()));
42 vol_ele->getOpPtrVector().push_back(
43 new OpCalculateHTensorTensorField<3, 3>(
44 eP.bubbleField,
eP.dataAtPts->getApproxPAtPts(), MBMAXTYPE));
45 if (EshelbianCore::noStretch) {
46 vol_ele->getOpPtrVector().push_back(
47 eP.physicalEquations->returnOpCalculateStretchFromStress(
48 eP.dataAtPts,
eP.physicalEquations));
50 vol_ele->getOpPtrVector().push_back(
51 new OpCalculateTensor2SymmetricFieldValues<3>(
52 eP.stretchTensor,
eP.dataAtPts->getLogStretchTensorAtPts(),
55 vol_ele->getOpPtrVector().push_back(
new OpCalculateVectorFieldValues<3>(
56 eP.rotAxis,
eP.dataAtPts->getRotAxisAtPts(), MBTET));
57 vol_ele->getOpPtrVector().push_back(
new OpCalculateVectorFieldValues<3>(
58 eP.spatialL2Disp,
eP.dataAtPts->getSmallWL2AtPts(), MBTET));
61 vol_ele->getOpPtrVector().push_back(
new OpCalculateVectorFieldValues<3>(
62 eP.spatialH1Disp,
eP.dataAtPts->getSmallWH1AtPts()));
63 vol_ele->getOpPtrVector().push_back(
65 eP.spatialH1Disp,
eP.dataAtPts->getSmallWGradH1AtPts()));
67 vol_ele->getOpPtrVector().push_back(
68 new OpCalculateRotationAndSpatialGradient(
eP.dataAtPts));
72 auto set_element_for_post_process_energy = [&]() {
75 auto bubble_cache = boost::make_shared<CGGUserPolynomialBase::CachePhi>(
78 boost::make_shared<CGGUserPolynomialBase>(bubble_cache);
81 eP.materialH1Positions, ep.frontAdjEdges);
83 new OpCalculateHVecTensorField<3, 3>(
84 eP.piolaStress,
eP.dataAtPts->getApproxPAtPts()));
86 new OpCalculateHTensorTensorField<3, 3>(
87 eP.bubbleField,
eP.dataAtPts->getApproxPAtPts(), MBMAXTYPE));
90 eP.physicalEquations->returnOpCalculateStretchFromStress(
91 eP.dataAtPts,
eP.physicalEquations));
94 new OpCalculateTensor2SymmetricFieldValues<3>(
95 eP.stretchTensor,
eP.dataAtPts->getLogStretchTensorAtPts(),
99 new OpCalculateVectorFieldValues<3>(
100 eP.rotAxis,
eP.dataAtPts->getRotAxisAtPts(), MBTET));
102 new OpCalculateRotationAndSpatialGradient(
eP.dataAtPts));
104 if (
auto op =
eP.physicalEquations->returnOpCalculateEnergy(
eP.dataAtPts,
112 auto reads_post_proc_data =
118 if (!file.is_open()) {
124 while (std::getline(file, line)) {
125 std::istringstream iss(line);
127 double col2, col3, col4;
129 if (iss >> col1 >> col2 >> col3 >> col4) {
130 MOFEM_LOG(
"EP", Sev::verbose) <<
"Read: " << col1 <<
", " << col2
131 <<
", " << col3 <<
", " << col4;
132 pts_hash_map[col1] = {col2, col3, col4};
134 MOFEM_LOG(
"EP", Sev::error) <<
"Error parsing line: " << line;
144 "set element for post energy");
146 PetscBool test_cook_flg = PETSC_FALSE;
148 &test_cook_flg, PETSC_NULL),
149 "get post proc points");
152 ptsHashMap[
"Point B"] = {48. / 2., 44. + (60. - 44.) / 2., 0.};
153 ptsHashMap[
"Point C"] = {48. / 2., (44. - 0.) / 2., 0.};