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