v0.16.0
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
39 MOFEM_LOG("EP", Sev::inform) << "EshelbianMonitor writeRestart "
40 << (writeRestart ? "true" : "false");
41
42 MOFEM_LOG("EP", Sev::inform) << "EshelbianMonitor writeRestartEvery "
43 << writeRestartEvery << " steps";
44 }
45
48 }
49
50 MoFEMErrorCode preProcess() { return 0; }
51
52 MoFEMErrorCode operator()() { return 0; }
53
70
71 MoFEMErrorCode setElementForPostProcessEnergy();
72 std::string getStep();
73 MoFEMErrorCode calculateReactionForces();
74 MoFEMErrorCode calculateEnergy();
75 MoFEMErrorCode saveRestartFile();
76 MoFEMErrorCode postProcessSkin();
77 MoFEMErrorCode postProcessMaterialForces();
78 MoFEMErrorCode postProcessSkeletonResults();
79 MoFEMErrorCode readPtsFromFile();
80 MoFEMErrorCode readPtsFromOptions();
81 MoFEMErrorCode setElementForFieldEval();
82 MoFEMErrorCode postProcessPoints();
83 MoFEMErrorCode postProcAtPoints(std::array<double, 3> point, std::string str);
84
85 std::map<std::string, std::array<double, 6>> &getReactionMap() {
86 return reactionForcesMap;
87 }
88
89 EshelbianCore &getEpCore() { return eP; }
90
91 boost::shared_ptr<SetPtsData> &getDataField() { return dataFieldEval; }
92
94
95 boost::shared_ptr<double> &getEnergy() { return gEnergy; }
96
97 inline static SmartPetscObj<Vec> adjointGradientVector = SmartPetscObj<Vec>();
98
99protected:
100 std::map<std::string, std::array<double, 6>> reactionForcesMap;
102 boost::shared_ptr<SetPtsData> dataFieldEval;
104 boost::shared_ptr<double> gEnergy;
105 boost::shared_ptr<VolEle> volPostProcEnergy;
106 PetscBool writeRestart = PETSC_FALSE;
107 PetscInt writeRestartEvery = 1;
108};
109
112 // set time to post processing elements
113 volPostProcEnergy->data_ctx |= PetscData::CTX_SET_TIME;
114 CHKERR eP.setBaseVolumeElementOps(1, false, false, false, volPostProcEnergy);
115
116 if (auto op = eP.physicalEquations->returnOpCalculateEnergy(eP.dataAtPts,
117 gEnergy)) {
118
121 // We have to use actual strains to evaluate J integral and energy,
122 // in this case. Note actual stresses, and actual energy can only
123 // drive crack growth
124
125 // Note: Calling this bellow we overwrite the stretch calculation
126 // from setBaseVolumeElementOps
127
128 pushOpCalculateStretchFromStress(
129 volPostProcEnergy->getOpPtrVector(), eP.physicalEquations,
131 eP.dataAtPts->getLogStretchTotalTensorAtPts());
132 }
133
134 volPostProcEnergy->getOpPtrVector().push_back(op);
135 }
136
138};
139
141 std::ostringstream ss;
142 ss << boost::str(boost::format("%d") % static_cast<int>(ts_step));
143 return ss.str();
144};
145
148
149 // Get boundary faces marked in blocks name "SPATIAL_DISP_...".
150 auto get_ents_on_mesh_skin = [&]() {
151 std::map<std::string, Range> boundary_entities_vec;
152
153 auto get_block_vec_impl = [&](auto block_name) {
154 return eP.mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
155 std::regex(
156
157 (boost::format("%s(.*)") % block_name).str()
158
159 ));
160 };
161
162 auto add_blockset_ents_impl = [&](auto &&vec) {
164 for (auto it : vec) {
165 Range boundary_entities;
166 CHKERR it->getMeshsetIdEntitiesByDimension(eP.mField.get_moab(), 2,
167 boundary_entities, true);
168 std::string meshset_name = it->getName();
169 boundary_entities_vec[meshset_name] = boundary_entities;
170 boundary_entities.clear();
171 }
173 };
174
175 for (auto block_name :
176 {"SPATIAL_DISP", "FIX", "CONTACT", "SPATIAL_ROTATION",
177 "NORMAL_DISPLACEMENT", "ANALYTICAL_DISPLACEMENT", "SPRING_BC"}) {
178 CHK_THROW_MESSAGE(add_blockset_ents_impl(get_block_vec_impl(block_name)),
179 "add blockset entities");
180 }
181
182 return boundary_entities_vec;
183 };
184
185 auto boundary_entities_vec = get_ents_on_mesh_skin();
186
187 std::vector<std::tuple<std::string, Range, std::array<double, 6>>>
188 reactionForces;
189 for (const auto &pair : boundary_entities_vec) {
190 reactionForces.push_back(
191 std::make_tuple(pair.first, pair.second,
192 std::array<double, 6>{0.0, 0.0, 0.0, 0.0, 0.0, 0.0}));
193 }
194
195 auto integration_rule_face = [](int, int, int approx_order) {
196 return 2 * approx_order + 1;
197 };
198 auto face_fe = boost::make_shared<FaceElementForcesAndSourcesCore>(eP.mField);
199 auto no_rule = [](int, int, int) { return -1; };
200 face_fe->getRuleHook = integration_rule_face;
201 CHKERR
202 EshelbianPlasticity::AddHOOps<SPACE_DIM - 1, SPACE_DIM, SPACE_DIM>::add(
203 face_fe->getOpPtrVector(), {L2}, eP.materialH1Positions,
205
206 auto op_side =
207 new OpLoopSide<FaceSideEle>(eP.mField, "EP", SPACE_DIM, Sev::noisy);
208 face_fe->getOpPtrVector().push_back(op_side);
209 auto side_fe_ptr = op_side->getSideFEPtr();
210 auto base_ptr =
211 boost::make_shared<EshelbianPlasticity::CGGUserPolynomialBase>();
212 side_fe_ptr->getUserPolynomialBase() = base_ptr;
213 CHKERR
214 EshelbianPlasticity::AddHOOps<SPACE_DIM, SPACE_DIM, SPACE_DIM>::add(
215 side_fe_ptr->getOpPtrVector(), {H1, HDIV, L2}, eP.materialH1Positions,
217 auto piola_scale_ptr = boost::make_shared<double>(1.0);
218 side_fe_ptr->getOpPtrVector().push_back(
219 new OpCalculateHVecTensorField<SPACE_DIM, SPACE_DIM>(
220 eP.piolaStress, eP.dataAtPts->getApproxPAtPts(), piola_scale_ptr));
221 constexpr bool add_bubble_field = false;
222 if (add_bubble_field) {
223 side_fe_ptr->getOpPtrVector().push_back(
224 new OpCalculateHTensorTensorField<3, 3>(
225 eP.bubbleField, eP.dataAtPts->getApproxPAtPts(), MBMAXTYPE));
226 }
227 side_fe_ptr->getOpPtrVector().push_back(
229 side_fe_ptr->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
230 eP.spatialL2Disp, eP.dataAtPts->getSmallWL2AtPts(), MBTET));
231 for (auto &[name, ents, reaction_vec] : reactionForces) {
232 face_fe->getOpPtrVector().push_back(
233 new OpCalculateReactionForces(eP.dataAtPts, name, ents, reaction_vec));
234 }
235
236 CHKERR eP.mField.loop_finite_elements(problemPtr->getName(), eP.skinElement,
237 *face_fe);
238
239 for (auto &[name, ents, reaction_vec] : reactionForces) {
240 std::array<double, 6> block_reaction_force{0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
241
242 MPI_Allreduce(reaction_vec.data(), &block_reaction_force, 6, MPI_DOUBLE,
243 MPI_SUM, eP.mField.get_comm());
244
245 for (auto &force : block_reaction_force) {
246 if (std::abs(force) < 1e-12) {
247 force = 0.0;
248 }
249 }
250 // Store the reaction forces for later access
251 reactionForcesMap[name] = block_reaction_force;
252 MOFEM_LOG_C("EP", Sev::inform,
253 "Step %d time %3.4g Block %s Reaction force [%3.6e, "
254 "%3.6e, %3.6e]",
255 ts_step, ts_t, name.c_str(), block_reaction_force[0],
256 block_reaction_force[1], block_reaction_force[2]);
257 MOFEM_LOG_C("EP", Sev::inform,
258 "Step %d time %3.4g Block %s Moment [%3.6e, %3.6e, %3.6e]",
259 ts_step, ts_t, name.c_str(), block_reaction_force[3],
260 block_reaction_force[4], block_reaction_force[5]);
261 }
263};
264
267 // Loop boundary elements with traction boundary conditions
268 *gEnergy = 0;
269 // set time to post proc energy
270 const bool has_ts = (ts != PETSC_NULLPTR);
271 if (has_ts) {
272 CHKERR TSGetTime(ts, &(volPostProcEnergy->ts_t));
273 CHKERR TSGetTimeStep(ts, &(volPostProcEnergy->ts_dt));
274 }
275 TetPolynomialBase::switchCacheBaseOn<HDIV>({volPostProcEnergy.get()});
276 CHKERR eP.mField.loop_finite_elements(problemPtr->getName(), "EP",
278 TetPolynomialBase::switchCacheBaseOff<HDIV>({volPostProcEnergy.get()});
279
280 double body_energy = 0;
281 MPI_Allreduce(gEnergy.get(), &body_energy, 1, MPI_DOUBLE, MPI_SUM,
282 eP.mField.get_comm());
283 *gEnergy = body_energy;
286 // store strain energy
287 eP.strainEnergy = body_energy;
288 MOFEM_LOG_C("EP", Sev::inform,
289 "Step %d time %3.4g strain energy %3.12e crack "
290 "area %3.12e",
291 ts_step, ts_t, body_energy, *eP.currentCrackAreaPtr);
292 if (eP.mField.get_comm_rank() == 0) {
293 auto crack_faces = *eP.crackFaces;
294 if (crack_faces.empty()) {
295 crack_faces = *eP.frontEdges;
296 }
299 (boost::format("crack_faces_step_%d.vtk") % ts_step).str(),
300 crack_faces);
303 (boost::format("front_edges_step_%d.vtk") % ts_step).str(),
304 *eP.frontEdges);
305 }
306
307 } else {
308 MOFEM_LOG_C("EP", Sev::inform, "Step %d time %3.4g strain energy %3.6e",
309 ts_step, ts_t, body_energy);
310 }
312};
313
316
317 if (writeRestart && ts_u && (ts_step % writeRestartEvery == 0)) {
318 PetscViewer viewer;
319 CHKERR PetscViewerBinaryOpen(PETSC_COMM_WORLD,
320 ("restart_" + getStep() + ".dat").c_str(),
321 FILE_MODE_WRITE, &viewer);
322 CHKERR PetscViewerBinarySetSkipInfo(viewer, PETSC_TRUE);
323 CHKERR VecView(ts_u, viewer);
324 CHKERR PetscViewerDestroy(&viewer);
325 CHKERR eP.postProcessRestartMesh(1, "out_restart_mesh_" +
326 getStep() + ".h5m");
327 }
329};
330
333 CHKERR eP.postProcessResults(1, "out_sol_elastic_" + getStep() + ".h5m",
334 PETSC_NULLPTR, PETSC_NULLPTR,
335 adjointGradientVector, {}, ts);
337};
338
341 // Function to get material force tags
343 int nb_front_faces = eP.frontEdges->size();
344 MPI_Allreduce(MPI_IN_PLACE, &nb_front_faces, 1, MPI_INT, MPI_SUM,
345 eP.mField.get_comm());
346 if (nb_front_faces > 0) {
348 }
349 }
351};
352
355 auto get_material_force_tags = [&]() {
356 auto &moab = eP.mField.get_moab();
357 std::vector<Tag> tag(2);
358 CHK_MOAB_THROW(moab.tag_get_handle("MaterialForce", tag[0]),
359 "can't get tag");
360 CHK_MOAB_THROW(moab.tag_get_handle("FacePressure", tag[1]),
361 "can't get tag");
362 return tag;
363 };
364 // Post-process skeleton elements
365 bool post_process_skeleton = false;
366#ifndef NDEBUG
367 post_process_skeleton = true;
368#endif
369 if (post_process_skeleton) {
371 1, "out_skeleton_" + getStep() + ".h5m", PETSC_NULLPTR,
372 get_material_force_tags(), ts);
373 }
375};
376
379 std::ifstream file("points.txt"); // Open the file with the name "data.txt"
380
381 if (!file.is_open()) {
383 }
384
385 std::string line;
386
387 while (std::getline(file, line)) {
388 std::istringstream iss(line);
389 std::string col1;
390 double col2, col3, col4;
391
392 if (iss >> col1 >> col2 >> col3 >> col4) {
393 MOFEM_LOG("EP", Sev::verbose)
394 << "Read: " << col1 << ", " << col2 << ", " << col3 << ", " << col4;
395 ptsHashMap[col1] = {col2, col3, col4};
396 } else {
397 MOFEM_LOG("EP", Sev::error) << "Error parsing line: " << line;
398 }
399 }
400
401 file.close(); // Close the file
403};
404
407
408 std::array<double, SPACE_DIM> field_eval_coords{};
409 PetscInt coords_dim = SPACE_DIM;
410 PetscBool do_eval_field = PETSC_FALSE;
411 CHKERR PetscOptionsGetRealArray(
412 PETSC_NULLPTR, PETSC_NULLPTR, "-field_eval_coords",
413 field_eval_coords.data(), &coords_dim, &do_eval_field);
414
415 if (do_eval_field && coords_dim != SPACE_DIM)
416 SETERRQ(PETSC_COMM_WORLD, MOFEM_INVALID_DATA,
417 "-field_eval_coords requires exactly three coordinates");
418
419 if (do_eval_field) {
420 ptsHashMap["field_eval_coords"] = field_eval_coords;
421 MOFEM_LOG_C("EP", Sev::inform,
422 "FieldEvaluator added command-line point [%6.4e, %6.4e, "
423 "%6.4e]",
424 field_eval_coords[0], field_eval_coords[1],
425 field_eval_coords[2]);
426 }
427
429}
430
433 boost::shared_ptr<Ele> vol_ele(dataFieldEval->feMethodPtr);
434 auto no_rule = [](int, int, int) { return -1; };
435 vol_ele->getRuleHook = no_rule;
436 vol_ele->getUserPolynomialBase() =
437 boost::make_shared<CGGUserPolynomialBase>();
438 EshelbianPlasticity::AddHOOps<SPACE_DIM, SPACE_DIM, SPACE_DIM>::add(
439 vol_ele->getOpPtrVector(), {HDIV, H1, L2}, eP.materialH1Positions,
441
442 auto piola_scale_ptr = boost::make_shared<double>(1.0);
443 vol_ele->getOpPtrVector().push_back(new OpCalculateHVecTensorField<3, 3>(
444 eP.piolaStress, eP.dataAtPts->getApproxPAtPts(), piola_scale_ptr));
445 vol_ele->getOpPtrVector().push_back(new OpCalculateHTensorTensorField<3, 3>(
446 eP.bubbleField, eP.dataAtPts->getApproxPAtPts(), piola_scale_ptr,
447 SmartPetscObj<Vec>(), MBMAXTYPE));
448 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
449 eP.rotAxis, eP.dataAtPts->getRotAxisAtPts(), MBTET));
451 pushOpCalculateStretchFromStress(
452 vol_ele->getOpPtrVector(), eP.physicalEquations, eP.dataAtPts,
454 } else {
455 vol_ele->getOpPtrVector().push_back(
456 new OpCalculateTensor2SymmetricFieldValues<3>(
457 eP.stretchTensor, eP.dataAtPts->getLogStretchTensorAtPts(), MBTET));
458 }
459 CHKERR VecSetDM(eP.solTSStep, PETSC_NULLPTR);
460 vol_ele->getOpPtrVector().push_back(new OpCalculateHVecTensorField<3, 3>(
461 eP.piolaStress, eP.dataAtPts->getApproxP0AtPts(), nullptr,
462 eP.solTSStep));
464 vol_ele->getOpPtrVector().push_back(
465 new OpCalculateTensor2SymmetricFieldValues<3>(
466 eP.stretchTensor, eP.dataAtPts->getLogStretchTensor0AtPts(),
467 eP.solTSStep, MBTET));
468 }
469 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
470 eP.rotAxis, eP.dataAtPts->getRotAxis0AtPts(), eP.solTSStep, MBTET));
471 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
472 eP.spatialL2Disp, eP.dataAtPts->getSmallWL2AtPts(), MBTET));
473
474 // H1 displacements
475 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
476 eP.spatialH1Disp, eP.dataAtPts->getSmallWH1AtPts()));
477 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldGradient<3, 3>(
478 eP.spatialH1Disp, eP.dataAtPts->getSmallWGradH1AtPts()));
479
480 vol_ele->getOpPtrVector().push_back(
483};
484
487
488 for (const auto &[label, point] : ptsHashMap)
489 CHKERR postProcAtPoints(point, label);
490
491 if (!ptsHashMap.empty())
493
495}
496
497MoFEMErrorCode EshelbianMonitor::postProcAtPoints(std::array<double, 3> point,
498 std::string str) {
500
501 dataFieldEval->setEvalPoints(point.data(), point.size() / 3);
502 auto point_found_ptr = boost::make_shared<int>(0);
503
504 struct OpPrint : public VolOp {
505
506 EshelbianCore &eP;
507 std::array<double, 3> point;
508 std::string str;
509 boost::shared_ptr<int> pointFoundPtr;
510 PetscInt step;
511 double time;
512
513 OpPrint(EshelbianCore &ep, std::array<double, 3> &point, std::string &str,
514 boost::shared_ptr<int> point_found_ptr, PetscInt step, double time)
515 : VolOp(ep.spatialL2Disp, VolOp::OPROW), eP(ep), point(point),
516 str(str), pointFoundPtr(point_found_ptr), step(step), time(time) {}
517
518 MoFEMErrorCode doWork(int side, EntityType type,
519 EntitiesFieldData::EntData &data) {
521 if (type == MBTET) {
522 const int nb_gauss_pts = getGaussPts().size2();
523 if (nb_gauss_pts) {
524 *pointFoundPtr = 1;
525
526 auto t_h = eP.dataAtPts->getFTensorSmallH(nb_gauss_pts);
527 auto t_approx_P = eP.dataAtPts->getFTensorApproxP(nb_gauss_pts);
528 auto t_disp =
529 getFTensor1FromMat<SPACE_DIM>(*eP.dataAtPts->getSmallWL2AtPts());
530
531 FTensor::Index<'i', 3> i;
532 FTensor::Index<'j', 3> j;
533 FTensor::Index<'k', 3> k;
534 const double jac = determinantTensor3by3(t_h);
536 t_cauchy(i, j) = (1. / jac) * (t_approx_P(i, k) * t_h(j, k));
537
538 auto add = [&]() {
539 std::ostringstream s;
540 s << str << " elem " << getFEEntityHandle() << " ";
541 return s.str();
542 };
543
544 auto print_tensor = [](auto &t) {
545 std::ostringstream s;
546 s << t;
547 return s.str();
548 };
549
550 std::ostringstream print;
551 MOFEM_LOG("EPSYNC", Sev::inform)
552 << add() << "comm rank " << eP.mField.get_comm_rank();
553 MOFEM_LOG("EPSYNC", Sev::inform)
554 << add() << "point " << getVectorAdaptor(point.data(), 3);
555 MOFEM_LOG("EPSYNC", Sev::inform)
556 << add() << "coords at gauss pts " << getCoordsAtGaussPts();
557 MOFEM_LOG("EPSYNC", Sev::inform)
558 << add() << "w " << *(eP.dataAtPts->getSmallWL2AtPts());
559 MOFEM_LOG("EPSYNC", Sev::inform)
560 << add() << "Piola " << *(eP.dataAtPts->getApproxPAtPts());
561 MOFEM_LOG("EPSYNC", Sev::inform)
562 << add() << "Cauchy " << print_tensor(t_cauchy);
564 "EPSYNC", Sev::inform,
565 "FieldEvaluator step %d time %6.4e label \"%s\" point [%6.4e, "
566 "%6.4e, %6.4e]",
567 step, time, str.c_str(), point[0], point[1], point[2]);
568 MOFEM_LOG_C("EPSYNC", Sev::inform,
569 "FieldEvaluator displacement [Ux, Uy, Uz] = [%6.4e, "
570 "%6.4e, %6.4e]",
571 t_disp(0), t_disp(1), t_disp(2));
573 "EPSYNC", Sev::inform,
574 "FieldEvaluator Cauchy stress [Sxx, Syy, Szz, Sxy, Syz, Sxz] "
575 "= [%6.4e, %6.4e, %6.4e, %6.4e, %6.4e, %6.4e]",
576 t_cauchy(0, 0), t_cauchy(1, 1), t_cauchy(2, 2),
577 t_cauchy(0, 1), t_cauchy(1, 2), t_cauchy(0, 2));
578 }
579 }
581 }
582 };
583
584 if (auto fe_ptr = dataFieldEval->feMethodPtr) {
585 fe_ptr->data_ctx |= PetscData::CtxSetTime;
586 fe_ptr->ts_t = EshelbianCore::physicalTimeFlg
588 : ts_t;
589 fe_ptr->ts_dt =
591
592 const double time = EshelbianCore::physicalTimeFlg
594 : ts_t;
595 fe_ptr->getOpPtrVector().push_back(
596 new OpPrint(eP, point, str, point_found_ptr, ts_step, time));
597 CHKERR eP.mField.getInterface<FieldEvaluatorInterface>()
598 ->evalFEAtThePoint<SPACE_DIM>(
599 point.data(), 1e-12, problemPtr->getName(), "EP", dataFieldEval,
601 MF_EXIST, QUIET);
602 fe_ptr->getOpPtrVector().pop_back();
603 }
604
605 int global_point_found = 0;
606 MPI_Allreduce(point_found_ptr.get(), &global_point_found, 1, MPI_INT, MPI_SUM,
607 eP.mField.get_comm());
608 if (!global_point_found && !eP.mField.get_comm_rank())
609 MOFEM_LOG_C("EP", Sev::warning,
610 "FieldEvaluator did not find point [%6.4e, %6.4e, %6.4e] in "
611 "the EP domain",
612 point[0], point[1], point[2]);
613
615}
std::string type
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_LOG_C(channel, severity, format,...)
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_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< ExternalStrainVec > externalStrainVecPtr
boost::shared_ptr< Range > frontAdjEdges
MoFEM::Interface & mField
const std::string spatialL2Disp
std::map< std::string, boost::shared_ptr< ScalingMethod > > timeScaleMap
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
static enum MaterialModel materialModel
MoFEMErrorCode calculateCrackArea(boost::shared_ptr< double > &area_ptr)
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
static bool isNoStretch()
SmartPetscObj< Vec > solTSStep
boost::shared_ptr< Range > frontEdges
const std::string stretchTensor
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
PetscBool do_eval_field
Evaluate field.
Definition plastic.cpp:120
auto save_range