v0.16.3
Loading...
Searching...
No Matches
EshelbianMonitor.cpp
Go to the documentation of this file.
1/** @file
2 @brief Contains definition of EshelbianMonitor class.
3 @ingroup EshelbianPlasticty
4*/
5
6struct EshelbianMonitor : public FEMethod {
7
9 using VolEle = VolumeElementForcesAndSourcesCore;
10 using VolOp = VolumeElementForcesAndSourcesCore::UserDataOperator;
11 using SetPtsData = FieldEvaluatorInterface::SetPtsData;
12 using PtsHashMap = std::map<std::string, std::array<double, 3>>;
14 PipelineManager::ElementsAndOpsByDim<SPACE_DIM>::FaceSideEle;
15
17 : eP(ep), dataFieldEval(ep.mField.getInterface<FieldEvaluatorInterface>()
18 ->getData<VolEle>()),
19 volPostProcEnergy(new VolEle(ep.mField)), gEnergy(new double) {
21 ep.mField.getInterface<FieldEvaluatorInterface>()->buildTree<SPACE_DIM>(
22 dataFieldEval, "EP"),
23 "build field evaluator tree");
24
25 CHK_THROW_MESSAGE(setElementForFieldEval(), "set element for field");
26 CHK_THROW_MESSAGE(readPtsFromFile(), "read post proc points");
27 CHK_THROW_MESSAGE(readPtsFromOptions(), "read post proc point options");
29 "set element for post energy");
30
31 CHK_THROW_MESSAGE(PetscOptionsGetBool(PETSC_NULLPTR, "", "-write_restart",
32 &writeRestart, PETSC_NULLPTR),
33 "get write restart option");
34 CHK_THROW_MESSAGE(PetscOptionsGetInt(PETSC_NULLPTR, "",
35 "-write_restart_every",
36 &writeRestartEvery, PETSC_NULLPTR),
37 "get write restart option");
38 if (writeRestartEvery <= 0)
40 "-write_restart_every must be positive");
41
42 MOFEM_LOG("EP", Sev::inform) << "EshelbianMonitor writeRestart "
43 << (writeRestart ? "true" : "false");
44
45 MOFEM_LOG("EP", Sev::inform) << "EshelbianMonitor writeRestartEvery "
46 << writeRestartEvery << " steps";
47 }
48
51 }
52
53 MoFEMErrorCode preProcess() { return 0; }
54
55 MoFEMErrorCode operator()() { return 0; }
56
73
74 MoFEMErrorCode setElementForPostProcessEnergy();
75 std::string getStep();
76 MoFEMErrorCode calculateReactionForces();
77 MoFEMErrorCode calculateEnergy();
78 MoFEMErrorCode saveRestartFile();
79 MoFEMErrorCode postProcessSkin();
80 MoFEMErrorCode postProcessMaterialForces();
81 MoFEMErrorCode postProcessSkeletonResults();
82 MoFEMErrorCode readPtsFromFile();
83 MoFEMErrorCode readPtsFromOptions();
84 MoFEMErrorCode setElementForFieldEval();
85 MoFEMErrorCode postProcessPoints();
86 MoFEMErrorCode postProcAtPoints(std::array<double, 3> point, std::string str);
87
88 std::map<std::string, std::array<double, 6>> &getReactionMap() {
89 return reactionForcesMap;
90 }
91
92 EshelbianCore &getEpCore() { return eP; }
93
94 boost::shared_ptr<SetPtsData> &getDataField() { return dataFieldEval; }
95
97
98 boost::shared_ptr<double> &getEnergy() { return gEnergy; }
99
100 inline static SmartPetscObj<Vec> adjointGradientVector = SmartPetscObj<Vec>();
101
102protected:
103 std::map<std::string, std::array<double, 6>> reactionForcesMap;
105 boost::shared_ptr<SetPtsData> dataFieldEval;
107 boost::shared_ptr<double> gEnergy;
108 boost::shared_ptr<VolEle> volPostProcEnergy;
109 PetscBool writeRestart = PETSC_FALSE;
110 PetscInt writeRestartEvery = 1;
111};
112
115 // set time to post processing elements
116 volPostProcEnergy->data_ctx |= PetscData::CTX_SET_TIME;
117 CHKERR eP.setBaseVolumeElementOps(1, false, false, false, volPostProcEnergy);
118
119 CHKERR eP.physicalEquations->pushEnergyEvaluation(
120 eP, volPostProcEnergy->getOpPtrVector(), eP.dataAtPts, gEnergy);
121
123};
124
126 std::ostringstream ss;
127 ss << boost::str(boost::format("%d") % static_cast<int>(ts_step));
128 return ss.str();
129};
130
133
134 // Get boundary faces marked in blocks name "SPATIAL_DISP_...".
135 auto get_ents_on_mesh_skin = [&]() {
136 std::map<std::string, Range> boundary_entities_vec;
137
138 auto get_block_vec_impl = [&](auto block_name) {
139 return eP.mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
140 std::regex(
141
142 (boost::format("%s(.*)") % block_name).str()
143
144 ));
145 };
146
147 auto add_blockset_ents_impl = [&](auto &&vec) {
149 for (auto it : vec) {
150 Range boundary_entities;
151 CHKERR it->getMeshsetIdEntitiesByDimension(eP.mField.get_moab(), 2,
152 boundary_entities, true);
153 std::string meshset_name = it->getName();
154 boundary_entities_vec[meshset_name] = boundary_entities;
155 boundary_entities.clear();
156 }
158 };
159
160 for (auto block_name :
161 {"SPATIAL_DISP", "FIX", "CONTACT", "SPATIAL_ROTATION",
162 "NORMAL_DISPLACEMENT", "ANALYTICAL_DISPLACEMENT", "SPRING_BC"}) {
163 CHK_THROW_MESSAGE(add_blockset_ents_impl(get_block_vec_impl(block_name)),
164 "add blockset entities");
165 }
166
167 return boundary_entities_vec;
168 };
169
170 auto boundary_entities_vec = get_ents_on_mesh_skin();
171
172 std::vector<std::tuple<std::string, Range, std::array<double, 6>>>
173 reactionForces;
174 for (const auto &pair : boundary_entities_vec) {
175 reactionForces.push_back(
176 std::make_tuple(pair.first, pair.second,
177 std::array<double, 6>{0.0, 0.0, 0.0, 0.0, 0.0, 0.0}));
178 }
179
180 auto integration_rule_face = [](int, int, int approx_order) {
181 return 2 * approx_order + 1;
182 };
183 auto face_fe = boost::make_shared<FaceElementForcesAndSourcesCore>(eP.mField);
184 face_fe->getRuleHook = integration_rule_face;
185 CHKERR
186 EshelbianPlasticity::AddHOOps<SPACE_DIM - 1, SPACE_DIM, SPACE_DIM>::add(
187 face_fe->getOpPtrVector(), {L2}, eP.materialH1Positions,
189
190 auto op_side =
191 new OpLoopSide<FaceSideEle>(eP.mField, "EP", SPACE_DIM, Sev::noisy);
192 face_fe->getOpPtrVector().push_back(op_side);
193 auto side_fe_ptr = op_side->getSideFEPtr();
194 auto base_ptr =
195 boost::make_shared<EshelbianPlasticity::CGGUserPolynomialBase>();
196 side_fe_ptr->getUserPolynomialBase() = base_ptr;
197 CHKERR
198 EshelbianPlasticity::AddHOOps<SPACE_DIM, SPACE_DIM, SPACE_DIM>::add(
199 side_fe_ptr->getOpPtrVector(), {H1, HDIV, L2}, eP.materialH1Positions,
201 auto piola_scale_ptr = boost::make_shared<double>(1.0);
202 side_fe_ptr->getOpPtrVector().push_back(
203 new OpCalculateHVecTensorField<SPACE_DIM, SPACE_DIM>(
204 eP.piolaStress, eP.dataAtPts->getApproxPAtPts(), piola_scale_ptr));
205 constexpr bool add_bubble_field = false;
206 if (add_bubble_field) {
207 side_fe_ptr->getOpPtrVector().push_back(
208 new OpCalculateHTensorTensorField<3, 3>(
209 eP.bubbleField, eP.dataAtPts->getApproxPAtPts(), MBMAXTYPE));
210 }
211 side_fe_ptr->getOpPtrVector().push_back(
213 side_fe_ptr->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
214 eP.spatialL2Disp, eP.dataAtPts->getSmallWL2AtPts(), MBTET));
215 for (auto &[name, ents, reaction_vec] : reactionForces) {
216 face_fe->getOpPtrVector().push_back(
217 new OpCalculateReactionForces(eP.dataAtPts, name, ents, reaction_vec));
218 }
219
220 CHKERR eP.mField.loop_finite_elements(problemPtr->getName(), eP.skinElement,
221 *face_fe);
222
223 for (auto &[name, ents, reaction_vec] : reactionForces) {
224 std::array<double, 6> block_reaction_force{0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
225
226 MPI_Allreduce(reaction_vec.data(), &block_reaction_force, 6, MPI_DOUBLE,
227 MPI_SUM, eP.mField.get_comm());
228
229 for (auto &force : block_reaction_force) {
230 if (std::abs(force) < 1e-12) {
231 force = 0.0;
232 }
233 }
234 // Store the reaction forces for later access
235 reactionForcesMap[name] = block_reaction_force;
236 MOFEM_LOG_C("EP", Sev::inform,
237 "Step %d time %3.4g Block %s Reaction force [%3.6e, "
238 "%3.6e, %3.6e]",
239 ts_step, ts_t, name.c_str(), block_reaction_force[0],
240 block_reaction_force[1], block_reaction_force[2]);
241 MOFEM_LOG_C("EP", Sev::inform,
242 "Step %d time %3.4g Block %s Moment [%3.6e, %3.6e, %3.6e]",
243 ts_step, ts_t, name.c_str(), block_reaction_force[3],
244 block_reaction_force[4], block_reaction_force[5]);
245 }
247};
248
251 // Loop boundary elements with traction boundary conditions
252 *gEnergy = 0;
253 // set time to post proc energy
254 const bool has_ts = (ts != PETSC_NULLPTR);
255 if (has_ts) {
256 CHKERR TSGetTime(ts, &(volPostProcEnergy->ts_t));
257 CHKERR TSGetTimeStep(ts, &(volPostProcEnergy->ts_dt));
258 }
259 TetPolynomialBase::switchCacheBaseOn<HDIV>({volPostProcEnergy.get()});
260 CHKERR eP.mField.loop_finite_elements(problemPtr->getName(), "EP",
262 TetPolynomialBase::switchCacheBaseOff<HDIV>({volPostProcEnergy.get()});
263
264 double body_energy = 0;
265 MPI_Allreduce(gEnergy.get(), &body_energy, 1, MPI_DOUBLE, MPI_SUM,
266 eP.mField.get_comm());
267 *gEnergy = body_energy;
270 // store strain energy
271 eP.strainEnergy = body_energy;
272 MOFEM_LOG_C("EP", Sev::inform,
273 "Step %d time %3.4g strain energy %3.12e crack "
274 "area %3.12e",
275 ts_step, ts_t, body_energy, *eP.currentCrackAreaPtr);
276 if (eP.mField.get_comm_rank() == 0) {
277 auto crack_faces = *eP.crackFaces;
278 if (crack_faces.empty()) {
279 crack_faces = *eP.frontEdges;
280 }
283 (boost::format("crack_faces_step_%d.vtk") % ts_step).str(),
284 crack_faces);
287 (boost::format("front_edges_step_%d.vtk") % ts_step).str(),
288 *eP.frontEdges);
289 }
290
291 } else {
292 MOFEM_LOG_C("EP", Sev::inform, "Step %d time %3.4g strain energy %3.6e",
293 ts_step, ts_t, body_energy);
294 }
296};
297
300
301 if (writeRestart && ts_u && (ts_step % writeRestartEvery == 0)) {
302 const std::string restart_file = "restart_" + getStep() + ".dat";
303 PetscViewer viewer;
304 CHKERR PetscViewerBinaryOpen(PETSC_COMM_WORLD,
305 restart_file.c_str(),
306 FILE_MODE_WRITE, &viewer);
307 CHKERR PetscViewerBinarySetSkipInfo(viewer, PETSC_TRUE);
308 CHKERR VecView(ts_u, viewer);
309 CHKERR PetscViewerDestroy(&viewer);
310 CHKERR writeRestartLayout(eP, ts_u, restart_file);
311 CHKERR eP.postProcessRestartMesh(1, "out_restart_mesh_" +
312 getStep() + ".h5m");
313 }
315};
316
319 CHKERR eP.postProcessResults(1, "out_sol_elastic_" + getStep() + ".h5m",
320 PETSC_NULLPTR, PETSC_NULLPTR,
321 adjointGradientVector, {}, ts);
323};
324
327 // Function to get material force tags
329 int nb_front_faces = eP.frontEdges->size();
330 MPI_Allreduce(MPI_IN_PLACE, &nb_front_faces, 1, MPI_INT, MPI_SUM,
331 eP.mField.get_comm());
332 if (nb_front_faces > 0) {
334 }
335 }
337};
338
341 auto get_material_force_tags = [&]() {
342 auto &moab = eP.mField.get_moab();
343 std::vector<Tag> tags;
344 for (const auto *name : {"MaterialForce", "FacePressure"}) {
345 Tag tag;
346 const auto rval = moab.tag_get_handle(name, tag);
347 if (rval == MB_SUCCESS)
348 tags.push_back(tag);
349 else if (rval != MB_TAG_NOT_FOUND)
350 CHK_MOAB_THROW(rval, "can't get tag");
351 }
352 return tags;
353 };
354 // Post-process skeleton elements
355 bool post_process_skeleton = false;
356#ifndef NDEBUG
357 post_process_skeleton = true;
358#endif
359 if (post_process_skeleton) {
361 1, "out_skeleton_" + getStep() + ".h5m", PETSC_NULLPTR,
362 get_material_force_tags(), ts);
363 }
365};
366
369 std::ifstream file("points.txt"); // Open the file with the name "data.txt"
370
371 if (!file.is_open()) {
373 }
374
375 std::string line;
376
377 while (std::getline(file, line)) {
378 std::istringstream iss(line);
379 std::string col1;
380 double col2, col3, col4;
381
382 if (iss >> col1 >> col2 >> col3 >> col4) {
383 MOFEM_LOG("EP", Sev::verbose)
384 << "Read: " << col1 << ", " << col2 << ", " << col3 << ", " << col4;
385 ptsHashMap[col1] = {col2, col3, col4};
386 } else {
387 MOFEM_LOG("EP", Sev::error) << "Error parsing line: " << line;
388 }
389 }
390
391 file.close(); // Close the file
393};
394
397
398 std::array<double, SPACE_DIM> field_eval_coords{};
399 PetscInt coords_dim = SPACE_DIM;
400 PetscBool do_eval_field = PETSC_FALSE;
401 CHKERR PetscOptionsGetRealArray(
402 PETSC_NULLPTR, PETSC_NULLPTR, "-field_eval_coords",
403 field_eval_coords.data(), &coords_dim, &do_eval_field);
404
405 if (do_eval_field && coords_dim != SPACE_DIM)
406 SETERRQ(PETSC_COMM_WORLD, MOFEM_INVALID_DATA,
407 "-field_eval_coords requires exactly three coordinates");
408
409 if (do_eval_field) {
410 ptsHashMap["field_eval_coords"] = field_eval_coords;
411 MOFEM_LOG_C("EP", Sev::inform,
412 "FieldEvaluator added command-line point [%6.4e, %6.4e, "
413 "%6.4e]",
414 field_eval_coords[0], field_eval_coords[1],
415 field_eval_coords[2]);
416 }
417
418 PetscBool test_cook_pts = PETSC_FALSE;
419 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "", "-test_cook_pts",
420 &test_cook_pts, PETSC_NULLPTR);
421 if (test_cook_pts) {
422 ptsHashMap["Point A"] = {48., 60., 4.999};
423 ptsHashMap["Point B"] = {48. / 2., 44. + (60. - 44.) / 2., 0.};
424 ptsHashMap["Point C"] = {48. / 2., (44. - 0.) / 2., 0.};
425 }
426
428}
429
432 boost::shared_ptr<Ele> vol_ele(dataFieldEval->feMethodPtr);
433 auto no_rule = [](int, int, int) { return -1; };
434 vol_ele->getRuleHook = no_rule;
435 vol_ele->getUserPolynomialBase() =
436 boost::make_shared<CGGUserPolynomialBase>();
437 EshelbianPlasticity::AddHOOps<SPACE_DIM, SPACE_DIM, SPACE_DIM>::add(
438 vol_ele->getOpPtrVector(), {HDIV, H1, L2}, eP.materialH1Positions,
440
441 auto piola_scale_ptr = boost::make_shared<double>(1.0);
442 vol_ele->getOpPtrVector().push_back(new OpCalculateHVecTensorField<3, 3>(
443 eP.piolaStress, eP.dataAtPts->getApproxPAtPts(), piola_scale_ptr));
444 vol_ele->getOpPtrVector().push_back(new OpCalculateHTensorTensorField<3, 3>(
445 eP.bubbleField, eP.dataAtPts->getApproxPAtPts(), piola_scale_ptr,
446 SmartPetscObj<Vec>(), MBMAXTYPE));
447 vol_ele->getOpPtrVector().push_back(new OpCalculateL2RotationValues(
448 eP.rotAxis, eP.dataAtPts->getRotAxisAtPts(),
449 eP.dataAtPts->constantRotation, eP.dataAtPts->higherRotation));
450 CHKERR VecSetDM(eP.solTSStep, PETSC_NULLPTR);
451 vol_ele->getOpPtrVector().push_back(new OpCalculateHVecTensorField<3, 3>(
452 eP.piolaStress, eP.dataAtPts->getApproxP0AtPts(), nullptr,
453 eP.solTSStep));
454 CHKERR eP.physicalEquations->pushMaterialFields(
455 eP, vol_ele->getOpPtrVector(), eP.dataAtPts, PhysicalEquations::PREVIOUS);
456 CHKERR eP.physicalEquations->pushMaterialFields(eP, vol_ele->getOpPtrVector(),
457 eP.dataAtPts);
458 vol_ele->getOpPtrVector().push_back(new OpCalculateL2RotationValues(
459 eP.rotAxis, boost::make_shared<MatrixDouble>(),
460 eP.dataAtPts->previousConstantRotation,
461 eP.dataAtPts->previousHigherRotation, eP.solTSStep));
462 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
463 eP.spatialL2Disp, eP.dataAtPts->getSmallWL2AtPts(), MBTET));
464
465 // H1 displacements
466 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
467 eP.spatialH1Disp, eP.dataAtPts->getSmallWH1AtPts()));
468 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldGradient<3, 3>(
469 eP.spatialH1Disp, eP.dataAtPts->getSmallWGradH1AtPts()));
470
471 CHKERR addCalculatePlasticLogarithmicStretchFieldValues(
472 vol_ele->getOpPtrVector(), eP.plasticHField,
473 eP.dataAtPts->getPlasticH(), MBTET);
474 vol_ele->getOpPtrVector().push_back(
477};
478
481
482 for (const auto &[label, point] : ptsHashMap)
483 CHKERR postProcAtPoints(point, label);
484
485 if (!ptsHashMap.empty())
487
489}
490
491MoFEMErrorCode EshelbianMonitor::postProcAtPoints(std::array<double, 3> point,
492 std::string str) {
494
495 dataFieldEval->setEvalPoints(point.data(), point.size() / 3);
496 auto point_found_ptr = boost::make_shared<int>(0);
497
498 struct OpPrint : public VolOp {
499
500 EshelbianCore &eP;
501 std::array<double, 3> point;
502 std::string str;
503 boost::shared_ptr<int> pointFoundPtr;
504 PetscInt step;
505 double time;
506
507 OpPrint(EshelbianCore &ep, std::array<double, 3> &point, std::string &str,
508 boost::shared_ptr<int> point_found_ptr, PetscInt step, double time)
509 : VolOp(ep.spatialL2Disp, VolOp::OPROW), eP(ep), point(point),
510 str(str), pointFoundPtr(point_found_ptr), step(step), time(time) {}
511
512 MoFEMErrorCode doWork(int side, EntityType type,
513 EntitiesFieldData::EntData &data) {
515 if (type == MBTET) {
516 const int nb_gauss_pts = getGaussPts().size2();
517 if (nb_gauss_pts) {
518 *pointFoundPtr = 1;
519
520 auto t_h = eP.dataAtPts->getFTensorSmallH(nb_gauss_pts);
521 auto t_approx_P = eP.dataAtPts->getFTensorApproxP(nb_gauss_pts);
522 auto t_disp =
523 getFTensor1FromMat<SPACE_DIM>(*eP.dataAtPts->getSmallWL2AtPts());
524
525 FTensor::Index<'i', 3> i;
526 FTensor::Index<'j', 3> j;
527 FTensor::Index<'k', 3> k;
528 const double jac = determinantTensor3by3(t_h);
530 t_cauchy(i, j) = (1. / jac) * (t_approx_P(i, k) * t_h(j, k));
531
532 auto add = [&]() {
533 std::ostringstream s;
534 s << str << " elem " << getFEEntityHandle() << " ";
535 return s.str();
536 };
537
538 auto print_tensor = [](auto &t) {
539 std::ostringstream s;
540 s << t;
541 return s.str();
542 };
543
544 std::ostringstream print;
545 MOFEM_LOG("EPSYNC", Sev::inform)
546 << add() << "comm rank " << eP.mField.get_comm_rank();
547 MOFEM_LOG("EPSYNC", Sev::inform)
548 << add() << "point " << getVectorAdaptor(point.data(), 3);
549 MOFEM_LOG("EPSYNC", Sev::inform)
550 << add() << "coords at gauss pts " << getCoordsAtGaussPts();
551 MOFEM_LOG("EPSYNC", Sev::inform)
552 << add() << "w " << *(eP.dataAtPts->getSmallWL2AtPts());
553 MOFEM_LOG("EPSYNC", Sev::inform)
554 << add() << "Piola " << *(eP.dataAtPts->getApproxPAtPts());
555 MOFEM_LOG("EPSYNC", Sev::inform)
556 << add() << "Cauchy " << print_tensor(t_cauchy);
558 "EPSYNC", Sev::inform,
559 "FieldEvaluator step %d time %6.4e label \"%s\" point [%6.4e, "
560 "%6.4e, %6.4e]",
561 step, time, str.c_str(), point[0], point[1], point[2]);
562 MOFEM_LOG_C("EPSYNC", Sev::inform,
563 "FieldEvaluator displacement [Ux, Uy, Uz] = [%6.4e, "
564 "%6.4e, %6.4e]",
565 t_disp(0), t_disp(1), t_disp(2));
567 "EPSYNC", Sev::inform,
568 "FieldEvaluator Cauchy stress [Sxx, Syy, Szz, Sxy, Syz, Sxz] "
569 "= [%6.4e, %6.4e, %6.4e, %6.4e, %6.4e, %6.4e]",
570 t_cauchy(0, 0), t_cauchy(1, 1), t_cauchy(2, 2),
571 t_cauchy(0, 1), t_cauchy(1, 2), t_cauchy(0, 2));
572 }
573 }
575 }
576 };
577
578 if (auto fe_ptr = dataFieldEval->feMethodPtr) {
579 fe_ptr->data_ctx |= PetscData::CtxSetTime;
580 fe_ptr->ts_t = EshelbianCore::physicalTimeFlg
582 : ts_t;
583 fe_ptr->ts_dt =
585
586 const double time = EshelbianCore::physicalTimeFlg
588 : ts_t;
589 fe_ptr->getOpPtrVector().push_back(
590 new OpPrint(eP, point, str, point_found_ptr, ts_step, time));
591 CHKERR eP.mField.getInterface<FieldEvaluatorInterface>()
592 ->evalFEAtThePoint<SPACE_DIM>(
593 point.data(), 1e-12, problemPtr->getName(), "EP", dataFieldEval,
595 MF_EXIST, QUIET);
596 fe_ptr->getOpPtrVector().pop_back();
597 }
598
599 int global_point_found = 0;
600 MPI_Allreduce(point_found_ptr.get(), &global_point_found, 1, MPI_INT, MPI_SUM,
601 eP.mField.get_comm());
602 if (!global_point_found && !eP.mField.get_comm_rank())
603 MOFEM_LOG_C("EP", Sev::warning,
604 "FieldEvaluator did not find point [%6.4e, %6.4e, %6.4e] in "
605 "the EP domain",
606 point[0], point[1], point[2]);
607
609}
std::string type
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_LOG_C(channel, severity, format,...)
boost::shared_ptr< DataAtIntegrationPts > data
EshelbianCore * ep
std::string name
constexpr int SPACE_DIM
@ QUIET
@ MF_EXIST
#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 ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
@ MOFEM_INVALID_DATA
Definition definitions.h:36
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG(channel, severity)
Log.
virtual MoFEMErrorCode loop_finite_elements(const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
constexpr double t
plate stiffness
Definition plate.cpp:58
static constexpr int approx_order
boost::shared_ptr< Range > frontAdjEdges
MoFEM::Interface & mField
const std::string spatialL2Disp
MoFEMErrorCode postProcessSkeletonResults(const int tag, const std::string file, Vec f_residual=PETSC_NULLPTR, std::vector< Tag > tags_to_transfer={}, TS ts=PETSC_NULLPTR)
const std::string materialH1Positions
static PetscBool crackingOn
MoFEMErrorCode postProcessRestartMesh(const int tag, const std::string file, std::vector< Tag > tags_to_transfer={})
MoFEMErrorCode postProcessResults(const int tag, const std::string file, Vec f_residual=PETSC_NULLPTR, Vec var_vec=PETSC_NULLPTR, Vec gradient=PETSC_NULLPTR, std::vector< Tag > tags_to_transfer={}, TS ts=PETSC_NULLPTR)
static double physicalDt
const std::string spatialH1Disp
MoFEMErrorCode calculateCrackArea(boost::shared_ptr< double > &area_ptr)
const std::string plasticHField
const std::string piolaStress
static PetscBool physicalTimeFlg
const std::string bubbleField
static double currentPhysicalTime
boost::shared_ptr< PhysicalEquations > physicalEquations
const std::string rotAxis
const std::string skinElement
MoFEMErrorCode setBaseVolumeElementOps(const int tag, const bool do_rhs, const bool do_lhs, const bool calc_rates, boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe, const bool add_bubble=true)
boost::shared_ptr< double > currentCrackAreaPtr
MoFEMErrorCode calculateFaceMaterialForce(const int tag, TS ts, SmartPetscObj< Vec > *adjoint_gradient_vector=nullptr)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
boost::shared_ptr< Range > crackFaces
SmartPetscObj< Vec > solTSStep
boost::shared_ptr< Range > frontEdges
MoFEMErrorCode setElementForPostProcessEnergy()
boost::shared_ptr< double > gEnergy
MoFEMErrorCode preProcess()
boost::shared_ptr< double > & getEnergy()
MoFEMErrorCode postProcessMaterialForces()
boost::shared_ptr< VolEle > volPostProcEnergy
MoFEMErrorCode setElementForFieldEval()
PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::FaceSideEle FaceSideEle
MoFEMErrorCode operator()()
std::map< std::string, std::array< double, 6 > > & getReactionMap()
EshelbianCore & getEpCore()
std::map< std::string, std::array< double, 6 > > reactionForcesMap
boost::shared_ptr< SetPtsData > dataFieldEval
EshelbianMonitor(EshelbianCore &ep)
MoFEMErrorCode saveRestartFile()
static SmartPetscObj< Vec > adjointGradientVector
MoFEMErrorCode postProcessPoints()
MoFEMErrorCode postProcessSkin()
boost::shared_ptr< SetPtsData > & getDataField()
MoFEMErrorCode calculateReactionForces()
MoFEMErrorCode readPtsFromOptions()
std::map< std::string, std::array< double, 3 > > PtsHashMap
VolumeElementForcesAndSourcesCore VolEle
MoFEMErrorCode postProcAtPoints(std::array< double, 3 > point, std::string str)
VolumeElementForcesAndSourcesCore::UserDataOperator VolOp
MoFEMErrorCode postProcessSkeletonResults()
MoFEMErrorCode postProcess()
MoFEMErrorCode calculateEnergy()
FieldEvaluatorInterface::SetPtsData SetPtsData
MoFEMErrorCode readPtsFromFile()
PtsHashMap & getHashMap()
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
@ OPROW
operator doWork function is executed on FE rows
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
VolEle::UserDataOperator VolOp
char restart_file[255]
PetscBool do_eval_field
Evaluate field.
Definition plastic.cpp:120
auto save_range