v0.15.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
EshelbianMonitor Struct Reference
Inheritance diagram for EshelbianMonitor:
[legend]
Collaboration diagram for EshelbianMonitor:
[legend]

Public Types

using Ele = ForcesAndSourcesCore
 
using VolEle = VolumeElementForcesAndSourcesCore
 
using VolOp = VolumeElementForcesAndSourcesCore::UserDataOperator
 
using SetPtsData = FieldEvaluatorInterface::SetPtsData
 
using PtsHashMap = std::map< std::string, std::array< double, 3 > >
 
using FaceSideEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::FaceSideEle
 

Public Member Functions

 EshelbianMonitor (EshelbianCore &ep)
 
MoFEMErrorCode preProcess ()
 
MoFEMErrorCode operator() ()
 
MoFEMErrorCode postProcess ()
 

Public Attributes

EshelbianCoreeP
 
boost::shared_ptr< SetPtsDatadataFieldEval
 
boost::shared_ptr< VolElevolPostProcEnergy
 
boost::shared_ptr< doublegEnergy
 
PtsHashMap ptsHashMap
 
PetscBool writeRestart = PETSC_FALSE
 

Detailed Description

Definition at line 6 of file EshelbianMonitor.cpp.

Member Typedef Documentation

◆ Ele

Definition at line 8 of file EshelbianMonitor.cpp.

◆ FaceSideEle

using EshelbianMonitor::FaceSideEle = PipelineManager::ElementsAndOpsByDim<SPACE_DIM>::FaceSideEle

Definition at line 13 of file EshelbianMonitor.cpp.

◆ PtsHashMap

using EshelbianMonitor::PtsHashMap = std::map<std::string, std::array<double, 3> >

Definition at line 12 of file EshelbianMonitor.cpp.

◆ SetPtsData

using EshelbianMonitor::SetPtsData = FieldEvaluatorInterface::SetPtsData

Definition at line 11 of file EshelbianMonitor.cpp.

◆ VolEle

using EshelbianMonitor::VolEle = VolumeElementForcesAndSourcesCore

Definition at line 9 of file EshelbianMonitor.cpp.

◆ VolOp

using EshelbianMonitor::VolOp = VolumeElementForcesAndSourcesCore::UserDataOperator

Definition at line 10 of file EshelbianMonitor.cpp.

Constructor & Destructor Documentation

◆ EshelbianMonitor()

EshelbianMonitor::EshelbianMonitor ( EshelbianCore ep)
inline

Definition at line 23 of file EshelbianMonitor.cpp.

24 : eP(ep), dataFieldEval(ep.mField.getInterface<FieldEvaluatorInterface>()
25 ->getData<VolEle>()),
26 volPostProcEnergy(new VolEle(ep.mField)), gEnergy(new double) {
28 ep.mField.getInterface<FieldEvaluatorInterface>()->buildTree<SPACE_DIM>(
29 dataFieldEval, "EP"),
30 "build field evaluator tree");
31
32 auto no_rule = [](int, int, int) { return -1; };
33
34 auto set_element_for_field_eval = [&]() {
36 boost::shared_ptr<Ele> vol_ele(dataFieldEval->feMethodPtr.lock());
37 vol_ele->getRuleHook = no_rule;
38 vol_ele->getUserPolynomialBase() =
39 boost::make_shared<CGGUserPolynomialBase>();
40 EshelbianPlasticity::AddHOOps<SPACE_DIM, SPACE_DIM, SPACE_DIM>::add(
41 vol_ele->getOpPtrVector(), {HDIV, H1, L2}, eP.materialH1Positions,
42 ep.frontAdjEdges);
43
44 auto piola_scale_ptr = boost::make_shared<double>(1.0);
45 vol_ele->getOpPtrVector().push_back(
46 eP.physicalEquations->returnOpSetScale(piola_scale_ptr,
48 vol_ele->getOpPtrVector().push_back(new OpCalculateHVecTensorField<3, 3>(
49 eP.piolaStress, eP.dataAtPts->getApproxPAtPts(), piola_scale_ptr));
50 vol_ele->getOpPtrVector().push_back(
51 new OpCalculateHTensorTensorField<3, 3>(
52 eP.bubbleField, eP.dataAtPts->getApproxPAtPts(), piola_scale_ptr,
53 SmartPetscObj<Vec>(), MBMAXTYPE));
55 vol_ele->getOpPtrVector().push_back(
56 eP.physicalEquations->returnOpCalculateStretchFromStress(
58 } else {
59 vol_ele->getOpPtrVector().push_back(
60 new OpCalculateTensor2SymmetricFieldValues<3>(
61 eP.stretchTensor, eP.dataAtPts->getLogStretchTensorAtPts(),
62 MBTET));
63 }
64 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
65 eP.rotAxis, eP.dataAtPts->getRotAxisAtPts(), MBTET));
66 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
67 eP.rotAxis, eP.dataAtPts->getRotAxis0AtPts(), eP.solTSStep, MBTET));
68 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
69 eP.spatialL2Disp, eP.dataAtPts->getSmallWL2AtPts(), MBTET));
70
71 // H1 displacements
72 vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
73 eP.spatialH1Disp, eP.dataAtPts->getSmallWH1AtPts()));
74 vol_ele->getOpPtrVector().push_back(
75 new OpCalculateVectorFieldGradient<3, 3>(
76 eP.spatialH1Disp, eP.dataAtPts->getSmallWGradH1AtPts()));
77
78 vol_ele->getOpPtrVector().push_back(
81 };
82
83 auto set_element_for_post_process_energy = [&]() {
85
87 1, false, false, false, SmartPetscObj<Vec>(), volPostProcEnergy);
88
89 if (auto op = eP.physicalEquations->returnOpCalculateEnergy(eP.dataAtPts,
90 gEnergy)) {
91 volPostProcEnergy->getOpPtrVector().push_back(op);
92 }
93
95 };
96
97 auto reads_post_proc_data = [](PtsHashMap &pts_hash_map) {
99 std::ifstream file(
100 "points.txt"); // Open the file with the name "data.txt"
101
102 if (!file.is_open()) {
104 }
105
106 std::string line;
107
108 while (std::getline(file, line)) {
109 std::istringstream iss(line);
110 std::string col1;
111 double col2, col3, col4;
112
113 if (iss >> col1 >> col2 >> col3 >> col4) {
114 MOFEM_LOG("EP", Sev::verbose) << "Read: " << col1 << ", " << col2
115 << ", " << col3 << ", " << col4;
116 pts_hash_map[col1] = {col2, col3, col4};
117 } else {
118 MOFEM_LOG("EP", Sev::error) << "Error parsing line: " << line;
119 }
120 }
121
122 file.close(); // Close the file
124 };
125
126 CHK_THROW_MESSAGE(set_element_for_field_eval(), "set element for field");
127 CHK_THROW_MESSAGE(set_element_for_post_process_energy(),
128 "set element for post energy");
129
130 PetscBool test_cook_flg = PETSC_FALSE;
131 CHK_THROW_MESSAGE(PetscOptionsGetBool(PETSC_NULLPTR, "", "-test_cook_pts",
132 &test_cook_flg, PETSC_NULLPTR),
133 "get post proc points");
134 if (test_cook_flg) {
135 ptsHashMap["Point A"] = {48., 60., 4.999};
136 ptsHashMap["Point B"] = {48. / 2., 44. + (60. - 44.) / 2., 0.};
137 ptsHashMap["Point C"] = {48. / 2., (44. - 0.) / 2., 0.};
138 }
139
140 PetscInt atom_test = 0;
141
142 CHKERR PetscOptionsGetInt(PETSC_NULLPTR, "", "-atom_test", &atom_test,
143 PETSC_NULLPTR);
144 if (atom_test == 14) {
145 // Points for atom test 14: check external strain
146 ptsHashMap["Point (2.5, 0., 0.)"] = {2.5, 0, 0.};
147 }
148 CHK_MOAB_THROW(reads_post_proc_data(ptsHashMap), "read post proc points");
149
150 CHK_THROW_MESSAGE(PetscOptionsGetBool(PETSC_NULLPTR, "", "-write_restart",
151 &writeRestart, PETSC_NULLPTR),
152 "get write restart option");
153 }
constexpr int SPACE_DIM
[Define dimension]
#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.
#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.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
boost::shared_ptr< Range > frontAdjEdges
MoFEM::Interface & mField
const std::string spatialL2Disp
const std::string materialH1Positions
MoFEMErrorCode setBaseVolumeElementOps(const int tag, const bool do_rhs, const bool do_lhs, const bool calc_rates, SmartPetscObj< Vec > ver_vec, boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe)
const std::string spatialH1Disp
const std::string piolaStress
const std::string bubbleField
static PetscBool noStretch
boost::shared_ptr< PhysicalEquations > physicalEquations
const std::string rotAxis
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
SmartPetscObj< Vec > solTSStep
const std::string stretchTensor
boost::shared_ptr< double > gEnergy
boost::shared_ptr< VolEle > volPostProcEnergy
boost::shared_ptr< SetPtsData > dataFieldEval
EshelbianCore & eP
std::map< std::string, std::array< double, 3 > > PtsHashMap
VolumeElementForcesAndSourcesCore VolEle
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
int atom_test
Atom test.
Definition plastic.cpp:121

Member Function Documentation

◆ operator()()

MoFEMErrorCode EshelbianMonitor::operator() ( )
inline

Definition at line 157 of file EshelbianMonitor.cpp.

157{ return 0; }

◆ postProcess()

MoFEMErrorCode EshelbianMonitor::postProcess ( )
inline

Definition at line 159 of file EshelbianMonitor.cpp.

159 {
161
162 MOFEM_LOG("EP", Sev::inform) << "Monitor postProcess";
163
164 // Get boundary faces marked in blocks name "SPATIAL_DISP_...".
165 auto get_ents_on_mesh_skin = [&]() {
166
167 std::map<std::string, Range> boundary_entities_vec;
168
169 auto get_bock_vec_impl = [&](auto block_name) {
170 return eP.mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
171 std::regex(
172
173 (boost::format("%s(.*)") % block_name).str()
174
175 ));
176 };
177
178 auto add_blockset_ents_impl = [&](auto &&vec) {
180 for (auto it : vec) {
181 Range boundary_entities;
182 CHKERR it->getMeshsetIdEntitiesByDimension(eP.mField.get_moab(), 2,
183 boundary_entities, true);
184 std::string meshset_name = it->getName();
185 boundary_entities_vec[meshset_name] = boundary_entities;
186 boundary_entities.clear();
187 }
189 };
190
191 for (auto block_name : {"SPATIAL_DISP", "FIX", "CONTACT",
192 "SPATIAL_ROTATION", "NORMAL_DISPLACEMENT"}) {
193 CHK_THROW_MESSAGE(add_blockset_ents_impl(get_bock_vec_impl(block_name)),
194 "add blockset entities");
195 }
196
197 return boundary_entities_vec;
198 };
199
200 auto boundary_entities_vec = get_ents_on_mesh_skin();
201
202 std::vector<std::tuple<std::string, Range, std::array<double, 6>>>
203 reactionForces;
204 for (const auto &pair : boundary_entities_vec) {
205 reactionForces.push_back(
206 std::make_tuple(pair.first, pair.second,
207 std::array<double, 6>{0.0, 0.0, 0.0, 0.0, 0.0, 0.0}));
208 }
209
210 auto integration_rule_face = [](int, int, int approx_order) {
211 return 2 * approx_order + 1;
212 };
213 auto face_fe =
214 boost::make_shared<FaceElementForcesAndSourcesCore>(eP.mField);
215 auto no_rule = [](int, int, int) { return -1; };
216 face_fe->getRuleHook = integration_rule_face;
217 CHKERR
218 EshelbianPlasticity::AddHOOps<SPACE_DIM - 1, SPACE_DIM, SPACE_DIM>::add(
219 face_fe->getOpPtrVector(), {L2}, eP.materialH1Positions,
221
222 auto op_side =
223 new OpLoopSide<FaceSideEle>(eP.mField, "EP", SPACE_DIM, Sev::noisy);
224 face_fe->getOpPtrVector().push_back(op_side);
225 auto side_fe_ptr = op_side->getSideFEPtr();
226 auto base_ptr =
227 boost::make_shared<EshelbianPlasticity::CGGUserPolynomialBase>();
228 side_fe_ptr->getUserPolynomialBase() = base_ptr;
229 CHKERR EshelbianPlasticity::AddHOOps<SPACE_DIM, SPACE_DIM, SPACE_DIM>::add(
230 side_fe_ptr->getOpPtrVector(), {H1, HDIV, L2}, eP.materialH1Positions,
232 auto piola_scale_ptr = boost::make_shared<double>(1.0);
233 side_fe_ptr->getOpPtrVector().push_back(
234 eP.physicalEquations->returnOpSetScale(piola_scale_ptr,
236 side_fe_ptr->getOpPtrVector().push_back(
237 new OpCalculateHVecTensorField<SPACE_DIM, SPACE_DIM>(
238 eP.piolaStress, eP.dataAtPts->getApproxPAtPts(), piola_scale_ptr));
239 side_fe_ptr->getOpPtrVector().push_back(
240 new OpCalculateHTensorTensorField<3, 3>(
241 eP.bubbleField, eP.dataAtPts->getApproxPAtPts(), MBMAXTYPE));
242 side_fe_ptr->getOpPtrVector().push_back(
244 side_fe_ptr->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
245 eP.spatialL2Disp, eP.dataAtPts->getSmallWL2AtPts(), MBTET));
246 for (auto &[name, ents, reaction_vec] : reactionForces) {
247 face_fe->getOpPtrVector().push_back(new OpCalculateReactionForces(
248 eP.dataAtPts, name, ents, reaction_vec));
249 }
250
251 CHKERR eP.mField.loop_finite_elements(problemPtr->getName(), eP.skinElement,
252 *face_fe);
253
254 for (auto &[name, ents, reaction_vec] : reactionForces) {
255 std::array<double, 6> block_reaction_force{0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
256
257 MPI_Allreduce(reaction_vec.data(), &block_reaction_force, 6, MPI_DOUBLE,
258 MPI_SUM, eP.mField.get_comm());
259
260 for (auto &force : block_reaction_force) {
261 if (std::abs(force) < 1e-12) {
262 force = 0.0;
263 }
264 }
266 "EP", Sev::inform,
267 "Step %d time %3.4g Block %s Reaction force [%3.6e, %3.6e, %3.6e]",
268 ts_step, ts_t, name.c_str(), block_reaction_force[0],
269 block_reaction_force[1], block_reaction_force[2]);
270 MOFEM_LOG_C("EP", Sev::inform,
271 "Step %d time %3.4g Block %s Moment [%3.6e, %3.6e, %3.6e]",
272 ts_step, ts_t, name.c_str(), block_reaction_force[3],
273 block_reaction_force[4], block_reaction_force[5]);
274 }
275
276 auto get_step = [](auto ts_step) {
277 std::ostringstream ss;
278 ss << boost::str(boost::format("%d") % static_cast<int>(ts_step));
279 std::string s = ss.str();
280 return s;
281 };
282
283 if (writeRestart && ts_u) {
284 PetscViewer viewer;
285 CHKERR PetscViewerBinaryOpen(
286 PETSC_COMM_WORLD, ("restart_" + get_step(ts_step) + ".dat").c_str(),
287 FILE_MODE_WRITE, &viewer);
288 CHKERR VecView(ts_u, viewer);
289 CHKERR PetscViewerDestroy(&viewer);
290 }
291
292 CHKERR eP.postProcessResults(1, "out_sol_elastic_" + get_step(ts_step) +
293 ".h5m");
294
295
296
297 // Function to get material force tags
298 auto get_material_force_tags = [&]() {
299 auto &moab = eP.mField.get_moab();
300 std::vector<Tag> tag(2);
301 CHK_MOAB_THROW(moab.tag_get_handle("MaterialForce", tag[0]),
302 "can't get tag");
303 CHK_MOAB_THROW(moab.tag_get_handle("FacePressure", tag[1]),
304 "can't get tag");
305 return tag;
306 };
308
309 // Post-process skeleton elements
310 bool post_process_skeleton = false;
311#ifndef NDEBUG
312 post_process_skeleton = true;
313#endif
314 if (post_process_skeleton) {
316 1, "out_skeleton_" + get_step(ts_step) + ".h5m", PETSC_NULLPTR,
317 get_material_force_tags());
318 }
319
320 // Loop boundary elements with traction boundary conditions
321 *gEnergy = 0;
322 TetPolynomialBase::switchCacheBaseOn<HDIV>({volPostProcEnergy.get()});
323 CHKERR eP.mField.loop_finite_elements(problemPtr->getName(), "EP",
325 TetPolynomialBase::switchCacheBaseOff<HDIV>({volPostProcEnergy.get()});
326
327 double body_energy = 0;
328 MPI_Allreduce(gEnergy.get(), &body_energy, 1, MPI_DOUBLE, MPI_SUM,
329 eP.mField.get_comm());
331 auto crack_area_ptr = boost::make_shared<double>(0.0);
332 CHKERR eP.calculateCrackArea(crack_area_ptr);
333 MOFEM_LOG_C("EP", Sev::inform,
334 "Step %d time %3.4g strain energy %3.6e crack "
335 "area %3.6e",
336 ts_step, ts_t, body_energy, *crack_area_ptr);
337 if (eP.mField.get_comm_rank() == 0) {
338 auto crack_faces = *eP.crackFaces;
339 if (crack_faces.empty()) {
340 crack_faces = *eP.frontEdges;
341 }
344 (boost::format("crack_faces_step_%d.vtk") % ts_step).str(),
345 crack_faces);
348 (boost::format("front_edges_step_%d.vtk") % ts_step).str(),
349 *eP.frontEdges);
350 }
351
352 } else {
353 MOFEM_LOG_C("EP", Sev::inform, "Step %d time %3.4g strain energy %3.6e",
354 ts_step, ts_t, body_energy);
355 }
356
357 auto post_proc_at_points = [&](std::array<double, 3> point,
358 std::string str) {
360
361 dataFieldEval->setEvalPoints(point.data(), point.size() / 3);
362
363 struct OpPrint : public VolOp {
364
365 EshelbianCore &eP;
366 std::array<double, 3> point;
367 std::string str;
368
369 OpPrint(EshelbianCore &ep, std::array<double, 3> &point,
370 std::string &str)
371 : VolOp(ep.spatialL2Disp, VolOp::OPROW), eP(ep), point(point),
372 str(str) {}
373
374 MoFEMErrorCode doWork(int side, EntityType type,
375 EntitiesFieldData::EntData &data) {
377 if (type == MBTET) {
378 if (getGaussPts().size2()) {
379
380 auto t_h = getFTensor2FromMat<3, 3>(eP.dataAtPts->hAtPts);
381 auto t_approx_P =
382 getFTensor2FromMat<3, 3>(eP.dataAtPts->approxPAtPts);
383
384 FTensor::Index<'i', 3> i;
385 FTensor::Index<'j', 3> j;
386 FTensor::Index<'k', 3> k;
387 const double jac = determinantTensor3by3(t_h);
389 t_cauchy(i, j) = (1. / jac) * (t_approx_P(i, k) * t_h(j, k));
390
391 auto add = [&]() {
392 std::ostringstream s;
393 s << str << " elem " << getFEEntityHandle() << " ";
394 return s.str();
395 };
396
397 auto print_tensor = [](auto &t) {
398 std::ostringstream s;
399 s << t;
400 return s.str();
401 };
402
403 std::ostringstream print;
404 MOFEM_LOG("EPSYNC", Sev::inform)
405 << add() << "comm rank " << eP.mField.get_comm_rank();
406 MOFEM_LOG("EPSYNC", Sev::inform)
407 << add() << "point " << getVectorAdaptor(point.data(), 3);
408 MOFEM_LOG("EPSYNC", Sev::inform)
409 << add() << "coords at gauss pts " << getCoordsAtGaussPts();
410 MOFEM_LOG("EPSYNC", Sev::inform)
411 << add() << "w " << eP.dataAtPts->wL2AtPts;
412 MOFEM_LOG("EPSYNC", Sev::inform)
413 << add() << "Piola " << eP.dataAtPts->approxPAtPts;
414 MOFEM_LOG("EPSYNC", Sev::inform)
415 << add() << "Cauchy " << print_tensor(t_cauchy);
416 }
417 }
419 }
420 };
421
422 if (auto fe_ptr = dataFieldEval->feMethodPtr.lock()) {
423
424 fe_ptr->getOpPtrVector().push_back(new OpPrint(eP, point, str));
425 CHKERR eP.mField.getInterface<FieldEvaluatorInterface>()
426 ->evalFEAtThePoint<SPACE_DIM>(
427 point.data(), 1e-12, problemPtr->getName(), "EP", dataFieldEval,
429 MF_EXIST, QUIET);
430 fe_ptr->getOpPtrVector().pop_back();
431 }
432
434 };
435
436 auto check_external_strain = [&](std::array<double, 3> point,
437 std::string str, PetscInt atom_test) {
439
440 dataFieldEval->setEvalPoints(point.data(), point.size() / 3);
441 auto vec = createVectorMPI(eP.mField.get_comm(), 1, 1);
442 eP.dataAtPts->wL2AtPts.resize(0, 0, false);
443
444 if (auto fe_ptr = dataFieldEval->feMethodPtr.lock()) {
445 CHKERR eP.mField.getInterface<FieldEvaluatorInterface>()
446 ->evalFEAtThePoint<SPACE_DIM>(
447 point.data(), 1e-12, problemPtr->getName(), "EP", dataFieldEval,
449 MF_EXIST, QUIET);
450 }
451 if (eP.dataAtPts->wL2AtPts.size2() == 0) {
452 VecSetValue(vec, 0, 0.0, ADD_VALUES);
453 } else if (eP.dataAtPts->wL2AtPts.size2() == 1) {
454 auto add = [&]() {
455 std::ostringstream s;
456 s << str << " elem " << getFEEntityHandle() << " ";
457 return s.str();
458 };
459 MOFEM_LOG("EPSYNC", Sev::inform)
460 << add() << "comm rank " << eP.mField.get_comm_rank();
461 MOFEM_LOG("EPSYNC", Sev::inform)
462 << add() << "point " << getVectorAdaptor(point.data(), 3);
463 MOFEM_LOG("EPSYNC", Sev::inform)
464 << add() << "w " << eP.dataAtPts->wL2AtPts;
465 double disp_at_point = eP.dataAtPts->wL2AtPts(0);
466 VecSetValue(vec, 0, disp_at_point, ADD_VALUES);
467 }
468
470 if (ts_t > 0.0) {
471 CHKERR VecAssemblyBegin(vec);
472 CHKERR VecAssemblyEnd(vec);
473 double error;
474 PetscInt idx = 0;
475 if (eP.mField.get_comm_rank() == 0) {
476 CHKERR VecGetValues(vec, 1, &idx, &error);
477 }
478 MPI_Bcast(&error, 1, MPI_DOUBLE, 0, PETSC_COMM_WORLD);
479 // Check if the displacement is correct for the applied external
480 // strain For the bar problem, we expect a displacement of 0.25 at
481 // point A
482 if (std::abs(error - 0.25) > 1e-5) {
483 SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
484 "Atom test %d failed: wrong displacement.", atom_test);
485 }
486 }
488 };
489
490 PetscInt atom_test = 0;
491 CHKERR PetscOptionsGetInt(PETSC_NULLPTR, "", "-atom_test", &atom_test,
492 PETSC_NULLPTR);
493
494 if (atom_test == 14) {
495 // Points for external strain
496 for (auto &pts : ptsHashMap) {
497 CHKERR check_external_strain(pts.second, pts.first, atom_test);
498 }
499 } else {
500 // Points for Cook beam
501 for (auto &pts : ptsHashMap) {
502 CHKERR post_proc_at_points(pts.second, pts.first);
504 }
505 }
506
507 if (eP.crackingOn) {
508 }
509
511 }
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_LOG_C(channel, severity, format,...)
@ QUIET
@ MF_EXIST
@ MOFEM_ATOM_TEST_INVALID
Definition definitions.h:40
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
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition Templates.hpp:31
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
MoFEMErrorCode determinantTensor3by3(T1 &t, T2 &det)
Calculate determinant 3 by 3.
constexpr double t
plate stiffness
Definition plate.cpp:58
static constexpr int approx_order
static PetscBool crackingOn
MoFEMErrorCode calculateFaceMaterialForce(const int tag, TS ts)
MoFEMErrorCode calculateCrackArea(boost::shared_ptr< double > area_ptr)
MoFEMErrorCode postProcessSkeletonResults(const int tag, const std::string file, Vec f_residual=PETSC_NULLPTR, std::vector< Tag > tags_to_transfer={})
const std::string skinElement
MoFEMErrorCode postProcessResults(const int tag, const std::string file, Vec f_residual=PETSC_NULLPTR, Vec var_vec=PETSC_NULLPTR, std::vector< Tag > tags_to_transfer={})
boost::shared_ptr< Range > crackFaces
boost::shared_ptr< Range > frontEdges
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
auto save_range

◆ preProcess()

MoFEMErrorCode EshelbianMonitor::preProcess ( )
inline

Definition at line 155 of file EshelbianMonitor.cpp.

155{ return 0; }

Member Data Documentation

◆ dataFieldEval

boost::shared_ptr<SetPtsData> EshelbianMonitor::dataFieldEval

Definition at line 17 of file EshelbianMonitor.cpp.

◆ eP

EshelbianCore& EshelbianMonitor::eP

Definition at line 16 of file EshelbianMonitor.cpp.

◆ gEnergy

boost::shared_ptr<double> EshelbianMonitor::gEnergy

Definition at line 19 of file EshelbianMonitor.cpp.

◆ ptsHashMap

PtsHashMap EshelbianMonitor::ptsHashMap

Definition at line 20 of file EshelbianMonitor.cpp.

◆ volPostProcEnergy

boost::shared_ptr<VolEle> EshelbianMonitor::volPostProcEnergy

Definition at line 18 of file EshelbianMonitor.cpp.

◆ writeRestart

PetscBool EshelbianMonitor::writeRestart = PETSC_FALSE

Definition at line 21 of file EshelbianMonitor.cpp.


The documentation for this struct was generated from the following file: