v0.16.0
Loading...
Searching...
No Matches
EshelbianCore.hpp
Go to the documentation of this file.
1/**
2 * @file EshelbianCore.hpp
3 * @author your name (you@domain.com)
4 * @brief
5 * @version 0.1
6 * @date 2024-12-31
7 *
8 * @copyright Copyright (c) 2024
9 *
10 */
11
13
23
24 static inline const char *listSolvers[] = {"time_solver",
25 "dynamic_relaxation",
26 "cohesive",
27 "load_factor",
28 "shape_optimization",
29 "test_topological_derivative"};
30
40
46
47 // That exploits fact that full system is symmetric
48 static inline constexpr enum SymmetrySelector symmetrySelector = SYMMETRIC;
49
50 static inline enum SolverType solverType = TimeSolver;
52 static inline enum RotSelector rotSelector = LARGE_ROT;
53 static inline enum RotSelector gradApproximator = LARGE_ROT;
54 static inline enum StretchSelector stretchSelector = LOG;
55 static inline enum StretchHandling stretchHandling =
56 FULL_ORDER_STREACH; //< stretch field handling
57 static inline bool isNoStretch() {
59 }
60 static inline PetscBool setSingularity = PETSC_FALSE; //< set singularity
61 static inline PetscBool physicalTimeFlg =
62 PETSC_FALSE; //< switch on/off dynamic relaxation
63 static inline PetscBool crackingOn = PETSC_FALSE; //< cracking on
64 static inline double crackingStartTime = -1; //< time when crack starts to grow
65 static inline double crackingAddTime = -1; //< time to add new crack surface
66 static inline int nbJIntegralContours =
67 0; //< number of contours for J integral evaluation
68 static inline double finalPhysicalTime = 0; //< Maximum step for non-time solver
69 static inline double currentPhysicalTime =
70 0; //< Current step for non-time solver
71 static inline double physicalDt = 0; //< Step size for non-time solver
72 static inline int physicalMaxSteps = 20; //< maximum iterations for non-time solver
73 static inline int physicalStepNumber = 0; //< Step number for non-time solver
74 static inline PetscBool physicalH1Update =
75 PETSC_FALSE; //< update H1 space at each non-time solver step
76 static inline PetscBool l2UserBaseScale = PETSC_FALSE; //< scale L2 user base
77 static inline int addCrackMeshsetId = 1000; //< add crack meshset id
78 static inline double griffithEnergy = 1; ///< Griffith energy
79 static inline double crackingRtol = 1e-10; ///< Cracking relative tolerance
80 static inline double crackingAtol = 1e-12; ///< Cracking absolute tolerance
81 static inline enum EnergyReleaseSelector energyReleaseSelector =
82 GRIFFITH_SKELETON; //< energy release selector
83 static inline std::string internalStressTagName =
84 ""; //< internal stress tag name
85 static inline PetscBool internalStressVoigt =
86 PETSC_FALSE; //< internal stress index notation
87 static inline PetscBool interfaceCrack =
88 PETSC_FALSE; //< interface crack tracking
89 static inline int interfaceRemoveLevel =
90 0; //< number of levels of elements to remove around interface crack
91 static inline std::string heterogeneousYoungModTagName =
92 ""; //< heterogenous young's modulus
93 static inline bool hasNonHomogeneousMaterialBlock = false;
94 static inline std::string meshTransferSourceMeshFileName =
95 ""; //< source mesh file name for projection material tags
96 static inline int meshTransferInterpOrder =
97 1; //< interpolation order for projection material tags
98 static inline PetscBool meshTransferSourceMeshFileSpecified =
99 PETSC_FALSE; //< flag to check if source mesh file is specified for
100 // projection material tags
101 static inline PetscBool meshTransferHybridInterp =
102 PETSC_TRUE; //< flag to use hybrid interpolation for projection material
103 // tags
104 static inline std::vector<std::string>
105 listTagsToProject; // list of tags to project from source mesh to target
106 // mesh
108 DEMKOWICZ_JACOBI_BASE; //< approximation base for broken HDIV stress
109
110 template <FieldApproximationBase HdivBase> struct FieldOrders;
111
112 template <typename Op> MoFEMErrorCode withFieldOrders(Op &&op) const {
116 CHKERR op.template operator()<DEMKOWICZ_JACOBI_BASE>();
117 break;
119 CHKERR op.template operator()<AINSWORTH_LEGENDRE_BASE>();
120 break;
121 default:
123 "Broken HDIV base not implemented");
124 }
126 }
127
128 static inline double maxCrackExtension =
129 50; //< maximum crack extension in one physical step
130
131 static boost::function<double(const double)> f;
132 static boost::function<double(const double)> d_f;
133 static boost::function<double(const double)> dd_f;
134 static boost::function<double(const double)> inv_f;
135 static boost::function<double(const double)> inv_d_f;
136 static boost::function<double(const double)> inv_dd_f;
137
138 static inline constexpr double v_max = 24;
139
140 static double f_log_e_quadratic(const double v) {
141 if (v > v_max) {
142 double e = static_cast<double>(std::exp(v_max));
143 double dv = v - v_max;
144 return 0.5 * e * dv * dv + e * dv + e;
145 } else {
146 return static_cast<double>(std::exp(v));
147 }
148 }
149
150 static double d_f_log_e_quadratic(const double v) {
151 if (v > v_max) {
152 double e = static_cast<double>(std::exp(v_max));
153 double dv = v - v_max;
154 return e * dv + e;
155 } else {
156 return static_cast<double>(std::exp(v));
157 }
158 }
159
160 static double dd_f_log_e_quadratic(const double v) {
161 if (v > v_max) {
162 return static_cast<double>(std::exp(v_max));
163 } else {
164 return static_cast<double>(std::exp(v));
165 }
166 }
167
168 static double inv_f_log_e_quadratic(const double stretch) {
169 const double transition_stretch = std::exp(v_max);
170 if (stretch <= transition_stretch) {
171 return std::log(stretch);
172 }
173 return v_max - 1. +
174 std::sqrt(2. * stretch / transition_stretch - 1.);
175 }
176
177 static double inv_d_f_log_e_quadratic(const double stretch) {
178 const double transition_stretch = std::exp(v_max);
179 if (stretch <= transition_stretch) {
180 return 1. / stretch;
181 }
182 const double root =
183 std::sqrt(2. * stretch / transition_stretch - 1.);
184 return 1. / (transition_stretch * root);
185 }
186
187 static double inv_dd_f_log_e_quadratic(const double stretch) {
188 const double transition_stretch = std::exp(v_max);
189 if (stretch <= transition_stretch) {
190 return -1. / (stretch * stretch);
191 }
192 const double root =
193 std::sqrt(2. * stretch / transition_stretch - 1.);
194 return -1. /
195 (transition_stretch * transition_stretch * root * root * root);
196 }
197
198 static double f_log_e(const double v) {
199 return std::exp(v);
200 }
201 static double d_f_log_e(const double v) {
202 return std::exp(v);
203 }
204 static double dd_f_log_e(const double v) {
205 return std::exp(v);
206 }
207 static double inv_f_log_e(const double v) { return std::log(v); }
208 static double inv_d_f_log_e(const double v) { return 1. / v; }
209 static double inv_dd_f_log_e(const double v) { return -1. / (v * v); }
210
211 static double f_linear(const double v) { return v + 1; }
212 static double d_f_linear(const double) { return 1; }
213 static double dd_f_linear(const double) { return 0; }
214
215 static double inv_f_linear(const double v) { return v - 1; }
216 static double inv_d_f_linear(const double) { return 1; }
217 static double inv_dd_f_linear(const double) { return 0; }
218
219 /**
220 * \brief Getting interface of core database
221 * @param uuid unique ID of interface
222 * @param iface returned pointer to interface
223 * @return error code
224 */
225 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
226 UnknownInterface **iface) const;
227
229
230 boost::shared_ptr<DataAtIntegrationPts> dataAtPts;
231 boost::shared_ptr<PhysicalEquations> physicalEquations;
232 boost::shared_ptr<AnalyticalExprPython> AnalyticalExprPythonPtr;
233
234 boost::shared_ptr<VolumeElementForcesAndSourcesCore> elasticFeRhs;
235 boost::shared_ptr<VolumeElementForcesAndSourcesCore> elasticFeLhs;
236 boost::shared_ptr<FaceElementForcesAndSourcesCore> elasticBcLhs;
237 boost::shared_ptr<FaceElementForcesAndSourcesCore> elasticBcRhs;
238 boost::shared_ptr<ForcesAndSourcesCore>
239 contactTreeRhs; ///< Make a contact tree
240
241 SmartPetscObj<DM> dM; ///< Coupled problem all fields
242 SmartPetscObj<DM> dmElastic; ///< Elastic problem
243 SmartPetscObj<DM> dmMaterial; ///< Material problem
244 SmartPetscObj<DM> dmPrjSpatial; ///< Projection spatial displacement
245
246 const std::string piolaStress = "P";
247 // const std::string eshelbyStress = "S";
248 const std::string spatialL2Disp = "wL2";
249 // const std::string materialL2Disp = "WL2";
250 const std::string spatialH1Disp = "wH1";
251 const std::string materialH1Positions = "XH1";
252 const std::string hybridSpatialDisp = "hybridSpatialDisp";
253 // const std::string hybridMaterialDisp = "hybridMaterialDisp";
254 const std::string contactDisp = "contactDisp";
255 const std::string stretchTensor = "u";
256 const std::string rotAxis = "omega";
257 const std::string bubbleField = "bubble";
258
259 const std::string elementVolumeName = "EP";
260 const std::string naturalBcElement = "NATURAL_BC";
261 const std::string skinElement = "SKIN";
262 const std::string skeletonElement = "SKELETON";
263 const std::string contactElement = "CONTACT";
264
266 virtual ~EshelbianCore();
267
268 int spaceOrder = 2;
269 int spaceH1Order = -1;
271 double alphaU = 0;
272 double alphaW = 0;
273 double alphaOmega = 0;
274 double alphaOmega0 = 0;
275 double alphaR = 0;
276 double alphaR0 = 0;
279 double alphaViscousR = 0;
280 double alphaViscousR0 = 0;
281 double alphaRho = 0;
282 double alphaTau = 0;
283 double alphaTau0 = 0;
284 double alphaTauBcDisp = 0;
285 double alphaTauBcDisp0 = 0;
286
287 int contactRefinementLevels = 1; //< refinement levels for contact integration
288 int frontLayers = 3; //< front layers with material element
289 double loadFactor = 1.0; //< load factor
291
292 MoFEMErrorCode getOptions();
293
294 boost::shared_ptr<BcDispVec> bcSpatialDispVecPtr;
295 boost::shared_ptr<BcRotVec> bcSpatialRotationVecPtr;
296 boost::shared_ptr<TractionBcVec> bcSpatialTractionVecPtr;
297 boost::shared_ptr<TractionFreeBc> bcSpatialFreeTractionVecPtr;
298 boost::shared_ptr<NormalDisplacementBcVec> bcSpatialNormalDisplacementVecPtr;
299 boost::shared_ptr<SpringBcVec> bcSpatialSpringVecPtr;
300 boost::shared_ptr<AnalyticalDisplacementBcVec>
302 boost::shared_ptr<AnalyticalTractionBcVec> bcSpatialAnalyticalTractionVecPtr;
303 boost::shared_ptr<PressureBcVec> bcSpatialPressureVecPtr;
304 boost::shared_ptr<ExternalStrainVec> externalStrainVecPtr;
305 double oldCrackArea = 0.;
306 double oldStrainEnergy = 0.;
307 double oldLoadFactor = 1.0;
308 double strainEnergy = 0.;
309 boost::shared_ptr<double> currentCrackAreaPtr;
310
311 std::map<std::string, boost::shared_ptr<ScalingMethod>> timeScaleMap;
312
313 std::string getStringArgumentFromJsonBlockset(const std::string &type_name,
314 const int meshset_id,
315 const std::string &param_name) {
316 const auto string_params =
317 mField.getInterface<JsonConfigManager>()->getStringParamsFromBlockset(
318 type_name, meshset_id);
319 if (const auto it = string_params.find(param_name);
320 it != string_params.end()) {
321 return it->second;
322 }
323 return "";
324 }
325
327 const std::string &type_name, const std::string &param_name,
328 std::string &param_value) {
330 param_value.clear();
331 for (auto it : mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
332 std::regex((boost::format("%s(.*)") % type_name).str()))) {
333 const auto block_param = getStringArgumentFromJsonBlockset(
334 type_name, it->getMeshsetId(), param_name);
335 if (block_param.empty()) {
336 continue;
337 }
338 if (!param_value.empty() && param_value != block_param) {
339 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
340 "JSON %s blocksets specify different '%s' values",
341 type_name.c_str(), param_name.c_str());
342 }
343 param_value = block_param;
344 }
346 }
347
348 template <typename BC>
349 MoFEMErrorCode getBc(boost::shared_ptr<BC> &bc_vec_ptr,
350 const std::string block_name, const int nb_attributes) {
352 for (auto it :
353 mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
354
355 (boost::format("%s(.*)") % block_name).str()
356
357 ))
358
359 ) {
360 std::vector<double> block_attributes;
361 CHKERR it->getAttributes(block_attributes);
362 if (block_attributes.size() < static_cast<size_t>(nb_attributes)) {
363 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
364 "In block %s expected %d attributes, but given %ld",
365 it->getName().c_str(), nb_attributes, block_attributes.size());
366 }
367 Range faces;
368 CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 2, faces,
369 true);
370 bc_vec_ptr->emplace_back(
371 it->getName(), block_attributes, faces,
372 getStringArgumentFromJsonBlockset(block_name, it->getMeshsetId(),
373 "load_history"));
374 }
376 }
377
378 MoFEMErrorCode getSpatialDispBc();
379
380 inline MoFEMErrorCode getSpatialRotationBc() {
382 bcSpatialRotationVecPtr = boost::make_shared<BcRotVec>();
383 CHKERR getBc(bcSpatialRotationVecPtr, "SPATIAL_ROTATION_BC", 4);
384 CHKERR getBc(bcSpatialRotationVecPtr, "SPATIAL_ROTATION_AXIS_BC", 7);
385
386 for (auto &bc : *bcSpatialRotationVecPtr) {
387 MOFEM_LOG("EP", Sev::inform)
388 << "Found spatial rotation BC on block " << bc.blockName;
389 MOFEM_LOG("EP", Sev::inform) << " with attributes: " << bc.vals;
390 MOFEM_LOG("EP", Sev::inform) << " and rotation angle: " << bc.theta;
391 MOFEM_LOG("EP", Sev::inform) << " and nb of faces: " << bc.faces.size();
392 }
393
394 auto ts_rotation =
395 boost::make_shared<DynamicRelaxationTimeScale>("rotation_history.txt");
396 for (auto &bc : *bcSpatialRotationVecPtr) {
397 if (!bc.loadHistoryFile.empty()) {
398 MOFEM_LOG("EP", Sev::inform)
399 << "Rotation load history from JSON for " << bc.blockName << ": "
400 << bc.loadHistoryFile;
401 timeScaleMap[bc.blockName] =
402 boost::make_shared<DynamicRelaxationTimeScale>(
403 bc.loadHistoryFile);
404 } else {
405 timeScaleMap[bc.blockName] =
406 GetBlockScalingMethod<DynamicRelaxationTimeScale>::get(
407 ts_rotation, "rotation_history", ".txt", bc.blockName);
408 }
409 }
410
412 }
413
414 MoFEMErrorCode getSpatialTractionBc();
415
416 /**
417 * @brief Remove all, but entities where kinematic constrains are applied.
418 *
419 * @param meshset
420 * @param bc_ptr
421 * @param disp_block_set_name
422 * @param rot_block_set_name
423 * @param contact_set_name
424 * @return MoFEMErrorCode
425 */
426 MoFEMErrorCode getTractionFreeBc(const EntityHandle meshset,
427 boost::shared_ptr<TractionFreeBc> &bc_ptr,
428 const std::string contact_set_name);
429
430 inline MoFEMErrorCode
431 getSpatialTractionFreeBc(const EntityHandle meshset = 0) {
433 boost::shared_ptr<TractionFreeBc>(new TractionFreeBc());
434 return getTractionFreeBc(meshset, bcSpatialFreeTractionVecPtr, "CONTACT");
435 }
436
437 MoFEMErrorCode getExternalStrain();
438
439 MoFEMErrorCode createExchangeVectors(Sev sev);
440
441 MoFEMErrorCode addFields(const EntityHandle meshset = 0,
442 const bool add_bubble = true);
443 MoFEMErrorCode projectGeometry(const EntityHandle meshset = 0,
444 double time = 0);
445 MoFEMErrorCode projectMaterialTags(const EntityHandle meshset = 0);
446
447 MoFEMErrorCode addVolumeFiniteElement(const EntityHandle meshset = 0,
448 const bool add_bubble = true);
449 MoFEMErrorCode addBoundaryFiniteElement(const EntityHandle meshset = 0);
450 MoFEMErrorCode addDMs(const BitRefLevel bit = BitRefLevel().set(0),
451 const EntityHandle meshset = 0);
452
453 MoFEMErrorCode addMaterial_HMHNeohookean(const double c10, const double K);
454
455 MoFEMErrorCode addMaterial_HMHStorakers(const double eta, const double mu,
456 const double beta);
457
458 MoFEMErrorCode addMaterial_Hencky(double E, double nu);
459
460 MoFEMErrorCode addMaterial_Core(
461 boost::weak_ptr<MatOps::PhysicalEquations> mat_physical_equations_ptr);
462
463 MoFEMErrorCode setBaseVolumeElementOps(
464 const int tag, const bool do_rhs, const bool do_lhs,
465 const bool calc_rates,
466 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe,
467 const bool add_bubble = true);
468
469 MoFEMErrorCode setVolumeElementOps(
470 const int tag, const bool add_elastic, const bool add_material,
471 boost::shared_ptr<VolumeElementForcesAndSourcesCore> &fe_rhs,
472 boost::shared_ptr<VolumeElementForcesAndSourcesCore> &fe_lhs);
473
474 MoFEMErrorCode pushNoStretchVolumeA00Ops(
475 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
476
477 MoFEMErrorCode
479 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
480
481 MoFEMErrorCode pushStressGramOps(
482 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
483
484 MoFEMErrorCode pushPiolaStressGramOps(
485 boost::shared_ptr<VolumeElementForcesAndSourcesCore> fe_lhs);
486
487 MoFEMErrorCode
488 setFaceElementOps(const bool add_elastic, const bool add_material,
489 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_rhs,
490 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_lhs);
491
492 MoFEMErrorCode setFaceInterfaceOps(
493 const bool add_elastic, const bool add_material,
494 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_rhs,
495 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_lhs);
496
497 MoFEMErrorCode setContactElementRhsOps(
498
499 boost::shared_ptr<ForcesAndSourcesCore> &fe_contact_tree
500
501 );
502
503 MoFEMErrorCode setElasticElementOps(const int tag);
504 MoFEMErrorCode setElasticElementToTs(DM dm);
505
506 /** \brief Add debug to model
507 *
508 * That prints information every SNES step
509 */
510 MoFEMErrorCode addDebugModel(TS ts);
511
512 friend struct solve_elastic_set_up;
513 MoFEMErrorCode solveElastic(TS ts, Vec x);
514
515 /**
516 * @brief Solve problem using dynamic relaxation method
517 *
518 * @param ts solver time stepper
519 * @param x solution vector
520 * @param start_step starting step number
521 * @param start_time starting time
522 * @return MoFEMErrorCode
523 */
524 MoFEMErrorCode solveDynamicRelaxation(TS ts, Vec x, int start_step,
525 double start_time);
526
527 /**
528 * @brief Solve cohesive crack growth problem
529 *
530 * @param ts
531 * @param x
532 * @return * MoFEMErrorCode
533 */
534 MoFEMErrorCode solveCohesiveCrackGrowth(TS ts, Vec x, int start_step,
535 double start_time);
536
537 /**
538 * @brief Solve load factor crack growth problem
539 *
540 * @param ts
541 * @param x
542 * @return * MoFEMErrorCode
543 */
544 MoFEMErrorCode solveLoadFactor(TS ts, Vec x, int start_step,
545 double start_time);
546
547 /**
548 * @brief Solve shape optimisation problem
549 *
550 * @param ts
551 * @param x
552 * @return * MoFEMErrorCode
553 */
554 MoFEMErrorCode solveSchapeOptimisation(TS ts, Vec x, int start_step,
555 double start_time);
556
557 MoFEMErrorCode solveTestTopologicalDerivative(TS ts, Vec x, int start_step,
558 double start_time);
559
560 MoFEMErrorCode setBlockTagsOnSkin();
561
562 MoFEMErrorCode postProcessRestartMesh(const int tag, const std::string file,
563 std::vector<Tag> tags_to_transfer = {});
564
565 MoFEMErrorCode postProcessResults(const int tag, const std::string file,
566 Vec f_residual = PETSC_NULLPTR,
567 Vec var_vec = PETSC_NULLPTR,
568 Vec gradient = PETSC_NULLPTR,
569 std::vector<Tag> tags_to_transfer = {},
570 TS ts = PETSC_NULLPTR);
572 postProcessSkeletonResults(const int tag, const std::string file,
573 Vec f_residual = PETSC_NULLPTR,
574 std::vector<Tag> tags_to_transfer = {},
575 TS ts = PETSC_NULLPTR);
576
578 boost::shared_ptr<double>& area_ptr); // calculate crack area
579
581
582 struct SetUpSchur {
583 static boost::shared_ptr<SetUpSchur> createSetUpSchur(
584
585 MoFEM::Interface &m_field, EshelbianCore *ep_core_ptr
586
587 );
588 virtual MoFEMErrorCode setUp(TS) = 0;
589
590 protected:
591 SetUpSchur() = default;
592 };
593
595
596 using TimeScale::TimeScale;
597
598 double getScale(const double time) override {
600 return TimeScale::getScale(EshelbianCore::currentPhysicalTime);
601 else
602 return TimeScale::getScale(time);
603 }
604 };
605
606 MoFEMErrorCode calculateFaceMaterialForce(
607 const int tag, TS ts,
608 SmartPetscObj<Vec> *adjoint_gradient_vector = nullptr);
609 MoFEMErrorCode calculateOrientation(const int tag, bool set_orientation);
610 MoFEMErrorCode setNewFrontCoordinates();
611 MoFEMErrorCode addCrackSurfaces(const bool debug = false);
612 MoFEMErrorCode saveOrgCoords();
613 MoFEMErrorCode createCrackSurfaceMeshset();
614
615 boost::shared_ptr<Range> contactFaces;
616 boost::shared_ptr<Range> crackFaces;
617 boost::shared_ptr<Range> frontEdges;
618 boost::shared_ptr<Range> frontAdjEdges;
619 boost::shared_ptr<Range> frontVertices;
620 boost::shared_ptr<Range> skeletonFaces;
621 boost::shared_ptr<Range> maxMovedFaces;
622 boost::shared_ptr<Range> interfaceFaces;
623
624 boost::shared_ptr<ParentFiniteElementAdjacencyFunctionSkeleton<2>>
626
627 BitRefLevel bitAdjParent = BitRefLevel().set(); ///< bit ref level for parent
628 BitRefLevel bitAdjParentMask =
629 BitRefLevel().set(); ///< bit ref level for parent parent
630 BitRefLevel bitAdjEnt = BitRefLevel().set(); ///< bit ref level for parent
631 BitRefLevel bitAdjEntMask =
632 BitRefLevel().set(); ///< bit ref level for parent parent
633
634 SmartPetscObj<Vec> solTSStep;
635 PetscBool loadFactorTSSolveExecuted = PETSC_FALSE;
636
637 CommInterface::EntitiesPetscVector volumeExchange;
638 CommInterface::EntitiesPetscVector faceExchange;
639 CommInterface::EntitiesPetscVector edgeExchange;
640 CommInterface::EntitiesPetscVector vertexExchange;
641
642 std::vector<Tag>
643 listTagsToTransfer; ///< list of tags to transfer to postprocessor
644
645 Mat S = PETSC_NULLPTR; //< Schur complement matrix
646 AO aoS = PETSC_NULLPTR; //< AO for Schur complement matrix
647 SmartPetscObj<IS> crackHybridIs; //< IS for crack hybrid field
648 std::vector<std::string> a00FieldList; //< list of fields for Schur complement
649 std::vector<boost::shared_ptr<Range>>
650 a00RangeList; //< list of ranges for Schur complement
651
652 int nbCrackFaces = 0; //< number of crack faces
653};
654
656 static inline int stress(const int o) { return o; }
657 static inline int bubble(const int o) { return o; }
658 static inline int disp(const int o) { return o - 1; }
659 static inline int rot(const int o) { return o - 1; }
660 static inline int stretch(const int o) { return o; }
661 static inline int hybrid(const int o) { return o - 1; }
662};
663
665 static inline int stress(const int o) { return o; }
666 static inline int bubble(const int o) { return o + 1; }
667 static inline int disp(const int o) { return o - 1; }
668 static inline int rot(const int o) { return o; }
669 static inline int stretch(const int o) { return o + 1; }
670 static inline int hybrid(const int o) { return o; }
671};
FieldApproximationBase
approximation base
Definition definitions.h:58
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition definitions.h:60
@ DEMKOWICZ_JACOBI_BASE
Definition definitions.h:66
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
static const bool debug
double eta
#define MOFEM_LOG(channel, severity)
Log.
auto bit
set bit
const double v
phase velocity of light in medium (cm/ns)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
double getScale(const double time) override
virtual MoFEMErrorCode setUp(TS)=0
static boost::shared_ptr< SetUpSchur > createSetUpSchur(MoFEM::Interface &m_field, EshelbianCore *ep_core_ptr)
std::vector< boost::shared_ptr< Range > > a00RangeList
MoFEMErrorCode setElasticElementOps(const int tag)
boost::shared_ptr< ExternalStrainVec > externalStrainVecPtr
static PetscBool physicalH1Update
static enum StretchSelector stretchSelector
boost::shared_ptr< Range > frontAdjEdges
MoFEMErrorCode createCrackSurfaceMeshset()
static int interfaceRemoveLevel
MoFEMErrorCode addBoundaryFiniteElement(const EntityHandle meshset=0)
const std::string skeletonElement
static double inv_dd_f_linear(const double)
static double inv_f_linear(const double v)
MoFEMErrorCode getSpatialRotationBc()
boost::shared_ptr< TractionBcVec > bcSpatialTractionVecPtr
boost::shared_ptr< Range > contactFaces
static double dd_f_log_e_quadratic(const double v)
static double inv_d_f_linear(const double)
static double dd_f_linear(const double)
BitRefLevel bitAdjEnt
bit ref level for parent
static boost::function< double(const double)> inv_dd_f
MoFEM::Interface & mField
static constexpr double v_max
const std::string spatialL2Disp
std::map< std::string, boost::shared_ptr< ScalingMethod > > timeScaleMap
MoFEMErrorCode addMaterial_Hencky(double E, double nu)
static enum SolverType solverType
friend struct solve_elastic_set_up
MoFEMErrorCode postProcessSkeletonResults(const int tag, const std::string file, Vec f_residual=PETSC_NULLPTR, std::vector< Tag > tags_to_transfer={}, TS ts=PETSC_NULLPTR)
static PetscBool l2UserBaseScale
SmartPetscObj< DM > dM
Coupled problem all fields.
boost::shared_ptr< FaceElementForcesAndSourcesCore > elasticBcRhs
MoFEMErrorCode solveSchapeOptimisation(TS ts, Vec x, int start_step, double start_time)
Solve shape optimisation problem.
SmartPetscObj< IS > crackHybridIs
static enum StretchHandling stretchHandling
boost::shared_ptr< TractionFreeBc > bcSpatialFreeTractionVecPtr
static const char * listSolvers[]
const std::string materialH1Positions
static int nbJIntegralContours
MoFEMErrorCode addMaterial_HMHStorakers(const double eta, const double mu, const double beta)
MoFEMErrorCode setBlockTagsOnSkin()
std::vector< Tag > listTagsToTransfer
list of tags to transfer to postprocessor
boost::shared_ptr< FaceElementForcesAndSourcesCore > elasticBcLhs
static PetscBool crackingOn
MoFEMErrorCode getTractionFreeBc(const EntityHandle meshset, boost::shared_ptr< TractionFreeBc > &bc_ptr, const std::string contact_set_name)
Remove all, but entities where kinematic constrains are applied.
static double griffithEnergy
Griffith energy.
boost::shared_ptr< VolumeElementForcesAndSourcesCore > elasticFeRhs
MoFEMErrorCode addMaterial_HMHNeohookean(const double c10, const double K)
MoFEMErrorCode postProcessRestartMesh(const int tag, const std::string file, std::vector< Tag > tags_to_transfer={})
const std::string elementVolumeName
static double dd_f_log_e(const double v)
static double d_f_linear(const double)
static enum RotSelector rotSelector
MoFEMErrorCode addDebugModel(TS ts)
Add debug to model.
static enum RotSelector gradApproximator
PetscBool loadFactorTSSolveExecuted
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)
MoFEMErrorCode getBc(boost::shared_ptr< BC > &bc_vec_ptr, const std::string block_name, const int nb_attributes)
static double inv_dd_f_log_e_quadratic(const double stretch)
static double physicalDt
CommInterface::EntitiesPetscVector vertexExchange
static std::vector< std::string > listTagsToProject
boost::shared_ptr< BcRotVec > bcSpatialRotationVecPtr
boost::shared_ptr< Range > maxMovedFaces
static std::string heterogeneousYoungModTagName
const std::string spatialH1Disp
static FieldApproximationBase brokenHdivBase
static double maxCrackExtension
static int physicalMaxSteps
MoFEMErrorCode solveElastic(TS ts, Vec x)
boost::shared_ptr< NormalDisplacementBcVec > bcSpatialNormalDisplacementVecPtr
static double crackingStartTime
static enum MaterialModel materialModel
MoFEMErrorCode getOptions()
MoFEMErrorCode calculateCrackArea(boost::shared_ptr< double > &area_ptr)
const std::string piolaStress
MoFEMErrorCode setElasticElementToTs(DM dm)
static double inv_d_f_log_e(const double v)
MoFEMErrorCode setFaceInterfaceOps(const bool add_elastic, const bool add_material, boost::shared_ptr< FaceElementForcesAndSourcesCore > &fe_rhs, boost::shared_ptr< FaceElementForcesAndSourcesCore > &fe_lhs)
std::string getStringArgumentFromJsonBlockset(const std::string &type_name, const int meshset_id, const std::string &param_name)
static int physicalStepNumber
MoFEMErrorCode gettingNorms()
[Getting norms]
boost::shared_ptr< Range > interfaceFaces
std::vector< std::string > a00FieldList
MoFEMErrorCode setVolumeElementOps(const int tag, const bool add_elastic, const bool add_material, boost::shared_ptr< VolumeElementForcesAndSourcesCore > &fe_rhs, boost::shared_ptr< VolumeElementForcesAndSourcesCore > &fe_lhs)
static PetscBool physicalTimeFlg
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Getting interface of core database.
const std::string bubbleField
boost::shared_ptr< AnalyticalDisplacementBcVec > bcSpatialAnalyticalDisplacementVecPtr
SmartPetscObj< DM > dmMaterial
Material problem.
MoFEMErrorCode calculateOrientation(const int tag, bool set_orientation)
boost::shared_ptr< VolumeElementForcesAndSourcesCore > elasticFeLhs
MoFEMErrorCode setNewFrontCoordinates()
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 2 > > parentAdjSkeletonFunctionDim2
static double crackingAddTime
double alphaViscousOmega0
MoFEMErrorCode setFaceElementOps(const bool add_elastic, const bool add_material, boost::shared_ptr< FaceElementForcesAndSourcesCore > &fe_rhs, boost::shared_ptr< FaceElementForcesAndSourcesCore > &fe_lhs)
MoFEMErrorCode projectGeometry(const EntityHandle meshset=0, double time=0)
static double currentPhysicalTime
boost::shared_ptr< AnalyticalExprPython > AnalyticalExprPythonPtr
boost::shared_ptr< SpringBcVec > bcSpatialSpringVecPtr
static constexpr enum SymmetrySelector symmetrySelector
static double crackingAtol
Cracking absolute tolerance.
MoFEMErrorCode projectMaterialTags(const EntityHandle meshset=0)
boost::shared_ptr< Range > skeletonFaces
static double crackingRtol
Cracking relative tolerance.
boost::shared_ptr< PhysicalEquations > physicalEquations
const std::string rotAxis
static PetscBool meshTransferHybridInterp
BitRefLevel bitAdjParentMask
bit ref level for parent parent
MoFEMErrorCode solveDynamicRelaxation(TS ts, Vec x, int start_step, double start_time)
Solve problem using dynamic relaxation method.
const std::string contactDisp
static std::string internalStressTagName
CommInterface::EntitiesPetscVector edgeExchange
SmartPetscObj< DM > dmPrjSpatial
Projection spatial displacement.
static boost::function< double(const double)> f
MoFEMErrorCode solveTestTopologicalDerivative(TS ts, Vec x, int start_step, double start_time)
boost::shared_ptr< BcDispVec > bcSpatialDispVecPtr
static double finalPhysicalTime
boost::shared_ptr< ForcesAndSourcesCore > contactTreeRhs
Make a contact tree.
const std::string skinElement
static PetscBool internalStressVoigt
MoFEMErrorCode addVolumeFiniteElement(const EntityHandle meshset=0, const bool add_bubble=true)
MoFEMErrorCode addMaterial_Core(boost::weak_ptr< MatOps::PhysicalEquations > mat_physical_equations_ptr)
MoFEMErrorCode getSpatialTractionFreeBc(const EntityHandle meshset=0)
static double inv_dd_f_log_e(const double v)
MoFEMErrorCode getExternalStrain()
MoFEMErrorCode getSpatialTractionBc()
MoFEMErrorCode pushNoStretchVolumeA00Ops(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
static PetscBool setSingularity
virtual ~EshelbianCore()
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)
static double d_f_log_e(const double v)
boost::shared_ptr< AnalyticalTractionBcVec > bcSpatialAnalyticalTractionVecPtr
boost::shared_ptr< double > currentCrackAreaPtr
static PetscBool meshTransferSourceMeshFileSpecified
static double f_log_e_quadratic(const double v)
double avgGriffithsEnergy
MoFEMErrorCode addCrackSurfaces(const bool debug=false)
static double inv_f_log_e_quadratic(const double stretch)
static bool hasNonHomogeneousMaterialBlock
MoFEMErrorCode addDMs(const BitRefLevel bit=BitRefLevel().set(0), const EntityHandle meshset=0)
MoFEMErrorCode solveCohesiveCrackGrowth(TS ts, Vec x, int start_step, double start_time)
Solve cohesive crack growth problem.
MoFEMErrorCode getSpatialDispBc()
[Getting norms]
BitRefLevel bitAdjParent
bit ref level for parent
MoFEMErrorCode setContactElementRhsOps(boost::shared_ptr< ForcesAndSourcesCore > &fe_contact_tree)
static PetscBool interfaceCrack
MoFEMErrorCode solveLoadFactor(TS ts, Vec x, int start_step, double start_time)
Solve load factor crack growth problem.
MoFEMErrorCode getStringArgumentFromJsonBlocksets(const std::string &type_name, const std::string &param_name, std::string &param_value)
static double d_f_log_e_quadratic(const double v)
CommInterface::EntitiesPetscVector volumeExchange
MoFEMErrorCode saveOrgCoords()
const std::string naturalBcElement
MoFEMErrorCode calculateFaceMaterialForce(const int tag, TS ts, SmartPetscObj< Vec > *adjoint_gradient_vector=nullptr)
static boost::function< double(const double)> dd_f
static double f_log_e(const double v)
static int addCrackMeshsetId
static double inv_f_log_e(const double v)
MoFEMErrorCode createExchangeVectors(Sev sev)
MoFEMErrorCode pushStretchVolumeA00Ops(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
boost::shared_ptr< Range > crackFaces
static boost::function< double(const double)> d_f
static bool isNoStretch()
boost::shared_ptr< Range > frontVertices
static enum EnergyReleaseSelector energyReleaseSelector
static boost::function< double(const double)> inv_d_f
boost::shared_ptr< PressureBcVec > bcSpatialPressureVecPtr
static int meshTransferInterpOrder
const std::string hybridSpatialDisp
SmartPetscObj< Vec > solTSStep
static double inv_d_f_log_e_quadratic(const double stretch)
CommInterface::EntitiesPetscVector faceExchange
SmartPetscObj< DM > dmElastic
Elastic problem.
static std::string meshTransferSourceMeshFileName
boost::shared_ptr< Range > frontEdges
static boost::function< double(const double)> inv_f
const std::string stretchTensor
BitRefLevel bitAdjEntMask
bit ref level for parent parent
static double f_linear(const double v)
MoFEMErrorCode addFields(const EntityHandle meshset=0, const bool add_bubble=true)
MoFEMErrorCode withFieldOrders(Op &&op) const
MoFEMErrorCode pushStressGramOps(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
const std::string contactElement
MoFEMErrorCode pushPiolaStressGramOps(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
Deprecated interface functions.
base class for all interface classes
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.