v0.15.0
Loading...
Searching...
No Matches
HMHHencky.cpp
Go to the documentation of this file.
1/**
2 * @file Hencky.cpp
3 * @brief Implementation of Hencky material
4 * @date 2024-08-31
5 *
6 * @copyright Copyright (c) 2024
7 *
8 */
9
10
11namespace EshelbianPlasticity {
12
14
15 HMHHencky(MoFEM::Interface &m_field, const double E, const double nu)
16 : PhysicalEquations(0, 0), mField(m_field), E(E), nu(nu) {}
17
18 MoFEMErrorCode recordTape(const int tag, DTensor2Ptr *t_h) { return 0; }
19
20 struct OpHenckyJacobian : public OpJacobian {
21 OpHenckyJacobian(boost::shared_ptr<DataAtIntegrationPts> data_ptr,
22 boost::shared_ptr<HMHHencky> hencky_ptr)
23 : OpJacobian(), dataAtGaussPts(data_ptr), henckyPtr(hencky_ptr) {
25 "getOptions failed");
26 CHK_THROW_MESSAGE(henckyPtr->extractBlockData(Sev::verbose),
27 "Can not get data from block");
28 }
29
30 MoFEMErrorCode doWork(int side, EntityType type,
31 EntitiesFieldData::EntData &data) {
33
34 for (auto &b : henckyPtr->blockData) {
35 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
36 dataAtGaussPts->mu = b.shearModulusG;
37 dataAtGaussPts->lambda = b.bulkModulusK - 2 * b.shearModulusG / 3;
38 CHKERR henckyPtr->getMatDPtr(dataAtGaussPts->getMatDPtr(),
39 dataAtGaussPts->getMatAxiatorDPtr(),
40 dataAtGaussPts->getMatDeviatorDPtr(),
41 b.bulkModulusK, b.shearModulusG);
43 }
44 }
45 const auto E = henckyPtr->E;
46 const auto nu = henckyPtr->nu;
47
48 double bulk_modulus_K = E / (3 * (1 - 2 * nu));
49 double shear_modulus_G = E / (2 * (1 + nu));
50
53
54 CHKERR henckyPtr->getMatDPtr(dataAtGaussPts->getMatDPtr(),
55 dataAtGaussPts->getMatAxiatorDPtr(),
56 dataAtGaussPts->getMatDeviatorDPtr(),
58
60 }
61
62 MoFEMErrorCode evaluateRhs(EntData &data) { return 0; }
63 MoFEMErrorCode evaluateLhs(EntData &data) { return 0; }
64
65 private:
66 boost::shared_ptr<DataAtIntegrationPts> dataAtGaussPts;
67 boost::shared_ptr<HMHHencky> henckyPtr;
68 };
69
70 virtual UserDataOperator *
71 returnOpJacobian(const int tag, const bool eval_rhs, const bool eval_lhs,
72 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
73 boost::shared_ptr<PhysicalEquations> physics_ptr) {
74 return (new OpHenckyJacobian(
75 data_ptr, boost::dynamic_pointer_cast<HMHHencky>(physics_ptr)));
76 }
77
79
80 OpSpatialPhysical(const std::string &field_name,
81 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
82 const double alpha_u);
83
84 MoFEMErrorCode integrate(EntData &data);
85
86 MoFEMErrorCode integrateHencky(EntData &data);
87
88 MoFEMErrorCode integratePolyconvexHencky(EntData &data);
89
90 private:
91 const double alphaU;
92 PetscBool polyConvex = PETSC_FALSE;
93 };
94
95 virtual VolUserDataOperator *
97 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
98 const double alpha_u) {
99 return new OpSpatialPhysical(field_name, data_ptr, alpha_u);
100 }
101
104 const std::string &field_name,
105 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
106 boost::shared_ptr<ExternalStrainVec> &external_strain_vec_ptr,
107 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv);
108
109 MoFEMErrorCode integrate(EntData &data);
110
111 private:
112 boost::shared_ptr<ExternalStrainVec> externalStrainVecPtr;
113 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
114 };
115
117 const std::string &field_name,
118 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
119 boost::shared_ptr<ExternalStrainVec> external_strain_vec_ptr,
120 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
121 {
123 field_name, data_ptr, external_strain_vec_ptr, smv);
124 }
125
127 const double alphaU;
128 OpSpatialPhysical_du_du(std::string row_field, std::string col_field,
129 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
130 const double alpha);
131 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
132 MoFEMErrorCode integrateHencky(EntData &row_data, EntData &col_data);
133 MoFEMErrorCode integratePolyconvexHencky(EntData &row_data,
134 EntData &col_data);
135
136 private:
137 PetscBool polyConvex = PETSC_FALSE;
138
139 MatrixDouble dP;
140 };
141
143 std::string row_field, std::string col_field,
144 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const double alpha) {
145 return new OpSpatialPhysical_du_du(row_field, col_field, data_ptr, alpha);
146 }
147
148 /**
149 * @brief Calculate energy density for Hencky material model
150 *
151 *
152 * \f[
153 *
154 * \Psi(\log{\mathbf{U}}) = \frac{1}{2} U_{IJ} D_{IJKL} U_{KL} = \frac{1}{2}
155 * U_{IJ} T_{IJ}
156 *
157 * \f]
158 * where \f$T_{IJ} = D_{IJKL} U_{KL}\f$ is a a Hencky stress.
159 *
160 */
162
163 OpCalculateEnergy(boost::shared_ptr<DataAtIntegrationPts> data_ptr,
164 boost::shared_ptr<double> total_energy_ptr);
165 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
166
167 private:
168 boost::shared_ptr<DataAtIntegrationPts> dataAtPts;
169 boost::shared_ptr<double> totalEnergyPtr;
170 };
171
173 returnOpCalculateEnergy(boost::shared_ptr<DataAtIntegrationPts> data_ptr,
174 boost::shared_ptr<double> total_energy_ptr) {
175 return new OpCalculateEnergy(data_ptr, total_energy_ptr);
176 }
177
180 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
181 boost::shared_ptr<MatrixDouble> strain_ptr,
182 boost::shared_ptr<MatrixDouble> stress_ptr,
183 boost::shared_ptr<HMHHencky> hencky_ptr);
184 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
185
186 private:
187 boost::shared_ptr<DataAtIntegrationPts>
188 dataAtPts; ///< data at integration pts
189 boost::shared_ptr<MatrixDouble> strainPtr;
190 boost::shared_ptr<MatrixDouble> stressPtr;
191 boost::shared_ptr<HMHHencky> henckyPtr;
192 };
193
195 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
196 boost::shared_ptr<PhysicalEquations> physics_ptr) {
198 data_ptr, data_ptr->getLogStretchTensorAtPts(),
199 data_ptr->getApproxPAtPts(),
200 boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
201 }
202
204 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
205 boost::shared_ptr<PhysicalEquations> physics_ptr) {
207 data_ptr, data_ptr->getVarLogStreachPts(), data_ptr->getVarPiolaPts(),
208 boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
209 }
210
211 MoFEMErrorCode getOptions(boost::shared_ptr<DataAtIntegrationPts> data_ptr) {
213 PetscOptionsBegin(PETSC_COMM_WORLD, "hencky_", "", "none");
214
215 CHKERR PetscOptionsScalar("-young_modulus", "Young modulus", "", E, &E,
216 PETSC_NULLPTR);
217 CHKERR PetscOptionsScalar("-poisson_ratio", "poisson ratio", "", nu, &nu,
218 PETSC_NULLPTR);
219
220 PetscOptionsEnd();
221
223 << "Hencky: E = " << E << " nu = " << nu;
224 getOptionsSeverityLevels = Sev::verbose;
225
226 CHKERRG(ierr);
227
229 }
230
231 MoFEMErrorCode extractBlockData(Sev sev) {
232 return extractBlockData(
233
234 mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
235
236 (boost::format("%s(.*)") % "MAT_ELASTIC").str()
237
238 )),
239
240 sev);
241 }
242
243 MoFEMErrorCode
244 extractBlockData(std::vector<const CubitMeshSets *> meshset_vec_ptr,
245 Sev sev) {
247
248 for (auto m : meshset_vec_ptr) {
249 MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock") << *m;
250 std::vector<double> block_data;
251 CHKERR m->getAttributes(block_data);
252 if (block_data.size() < 2) {
253 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
254 "Expected that block has atleast two attributes");
255 }
256 auto get_block_ents = [&]() {
257 Range ents;
258 CHKERR mField.get_moab().get_entities_by_handle(m->meshset, ents, true);
259 return ents;
260 };
261
262 double young_modulus = block_data[0];
263 double poisson_ratio = block_data[1];
264 double bulk_modulus_K = young_modulus / (3 * (1 - 2 * poisson_ratio));
265 double shear_modulus_G = young_modulus / (2 * (1 + poisson_ratio));
266
267 MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock")
268 << "E = " << young_modulus << " nu = " << poisson_ratio;
269
270 blockData.push_back({bulk_modulus_K, shear_modulus_G, get_block_ents()});
271 }
272 MOFEM_LOG_CHANNEL("WORLD");
274 }
275
276 MoFEMErrorCode getMatDPtr(boost::shared_ptr<MatrixDouble> mat_D_ptr,
277 boost::shared_ptr<MatrixDouble> mat_axiator_D_ptr,
278 boost::shared_ptr<MatrixDouble> mat_deviator_D_ptr,
279 double bulk_modulus_K, double shear_modulus_G) {
281 //! [Calculate elasticity tensor]
282 auto set_material_stiffness = [&]() {
288 auto t_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
289 &*(mat_D_ptr->data().begin()));
290 auto t_axiator_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
291 &*mat_axiator_D_ptr->data().begin());
292 auto t_deviator_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
293 &*mat_deviator_D_ptr->data().begin());
294 t_axiator_D(i, j, k, l) = (bulk_modulus_K - (2. / 3.) * shear_modulus_G) *
295 t_kd(i, j) * t_kd(k, l);
296 t_deviator_D(i, j, k, l) =
297 2 * shear_modulus_G * ((t_kd(i, k) ^ t_kd(j, l)) / 4.);
298 t_D(i, j, k, l) = t_axiator_D(i, j, k, l) + t_deviator_D(i, j, k, l);
299 };
300 //! [Calculate elasticity tensor]
301 constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
302 mat_D_ptr->resize(size_symm, size_symm, false);
303 mat_axiator_D_ptr->resize(size_symm, size_symm, false);
304 mat_deviator_D_ptr->resize(size_symm, size_symm, false);
305 set_material_stiffness();
307 }
308
309 MoFEMErrorCode
310 getInvMatDPtr(boost::shared_ptr<MatrixDouble> mat_inv_D_ptr,
311 double bulk_modulus_K, double shear_modulus_G) {
313 //! [Calculate elasticity tensor]
314 auto set_material_compilance = [&]() {
320 const double A = 1. / (2. * shear_modulus_G);
321 const double B =
322 (1. / (9. * bulk_modulus_K)) - (1. / (6. * shear_modulus_G));
323 auto t_inv_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
324 &*(mat_inv_D_ptr->data().begin()));
325 t_inv_D(i, j, k, l) =
326 A * ((t_kd(i, k) ^ t_kd(j, l)) / 4.) + B * t_kd(i, j) * t_kd(k, l);
327 };
328 //! [Calculate elasticity tensor]
329 constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
330 mat_inv_D_ptr->resize(size_symm, size_symm, false);
331 set_material_compilance();
333 }
334
335private:
337
343 std::vector<BlockData> blockData;
344
345 double E;
346 double nu;
347
348 // Set verbosity level, it verbile can changes that informatno is pronated
349 // only once at particular level
350 Sev getOptionsSeverityLevels = Sev::inform;
351};
352
354 const std::string &field_name,
355 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const double alpha_u)
356 : OpAssembleVolume(field_name, data_ptr, OPROW), alphaU(alpha_u) {
357
358 CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULLPTR, "", "-poly_convex",
359 &polyConvex, PETSC_NULLPTR),
360 "get polyconvex option failed");
361}
362
365 if (polyConvex) {
366 CHKERR integratePolyconvexHencky(data);
367 } else {
368 CHKERR integrateHencky(data);
369 }
371}
372
375
377 auto t_L = symm_L_tensor();
378
379 int nb_dofs = data.getIndices().size();
380 int nb_integration_pts = data.getN().size1();
381 auto v = getVolume();
382 auto t_w = getFTensor0IntegrationWeight();
383 auto t_approx_P_adjoint_log_du =
384 getFTensor1FromMat<size_symm>(dataAtPts->adjointPdUAtPts);
385 auto t_log_stretch_h1 =
386 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
387 auto t_dot_log_u =
388 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
389
390 auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
391
392 FTensor::Index<'i', 3> i;
393 FTensor::Index<'j', 3> j;
394 FTensor::Index<'k', 3> k;
395 FTensor::Index<'l', 3> l;
396 auto get_ftensor2 = [](auto &v) {
398 &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
399 };
400
401 int nb_base_functions = data.getN().size2();
402 auto t_row_base_fun = data.getFTensor0N();
403 for (int gg = 0; gg != nb_integration_pts; ++gg) {
404 double a = v * t_w;
405 auto t_nf = get_ftensor2(nF);
406
408 t_T(i, j) =
409 t_D(i, j, k, l) * (t_log_stretch_h1(k, l) + alphaU * t_dot_log_u(k, l));
411 t_residual(L) =
412 a * (t_approx_P_adjoint_log_du(L) - t_L(i, j, L) * t_T(i, j));
413
414 int bb = 0;
415 for (; bb != nb_dofs / 6; ++bb) {
416 t_nf(L) -= t_row_base_fun * t_residual(L);
417 ++t_nf;
418 ++t_row_base_fun;
419 }
420 for (; bb != nb_base_functions; ++bb)
421 ++t_row_base_fun;
422
423 ++t_w;
424 ++t_approx_P_adjoint_log_du;
425 ++t_dot_log_u;
426 ++t_log_stretch_h1;
427 }
429}
430
431MoFEMErrorCode
434
436 auto t_L = symm_L_tensor();
437
438 int nb_dofs = data.getIndices().size();
439 int nb_integration_pts = data.getN().size1();
440 auto v = getVolume();
441 auto t_w = getFTensor0IntegrationWeight();
442 auto t_approx_P_adjoint_log_du =
443 getFTensor1FromMat<size_symm>(dataAtPts->adjointPdUAtPts);
444 auto t_log_stretch_h1 =
445 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
446 auto t_dot_log_u =
447 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
448
449 auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
450
451 FTensor::Index<'i', 3> i;
452 FTensor::Index<'j', 3> j;
453 FTensor::Index<'k', 3> k;
454 FTensor::Index<'l', 3> l;
455 auto get_ftensor2 = [](auto &v) {
457 &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
458 };
459
460 constexpr double nohat_k = 1. / 4;
461 constexpr double hat_k = 1. / 8;
462 double mu = dataAtPts->mu;
463 double lambda = dataAtPts->lambda;
464
465 constexpr double third = boost::math::constants::third<double>();
467 auto t_diff_deviator = diff_deviator(diff_tensor());
468
469 int nb_base_functions = data.getN().size2();
470 auto t_row_base_fun = data.getFTensor0N();
471 for (int gg = 0; gg != nb_integration_pts; ++gg) {
472 double a = v * t_w;
473 auto t_nf = get_ftensor2(nF);
474
475 double log_det = t_log_stretch_h1(i, i);
476 double log_det2 = log_det * log_det;
478 t_dev(i, j) = t_log_stretch_h1(i, j) - t_kd(i, j) * (third * log_det);
479 double dev_norm2 = t_dev(i, j) * t_dev(i, j);
480
482 auto A = 2 * mu * std::exp(nohat_k * dev_norm2);
483 auto B = lambda * std::exp(hat_k * log_det2) * log_det;
484 t_T(i, j) =
485
486 A * (t_dev(k, l) * t_diff_deviator(k, l, i, j))
487
488 +
489
490 B * t_kd(i, j)
491
492 +
493
494 alphaU * t_D(i, j, k, l) * t_dot_log_u(k, l);
495
497 t_residual(L) =
498 a * (t_approx_P_adjoint_log_du(L) - t_L(i, j, L) * t_T(i, j));
499
500 int bb = 0;
501 for (; bb != nb_dofs / size_symm; ++bb) {
502 t_nf(L) -= t_row_base_fun * t_residual(L);
503 ++t_nf;
504 ++t_row_base_fun;
505 }
506 for (; bb != nb_base_functions; ++bb)
507 ++t_row_base_fun;
508
509 ++t_w;
510 ++t_approx_P_adjoint_log_du;
511 ++t_dot_log_u;
512 ++t_log_stretch_h1;
513 }
515}
516
518 std::string row_field, std::string col_field,
519 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const double alpha)
520 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
521 alphaU(alpha) {
522 sYmm = false;
523
524 CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULLPTR, "", "-poly_convex",
525 &polyConvex, PETSC_NULLPTR),
526 "get polyconvex option failed");
527}
528
530 const std::string &field_name,
531 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
532 boost::shared_ptr<ExternalStrainVec> &external_strain_vec_ptr,
533 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
534 : OpAssembleVolume(field_name, data_ptr, OPROW),
535 externalStrainVecPtr(external_strain_vec_ptr), scalingMethodsMap(smv) {}
536
537MoFEMErrorCode
540
542
543 double time = OpAssembleVolume::getFEMethod()->ts_t;
546 }
547 // get entity of tet
549 // iterate over all block data
550
551 for (auto &ext_strain_block : (*externalStrainVecPtr)) {
552 // check if finite element entity is part of the EXTERNALSTRAIN block
553 if (ext_strain_block.ents.find(fe_ent) != ext_strain_block.ents.end()) {
554
555 double scale = 1;
556 if (scalingMethodsMap.find(ext_strain_block.blockName) !=
557 scalingMethodsMap.end()) {
558 scale *=
559 scalingMethodsMap.at(ext_strain_block.blockName)->getScale(time);
560 } else {
561 MOFEM_LOG("SELF", Sev::warning)
562 << "No scaling method found for " << ext_strain_block.blockName;
563 }
564
565 int nb_dofs = data.getIndices().size();
566 int nb_integration_pts = data.getN().size1();
567 auto v = getVolume();
568 auto t_w = getFTensor0IntegrationWeight();
570
571 double external_strain_val;
572 VectorDouble v_external_strain;
573 auto block_name = "(.*)ANALYTICAL_EXTERNALSTRAIN(.*)";
574 std::regex reg_name(block_name);
575 if (std::regex_match(ext_strain_block.blockName, reg_name)) {
576 VectorDouble analytical_external_strain;
577 std::string block_name_tmp;
578 std::tie(block_name_tmp, v_external_strain) =
579 getAnalyticalExternalStrain(this, analytical_external_strain,
580 ext_strain_block.blockName);
581 } else {
582 // get ExternalStrain data from block
583 external_strain_val = scale * ext_strain_block.val;
584 // fill with same scalar value for all integration points
585 v_external_strain.resize(nb_integration_pts);
586 std::fill(v_external_strain.begin(), v_external_strain.end(),
587 external_strain_val);
588 }
589 auto t_external_strain = getFTensor0FromVec(v_external_strain);
590 double bulk_modulus_K = ext_strain_block.bulkModulusK;
591 auto t_L = symm_L_tensor();
592
593 FTensor::Index<'i', 3> i;
594 FTensor::Index<'j', 3> j;
595 FTensor::Index<'k', 3> k;
596 FTensor::Index<'l', 3> l;
597 auto get_ftensor2 = [](auto &v) {
599 &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
600 };
601
602 int nb_base_functions = data.getN().size2();
603 auto t_row_base_fun = data.getFTensor0N();
604 for (int gg = 0; gg != nb_integration_pts; ++gg) {
605 auto tr = 3.0 * t_external_strain;
606 double a = v * t_w;
607 auto t_nf = get_ftensor2(nF);
608
610
611 t_T(i, j) = -bulk_modulus_K * tr * t_kd(i, j);
612
614 t_residual(L) = a * (t_L(i, j, L) * t_T(i, j));
615
616 int bb = 0;
617 for (; bb != nb_dofs / 6; ++bb) {
618 t_nf(L) += t_row_base_fun * t_residual(L);
619 ++t_nf;
620 ++t_row_base_fun;
621 }
622 for (; bb != nb_base_functions; ++bb)
623 ++t_row_base_fun;
624 ++t_external_strain;
625 ++t_w;
626 }
627 }
628 }
629
631}
632
633MoFEMErrorCode
635 EntData &col_data) {
637
638 if (polyConvex) {
639 CHKERR integratePolyconvexHencky(row_data, col_data);
640 } else {
641 CHKERR integrateHencky(row_data, col_data);
642 }
644}
645
646MoFEMErrorCode
648 EntData &col_data) {
650
653 auto t_L = symm_L_tensor();
654 auto t_diff = diff_tensor();
655
656 int nb_integration_pts = row_data.getN().size1();
657 int row_nb_dofs = row_data.getIndices().size();
658 int col_nb_dofs = col_data.getIndices().size();
659
660 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
662 size_symm>(
663
664 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
665 &m(r + 0, c + 4), &m(r + 0, c + 5),
666
667 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
668 &m(r + 1, c + 4), &m(r + 1, c + 5),
669
670 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
671 &m(r + 2, c + 4), &m(r + 2, c + 5),
672
673 &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
674 &m(r + 3, c + 4), &m(r + 3, c + 5),
675
676 &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
677 &m(r + 4, c + 4), &m(r + 4, c + 5),
678
679 &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
680 &m(r + 5, c + 4), &m(r + 5, c + 5)
681
682 );
683 };
684 FTensor::Index<'i', 3> i;
685 FTensor::Index<'j', 3> j;
686 FTensor::Index<'k', 3> k;
687 FTensor::Index<'l', 3> l;
688 FTensor::Index<'m', 3> m;
689 FTensor::Index<'n', 3> n;
690
691 auto v = getVolume();
692 auto t_w = getFTensor0IntegrationWeight();
693
694 auto t_approx_P_adjoint__dstretch =
695 getFTensor2FromMat<3, 3>(dataAtPts->adjointPdstretchAtPts);
696 auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
697 auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
698
699 int row_nb_base_functions = row_data.getN().size2();
700 auto t_row_base_fun = row_data.getFTensor0N();
701
702 auto get_dP = [&]() {
703 dP.resize(size_symm * size_symm, nb_integration_pts, false);
704 auto ts_a = getTSa();
705
706 auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
708 t_dP_tmp(L, J) = -(1 + alphaU * ts_a) *
709 (t_L(i, j, L) *
710 ((t_D(i, j, m, n) * t_diff(m, n, k, l)) * t_L(k, l, J)));
711
714 auto t_approx_P_adjoint__dstretch =
715 getFTensor2FromMat<3, 3>(dataAtPts->adjointPdstretchAtPts);
716 auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
717 auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
718 auto &nbUniq = dataAtPts->nbUniq;
719
720 auto t_dP = getFTensor2FromMat<size_symm, size_symm>(dP);
721 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
722
723 // Work of symmetric tensor on undefined tensor is equal to the work
724 // of the symmetric part of it
726 t_sym(i, j) = (t_approx_P_adjoint__dstretch(i, j) ||
727 t_approx_P_adjoint__dstretch(j, i));
728 t_sym(i, j) /= 2.0;
729 auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
730 t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
731 EshelbianCore::dd_f, t_sym, nbUniq[gg]);
732 t_dP(L, J) = t_L(i, j, L) *
733 ((t_diff2_uP2(i, j, k, l) + t_diff2_uP2(k, l, i, j)) *
734 t_L(k, l, J)) /
735 2. +
736 t_dP_tmp(L, J);
737
738 ++t_dP;
739 ++t_approx_P_adjoint__dstretch;
740 ++t_eigen_vals;
741 ++t_eigen_vecs;
742 }
743 } else {
744 auto t_dP = getFTensor2FromMat<size_symm, size_symm>(dP);
745 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
746 t_dP(L, J) = t_dP_tmp(L, J);
747 ++t_dP;
748 }
749 }
750
751 return getFTensor2FromMat<size_symm, size_symm>(dP);
752 };
753
754 auto t_dP = get_dP();
755 for (int gg = 0; gg != nb_integration_pts; ++gg) {
756 double a = v * t_w;
757
758 int rr = 0;
759 for (; rr != row_nb_dofs / 6; ++rr) {
760 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
761 auto t_m = get_ftensor2(K, 6 * rr, 0);
762 for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
763 const double b = a * t_row_base_fun * t_col_base_fun;
764 t_m(L, J) -= b * t_dP(L, J);
765 ++t_m;
766 ++t_col_base_fun;
767 }
768 ++t_row_base_fun;
769 }
770
771 for (; rr != row_nb_base_functions; ++rr) {
772 ++t_row_base_fun;
773 }
774
775 ++t_w;
776 ++t_dP;
777 }
779}
780
782 EntData &row_data, EntData &col_data) {
784
787 auto t_L = symm_L_tensor();
788 auto t_diff = diff_tensor();
789
790 int nb_integration_pts = row_data.getN().size1();
791 int row_nb_dofs = row_data.getIndices().size();
792 int col_nb_dofs = col_data.getIndices().size();
793
794 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
796 size_symm>(
797
798 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
799 &m(r + 0, c + 4), &m(r + 0, c + 5),
800
801 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
802 &m(r + 1, c + 4), &m(r + 1, c + 5),
803
804 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
805 &m(r + 2, c + 4), &m(r + 2, c + 5),
806
807 &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
808 &m(r + 3, c + 4), &m(r + 3, c + 5),
809
810 &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
811 &m(r + 4, c + 4), &m(r + 4, c + 5),
812
813 &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
814 &m(r + 5, c + 4), &m(r + 5, c + 5)
815
816 );
817 };
818 FTensor::Index<'i', 3> i;
819 FTensor::Index<'j', 3> j;
820 FTensor::Index<'k', 3> k;
821 FTensor::Index<'l', 3> l;
822 FTensor::Index<'m', 3> m;
823 FTensor::Index<'n', 3> n;
824
825 auto v = getVolume();
826 auto t_w = getFTensor0IntegrationWeight();
827
828 int row_nb_base_functions = row_data.getN().size2();
829 auto t_row_base_fun = row_data.getFTensor0N();
830
831 auto get_dP = [&]() {
832 dP.resize(size_symm * size_symm, nb_integration_pts, false);
833 auto ts_a = getTSa();
834
835 auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
836
837 constexpr double nohat_k = 1. / 4;
838 constexpr double hat_k = 1. / 8;
839 double mu = dataAtPts->mu;
840 double lambda = dataAtPts->lambda;
841
842 constexpr double third = boost::math::constants::third<double>();
844 auto t_diff_deviator = diff_deviator(diff_tensor());
845
846 auto t_approx_P_adjoint__dstretch =
847 getFTensor2FromMat<3, 3>(dataAtPts->adjointPdstretchAtPts);
848 auto t_log_stretch_h1 =
849 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
850 auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
851 auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
852 auto &nbUniq = dataAtPts->nbUniq;
853
854 auto t_dP = getFTensor2FromMat<size_symm, size_symm>(dP);
855 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
856
857 double log_det = t_log_stretch_h1(i, i);
858 double log_det2 = log_det * log_det;
860 t_dev(i, j) = t_log_stretch_h1(i, j) - t_kd(i, j) * (third * log_det);
861 double dev_norm2 = t_dev(i, j) * t_dev(i, j);
862
863 auto A = 2 * mu * std::exp(nohat_k * dev_norm2);
864 auto B = lambda * std::exp(hat_k * log_det2) * log_det;
865
866 FTensor::Tensor2_symmetric<double, 3> t_A_diff, t_B_diff;
867 t_A_diff(i, j) =
868 (A * 2 * nohat_k) * (t_dev(k, l) * t_diff_deviator(k, l, i, j));
869 t_B_diff(i, j) = (B * 2 * hat_k) * log_det * t_kd(i, j) +
870 lambda * std::exp(hat_k * log_det2) * t_kd(i, j);
872 t_dT(i, j, k, l) =
873 t_A_diff(i, j) * (t_dev(m, n) * t_diff_deviator(m, n, k, l))
874
875 +
876
877 A * t_diff_deviator(m, n, i, j) * t_diff_deviator(m, n, k, l)
878
879 +
880
881 t_B_diff(i, j) * t_kd(k, l);
882
883 t_dP(L, J) = -t_L(i, j, L) *
884 ((
885
886 t_dT(i, j, k, l)
887
888 +
889
890 (alphaU * ts_a) * (t_D(i, j, m, n) * t_diff(m, n, k, l)
891
892 )) *
893 t_L(k, l, J));
894
895 // Work of symmetric tensor on undefined tensor is equal to the work
896 // of the symmetric part of it
900 t_sym(i, j) = (t_approx_P_adjoint__dstretch(i, j) ||
901 t_approx_P_adjoint__dstretch(j, i));
902 t_sym(i, j) /= 2.0;
903 auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
904 t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
905 EshelbianCore::dd_f, t_sym, nbUniq[gg]);
906 t_dP(L, J) += t_L(i, j, L) *
907 ((t_diff2_uP2(i, j, k, l) + t_diff2_uP2(k, l, i, j)) *
908 t_L(k, l, J)) /
909 2.;
910 }
911
912 ++t_dP;
913 ++t_approx_P_adjoint__dstretch;
914 ++t_log_stretch_h1;
915 ++t_eigen_vals;
916 ++t_eigen_vecs;
917 }
918
919 return getFTensor2FromMat<size_symm, size_symm>(dP);
920 };
921
922 auto t_dP = get_dP();
923 for (int gg = 0; gg != nb_integration_pts; ++gg) {
924 double a = v * t_w;
925
926 int rr = 0;
927 for (; rr != row_nb_dofs / 6; ++rr) {
928 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
929 auto t_m = get_ftensor2(K, 6 * rr, 0);
930 for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
931 const double b = a * t_row_base_fun * t_col_base_fun;
932 t_m(L, J) -= b * t_dP(L, J);
933 ++t_m;
934 ++t_col_base_fun;
935 }
936 ++t_row_base_fun;
937 }
938
939 for (; rr != row_nb_base_functions; ++rr) {
940 ++t_row_base_fun;
941 }
942
943 ++t_w;
944 ++t_dP;
945 }
947}
948
950 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
951 boost::shared_ptr<double> total_energy_ptr)
952 : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
953 totalEnergyPtr(total_energy_ptr) {
954
955 if (!dataAtPts) {
957 "dataAtPts is not allocated. Please set it before "
958 "using this operator.");
959 }
960
961}
962
963MoFEMErrorCode HMHHencky::OpCalculateEnergy::doWork(int side, EntityType type,
964 EntData &data) {
966
971
972 int nb_integration_pts = getGaussPts().size2();
973 auto t_log_u =
974 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
975
976
977 auto &mat_d = dataAtPts->matD;
978 if (mat_d.size1() != size_symm || mat_d.size2() != size_symm) {
979 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
980 "wrong matD size, should be 6 by 6 but is %d by %d", size_symm,
981 size_symm);
982 }
983
984 auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(mat_d.data().data());
985
986 dataAtPts->energyAtPts.resize(nb_integration_pts, false);
987 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
988
989 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
990
991 t_energy = 0.5 * (t_log_u(i, j) * (t_D(i, j, k, l) * t_log_u(k, l)));
992
993 ++t_log_u;
994 ++t_energy;
995 }
996
997 if (totalEnergyPtr) {
998 auto t_w = getFTensor0IntegrationWeight();
999 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
1000 double loc_energy = 0;
1001 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1002 loc_energy += t_energy * t_w;
1003 ++t_w;
1004 ++t_energy;
1005 }
1006 *totalEnergyPtr += getMeasure() * loc_energy;
1007 }
1008
1010}
1011
1013 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1014 boost::shared_ptr<MatrixDouble> strain_ptr,
1015 boost::shared_ptr<MatrixDouble> stress_ptr,
1016 boost::shared_ptr<HMHHencky> hencky_ptr)
1017 : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
1018 strainPtr(strain_ptr), stressPtr(stress_ptr), henckyPtr(hencky_ptr) {}
1019
1021 EntityType type,
1022 EntData &data) {
1024
1031
1032 auto nb_integration_pts = stressPtr->size2();
1033#ifndef NDEBUG
1034 if (nb_integration_pts != getGaussPts().size2()) {
1035 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1036 "inconsistent number of integration points");
1037 }
1038#endif // NDEBUG
1039
1040 auto get_D = [&]() {
1042 for (auto &b : henckyPtr->blockData) {
1043
1044 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
1045 dataAtPts->mu = b.shearModulusG;
1046 dataAtPts->lambda = b.bulkModulusK - 2 * b.shearModulusG / 3;
1047 CHKERR henckyPtr->getMatDPtr(
1048 dataAtPts->getMatDPtr(), dataAtPts->getMatAxiatorDPtr(),
1049 dataAtPts->getMatDeviatorDPtr(), b.bulkModulusK, b.shearModulusG);
1050 CHKERR henckyPtr->getInvMatDPtr(dataAtPts->getMatInvDPtr(),
1051 b.bulkModulusK, b.shearModulusG);
1053 }
1054 }
1055
1056 const auto E = henckyPtr->E;
1057 const auto nu = henckyPtr->nu;
1058
1059 double bulk_modulus_K = E / (3 * (1 - 2 * nu));
1060 double shear_modulus_G = E / (2 * (1 + nu));
1061
1062 dataAtPts->mu = shear_modulus_G;
1063 dataAtPts->lambda = bulk_modulus_K - 2 * shear_modulus_G / 3;
1064
1065 CHKERR henckyPtr->getMatDPtr(
1066 dataAtPts->getMatDPtr(), dataAtPts->getMatAxiatorDPtr(),
1067 dataAtPts->getMatDeviatorDPtr(), bulk_modulus_K, shear_modulus_G);
1068 CHKERR henckyPtr->getInvMatDPtr(dataAtPts->getMatInvDPtr(), bulk_modulus_K,
1071 };
1072
1073 CHKERR get_D();
1074
1075 strainPtr->resize(size_symm, nb_integration_pts, false);
1076 auto t_strain = getFTensor2SymmetricFromMat<3>(*strainPtr);
1077 auto t_stress = getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(*stressPtr);
1078 auto t_inv_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
1079 &*dataAtPts->matInvD.data().begin());
1080#ifndef NDEBUG
1081 auto t_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
1082 &*dataAtPts->matD.data().begin());
1083#endif
1084
1085 const double lambda = dataAtPts->lambda;
1086 const double mu = dataAtPts->mu;
1088
1089 // note: add rotation, so we can extract rigid body motion, work then with
1090 // symmetric part.
1091 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1092 t_strain(i, j) = t_inv_D(i, j, k, l) * t_stress(k, l);
1093
1094#ifndef NDEBUG
1095 FTensor::Tensor2_symmetric<double, 3> t_stress_symm_debug;
1096 t_stress_symm_debug(i, j) = (t_stress(i, j) || t_stress(j, i)) / 2;
1097 FTensor::Tensor2_symmetric<double, 3> t_stress_symm_debug_diff;
1098 t_stress_symm_debug_diff(i, j) =
1099 t_D(i, j, k, l) * t_strain(k, l) - t_stress_symm_debug(i, j);
1100 double nrm =
1101 t_stress_symm_debug_diff(i, j) * t_stress_symm_debug_diff(i, j);
1102 double nrm0 = t_stress_symm_debug(i, j) * t_stress_symm_debug(i, j) +
1103 std::numeric_limits<double>::epsilon();
1104 constexpr double eps = 1e-10;
1105 if (std::fabs(std::sqrt(nrm / nrm0)) > eps) {
1106 MOFEM_LOG("SELF", Sev::error)
1107 << "Stress symmetry check failed: " << std::endl
1108 << t_stress_symm_debug_diff << std::endl
1109 << t_stress;
1111 "Norm is too big: " + std::to_string(nrm / nrm0));
1112 }
1113 ++t_D;
1114#endif
1115
1116 ++t_strain;
1117 ++t_stress;
1118 ++t_inv_D;
1119 }
1120
1122}
1123
1124template <typename OP_PTR>
1125std::tuple<std::string, VectorDouble>
1126getAnalyticalExternalStrain(OP_PTR op_ptr, VectorDouble &analytical_expr,
1127 const std::string block_name) {
1128
1129 auto nb_gauss_pts = op_ptr->getGaussPts().size2();
1130
1131 auto ts_time = op_ptr->getTStime();
1132 auto ts_time_step = op_ptr->getTStimeStep();
1135 ts_time_step = EshelbianCore::dynamicStep;
1136 }
1137
1138 MatrixDouble m_ref_coords = op_ptr->getCoordsAtGaussPts();
1139
1140 auto v_analytical_expr = analytical_externalstrain_function(
1141 ts_time_step, ts_time, nb_gauss_pts, m_ref_coords, block_name);
1142
1143#ifndef NDEBUG
1144 if (v_analytical_expr.size() != nb_gauss_pts)
1146 "Wrong number of integration pts");
1147#endif // NDEBUG
1148
1149 return std::make_tuple(block_name, v_analytical_expr);
1150};
1151
1152} // namespace EshelbianPlasticity
constexpr double third
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define FTENSOR_INDEX(DIM, I)
constexpr double a
static PetscErrorCode ierr
static const double eps
constexpr int SPACE_DIM
[Define dimension]
Kronecker Delta class symmetric.
#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()
@ NOSPACE
Definition definitions.h:83
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
double bulk_modulus_K
double shear_modulus_G
constexpr auto t_kd
auto get_D
Create deviatoric stress tensor.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
FTensor::Index< 'i', SPACE_DIM > i
static double lambda
const double c
speed of light (cm/ns)
const double v
phase velocity of light in medium (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
auto getDiffDiffMat(A &&t_val, B &&t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, C &&t_S, const int nb)
Get the Diff Diff Mat object.
VectorDouble analytical_externalstrain_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_ref_coords, const std::string block_name)
auto diff_deviator(FTensor::Ddg< double, 3, 3 > &&t_diff_stress)
std::tuple< std::string, VectorDouble > getAnalyticalExternalStrain(OP_PTR op_ptr, VectorDouble &analytical_expr, const std::string block_name)
ForcesAndSourcesCore::UserDataOperator UserDataOperator
static constexpr auto size_symm
constexpr AssemblyType A
[Define dimension]
constexpr auto field_name
FTensor::Index< 'm', 3 > m
static enum StretchSelector stretchSelector
static double dynamicTime
static int dynamicStep
static enum RotSelector gradApproximator
static PetscBool dynamicRelaxation
static boost::function< double(const double)> f
static boost::function< double(const double)> dd_f
static boost::function< double(const double)> d_f
Calculate energy density for Hencky material model.
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
OpCalculateEnergy(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
OpCalculateStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< MatrixDouble > strain_ptr, boost::shared_ptr< MatrixDouble > stress_ptr, boost::shared_ptr< HMHHencky > hencky_ptr)
MoFEMErrorCode evaluateRhs(EntData &data)
Definition HMHHencky.cpp:62
boost::shared_ptr< HMHHencky > henckyPtr
Definition HMHHencky.cpp:67
MoFEMErrorCode evaluateLhs(EntData &data)
Definition HMHHencky.cpp:63
OpHenckyJacobian(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< HMHHencky > hencky_ptr)
Definition HMHHencky.cpp:21
boost::shared_ptr< DataAtIntegrationPts > dataAtGaussPts
Definition HMHHencky.cpp:66
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Definition HMHHencky.cpp:30
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< ExternalStrainVec > externalStrainVecPtr
OpSpatialPhysicalExternalStrain(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< ExternalStrainVec > &external_strain_vec_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
OpSpatialPhysical_du_du(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha)
MoFEMErrorCode integrateHencky(EntData &row_data, EntData &col_data)
MoFEMErrorCode integratePolyconvexHencky(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integratePolyconvexHencky(EntData &data)
OpSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
MoFEMErrorCode integrateHencky(EntData &data)
virtual VolUserDataOperator * returnOpSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
Definition HMHHencky.cpp:96
VolUserDataOperator * returnOpCalculateStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
MoFEMErrorCode extractBlockData(Sev sev)
std::vector< BlockData > blockData
MoFEMErrorCode extractBlockData(std::vector< const CubitMeshSets * > meshset_vec_ptr, Sev sev)
HMHHencky(MoFEM::Interface &m_field, const double E, const double nu)
Definition HMHHencky.cpp:15
VolUserDataOperator * returnOpCalculateVarStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
VolUserDataOperator * returnOpCalculateEnergy(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
MoFEMErrorCode getMatDPtr(boost::shared_ptr< MatrixDouble > mat_D_ptr, boost::shared_ptr< MatrixDouble > mat_axiator_D_ptr, boost::shared_ptr< MatrixDouble > mat_deviator_D_ptr, double bulk_modulus_K, double shear_modulus_G)
MoFEMErrorCode getOptions(boost::shared_ptr< DataAtIntegrationPts > data_ptr)
virtual UserDataOperator * returnOpJacobian(const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
Definition HMHHencky.cpp:71
VolUserDataOperator * returnOpSpatialPhysical_du_du(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha)
virtual VolUserDataOperator * returnOpSpatialPhysicalExternalStrain(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< ExternalStrainVec > external_strain_vec_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
MoFEMErrorCode recordTape(const int tag, DTensor2Ptr *t_h)
Definition HMHHencky.cpp:18
MoFEMErrorCode getInvMatDPtr(boost::shared_ptr< MatrixDouble > mat_inv_D_ptr, double bulk_modulus_K, double shear_modulus_G)
virtual moab::Interface & get_moab()=0
bool sYmm
If true assume that matrix is symmetric structure.
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
EntityHandle getFEEntityHandle() const
Return finite element entity handle.
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
PetscReal ts_t
Current time value.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
double young_modulus
Young modulus.
Definition plastic.cpp:125
double poisson_ratio
Poisson ratio.
Definition plastic.cpp:126
double scale
Definition plastic.cpp:123