v0.14.0
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 namespace EshelbianPlasticity {
11 
12 struct HMHHencky : public PhysicalEquations {
13 
14  HMHHencky(MoFEM::Interface &m_field, const double E, const double nu)
15  : PhysicalEquations(0, 0), mField(m_field), E(E), nu(nu) {}
16 
17  MoFEMErrorCode recordTape(const int tag, DTensor2Ptr *t_h) { return 0; }
18 
19  struct OpHenckyJacobian : public OpJacobian {
20  OpHenckyJacobian(boost::shared_ptr<DataAtIntegrationPts> data_ptr,
21  boost::shared_ptr<HMHHencky> hencky_ptr)
22  : OpJacobian(), dataAtGaussPts(data_ptr), henckyPtr(hencky_ptr) {
24  "getOptions failed");
25  CHK_THROW_MESSAGE(henckyPtr->extractBlockData(Sev::inform),
26  "Can not get data from block");
27  }
28 
29  MoFEMErrorCode doWork(int side, EntityType type,
32 
33  for (auto &b : henckyPtr->blockData) {
34  if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
35  dataAtGaussPts->mu = b.shearModulusG;
36  dataAtGaussPts->lambda = b.bulkModulusK - 2 * b.shearModulusG / 3;
37  CHKERR henckyPtr->getMatDPtr(dataAtGaussPts->getMatDPtr(),
38  dataAtGaussPts->getMatAxiatorDPtr(),
39  dataAtGaussPts->getMatDeviatorDPtr(),
40  b.bulkModulusK, b.shearModulusG);
42  }
43  }
44  const auto E = henckyPtr->E;
45  const auto nu = henckyPtr->nu;
46 
47  double bulk_modulus_K = E / (3 * (1 - 2 * nu));
48  double shear_modulus_G = E / (2 * (1 + nu));
49 
51  dataAtGaussPts->lambda = bulk_modulus_K - 2 * shear_modulus_G / 3;
52 
53  CHKERR henckyPtr->getMatDPtr(dataAtGaussPts->getMatDPtr(),
54  dataAtGaussPts->getMatAxiatorDPtr(),
55  dataAtGaussPts->getMatDeviatorDPtr(),
57 
59  }
60 
61  MoFEMErrorCode evaluateRhs(EntData &data) { return 0; }
62  MoFEMErrorCode evaluateLhs(EntData &data) { return 0; }
63 
64  private:
65  boost::shared_ptr<DataAtIntegrationPts> dataAtGaussPts;
66  boost::shared_ptr<HMHHencky> henckyPtr;
67  };
68 
69  virtual OpJacobian *
70  returnOpJacobian(const int tag, const bool eval_rhs, const bool eval_lhs,
71  boost::shared_ptr<DataAtIntegrationPts> data_ptr,
72  boost::shared_ptr<PhysicalEquations> physics_ptr) {
73  return (new OpHenckyJacobian(
74  data_ptr, boost::dynamic_pointer_cast<HMHHencky>(physics_ptr)));
75  }
76 
78 
79  OpSpatialPhysical(const std::string &field_name,
80  boost::shared_ptr<DataAtIntegrationPts> data_ptr,
81  const double alpha_u);
82 
84 
86 
88 
89  private:
90  const double alphaU;
91  PetscBool polyConvex = PETSC_FALSE;
92  };
93 
94  virtual VolUserDataOperator *
95  returnOpSpatialPhysical(const std::string &field_name,
96  boost::shared_ptr<DataAtIntegrationPts> data_ptr,
97  const double alpha_u) {
98  return new OpSpatialPhysical(field_name, data_ptr, alpha_u);
99  }
100 
102  const double alphaU;
103  OpSpatialPhysical_du_du(std::string row_field, std::string col_field,
104  boost::shared_ptr<DataAtIntegrationPts> data_ptr,
105  const double alpha);
106  MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
107  MoFEMErrorCode integrateHencky(EntData &row_data, EntData &col_data);
109  EntData &col_data);
110 
111  private:
112  PetscBool polyConvex = PETSC_FALSE;
113 
115  };
116 
118  std::string row_field, std::string col_field,
119  boost::shared_ptr<DataAtIntegrationPts> data_ptr, const double alpha) {
120  return new OpSpatialPhysical_du_du(row_field, col_field, data_ptr, alpha);
121  }
122 
123  /**
124  * @brief Calculate energy density for Hencky material model
125  *
126  *
127  * \f[
128  *
129  * \Psi(\log{\mathbf{U}}) = \frac{1}{2} U_{IJ} D_{IJKL} U_{KL} = \frac{1}{2}
130  * U_{IJ} T_{IJ}
131  *
132  * \f]
133  * where \f$T_{IJ} = D_{IJKL} U_{KL}\f$ is a a Hencky stress.
134  *
135  */
137 
138  OpCalculateEnergy(boost::shared_ptr<DataAtIntegrationPts> data_ptr,
139  boost::shared_ptr<double> total_energy_ptr);
140  MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
141 
142  private:
143  boost::shared_ptr<DataAtIntegrationPts> dataAtPts;
144  boost::shared_ptr<double> totalEnergyPtr;
145  };
146 
148  returnOpCalculateEnergy(boost::shared_ptr<DataAtIntegrationPts> data_ptr,
149  boost::shared_ptr<double> total_energy_ptr) {
150  return new OpCalculateEnergy(data_ptr, total_energy_ptr);
151  }
152 
155  boost::shared_ptr<DataAtIntegrationPts> data_ptr,
156  boost::shared_ptr<MatrixDouble> strain_ptr,
157  boost::shared_ptr<MatrixDouble> stress_ptr,
158  boost::shared_ptr<HMHHencky> hencky_ptr);
159  MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
160 
161  private:
162  boost::shared_ptr<DataAtIntegrationPts>
163  dataAtPts; ///< data at integration pts
164  boost::shared_ptr<MatrixDouble> strainPtr;
165  boost::shared_ptr<MatrixDouble> stressPtr;
166  boost::shared_ptr<HMHHencky> henckyPtr;
167  };
168 
170  boost::shared_ptr<DataAtIntegrationPts> data_ptr,
171  boost::shared_ptr<PhysicalEquations> physics_ptr) {
172  return new OpCalculateStretchFromStress(
173  data_ptr, data_ptr->getLogStretchTensorAtPts(),
174  data_ptr->getApproxPAtPts(),
175  boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
176  }
177 
179  boost::shared_ptr<DataAtIntegrationPts> data_ptr,
180  boost::shared_ptr<PhysicalEquations> physics_ptr) {
181  return new OpCalculateStretchFromStress(
182  data_ptr, data_ptr->getVarLogStreachPts(), data_ptr->getVarPiolaPts(),
183  boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
184  }
185 
186  MoFEMErrorCode getOptions(boost::shared_ptr<DataAtIntegrationPts> data_ptr) {
188  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "hencky_", "", "none");
189 
190  CHKERR PetscOptionsScalar("-young_modulus", "Young modulus", "", E, &E,
191  PETSC_NULL);
192  CHKERR PetscOptionsScalar("-poisson_ratio", "poisson ratio", "", nu, &nu,
193  PETSC_NULL);
194 
195  MOFEM_LOG_CHANNEL("WORLD");
196  MOFEM_LOG("WORLD", Sev::verbose) << "Hencky: E = " << E << " nu = " << nu;
197 
198  ierr = PetscOptionsEnd();
199  CHKERRG(ierr);
200 
202  }
203 
205  return extractBlockData(
206 
207  mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
208 
209  (boost::format("%s(.*)") % "MAT_ELASTIC").str()
210 
211  )),
212 
213  sev);
214  }
215 
217  extractBlockData(std::vector<const CubitMeshSets *> meshset_vec_ptr,
218  Sev sev) {
220 
221  for (auto m : meshset_vec_ptr) {
222  MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock") << *m;
223  std::vector<double> block_data;
224  CHKERR m->getAttributes(block_data);
225  if (block_data.size() != 2) {
226  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
227  "Expected that block has two attribute");
228  }
229  auto get_block_ents = [&]() {
230  Range ents;
231  CHKERR mField.get_moab().get_entities_by_handle(m->meshset, ents, true);
232  return ents;
233  };
234 
235  double young_modulus = block_data[0];
236  double poisson_ratio = block_data[1];
237  double bulk_modulus_K = young_modulus / (3 * (1 - 2 * poisson_ratio));
238  double shear_modulus_G = young_modulus / (2 * (1 + poisson_ratio));
239 
240  MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock")
241  << "E = " << young_modulus << " nu = " << poisson_ratio;
242 
243  blockData.push_back({bulk_modulus_K, shear_modulus_G, get_block_ents()});
244  }
245  MOFEM_LOG_CHANNEL("WORLD");
247  }
248 
249  MoFEMErrorCode getMatDPtr(boost::shared_ptr<MatrixDouble> mat_D_ptr,
250  boost::shared_ptr<MatrixDouble> mat_axiator_D_ptr,
251  boost::shared_ptr<MatrixDouble> mat_deviator_D_ptr,
252  double bulk_modulus_K, double shear_modulus_G) {
254  //! [Calculate elasticity tensor]
255  auto set_material_stiffness = [&]() {
261  auto t_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
262  &*(mat_D_ptr->data().begin()));
263  auto t_axiator_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
264  &*mat_axiator_D_ptr->data().begin());
265  auto t_deviator_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
266  &*mat_deviator_D_ptr->data().begin());
267  t_axiator_D(i, j, k, l) = (bulk_modulus_K - (2. / 3.) * shear_modulus_G) *
268  t_kd(i, j) * t_kd(k, l);
269  t_deviator_D(i, j, k, l) =
270  2 * shear_modulus_G * ((t_kd(i, k) ^ t_kd(j, l)) / 4.);
271  t_D(i, j, k, l) = t_axiator_D(i, j, k, l) + t_deviator_D(i, j, k, l);
272  };
273  //! [Calculate elasticity tensor]
274  constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
275  mat_D_ptr->resize(size_symm, size_symm, false);
276  mat_axiator_D_ptr->resize(size_symm, size_symm, false);
277  mat_deviator_D_ptr->resize(size_symm, size_symm, false);
278  set_material_stiffness();
280  }
281 
283  getInvMatDPtr(boost::shared_ptr<MatrixDouble> mat_inv_D_ptr,
284  double bulk_modulus_K, double shear_modulus_G) {
286  //! [Calculate elasticity tensor]
287  auto set_material_compilance = [&]() {
293  const double A = 1. / (2. * shear_modulus_G);
294  const double B =
295  (1. / (9. * bulk_modulus_K)) - (1. / (6. * shear_modulus_G));
296  auto t_inv_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
297  &*(mat_inv_D_ptr->data().begin()));
298  t_inv_D(i, j, k, l) =
299  A * ((t_kd(i, k) ^ t_kd(j, l)) / 4.) + B * t_kd(i, j) * t_kd(k, l);
300  };
301  //! [Calculate elasticity tensor]
302  constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
303  mat_inv_D_ptr->resize(size_symm, size_symm, false);
304  set_material_compilance();
306  }
307 
308 private:
310 
311  struct BlockData {
312  double bulkModulusK;
315  };
316  std::vector<BlockData> blockData;
317 
318  double E;
319  double nu;
320 };
321 
323  const std::string &field_name,
324  boost::shared_ptr<DataAtIntegrationPts> data_ptr, const double alpha_u)
325  : OpAssembleVolume(field_name, data_ptr, OPROW), alphaU(alpha_u) {
326 
327  CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULL, "", "-poly_convex",
328  &polyConvex, PETSC_NULL),
329  "get polyconvex option failed");
330 }
331 
334  if (polyConvex) {
335  CHKERR integratePolyconvexHencky(data);
336  } else {
337  CHKERR integrateHencky(data);
338  }
340 }
341 
344 
346  auto t_L = symm_L_tensor();
347 
348  int nb_dofs = data.getIndices().size();
349  int nb_integration_pts = data.getN().size1();
350  auto v = getVolume();
351  auto t_w = getFTensor0IntegrationWeight();
352  auto t_approx_P_adjoint_log_du =
353  getFTensor1FromMat<size_symm>(dataAtPts->adjointPdUAtPts);
354  auto t_log_stretch_h1 =
355  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
356  auto t_dot_log_u =
357  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
358 
359  auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
360 
365  auto get_ftensor2 = [](auto &v) {
367  &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
368  };
369 
370  int nb_base_functions = data.getN().size2();
371  auto t_row_base_fun = data.getFTensor0N();
372  for (int gg = 0; gg != nb_integration_pts; ++gg) {
373  double a = v * t_w;
374  auto t_nf = get_ftensor2(nF);
375 
377  t_T(i, j) =
378  t_D(i, j, k, l) * (t_log_stretch_h1(k, l) + alphaU * t_dot_log_u(k, l));
380  t_residual(L) =
381  a * (t_approx_P_adjoint_log_du(L) - t_L(i, j, L) * t_T(i, j));
382 
383  int bb = 0;
384  for (; bb != nb_dofs / 6; ++bb) {
385  t_nf(L) -= t_row_base_fun * t_residual(L);
386  ++t_nf;
387  ++t_row_base_fun;
388  }
389  for (; bb != nb_base_functions; ++bb)
390  ++t_row_base_fun;
391 
392  ++t_w;
393  ++t_approx_P_adjoint_log_du;
394  ++t_dot_log_u;
395  ++t_log_stretch_h1;
396  }
398 }
399 
403 
405  auto t_L = symm_L_tensor();
406 
407  int nb_dofs = data.getIndices().size();
408  int nb_integration_pts = data.getN().size1();
409  auto v = getVolume();
410  auto t_w = getFTensor0IntegrationWeight();
411  auto t_approx_P_adjoint_log_du =
412  getFTensor1FromMat<size_symm>(dataAtPts->adjointPdUAtPts);
413  auto t_log_stretch_h1 =
414  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
415  auto t_dot_log_u =
416  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
417 
418  auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
419 
424  auto get_ftensor2 = [](auto &v) {
426  &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
427  };
428 
429  constexpr double nohat_k = 1. / 4;
430  constexpr double hat_k = 1. / 8;
431  double mu = dataAtPts->mu;
432  double lambda = dataAtPts->lambda;
433 
434  constexpr double third = boost::math::constants::third<double>();
436  auto t_diff_deviator = diff_deviator(diff_tensor());
437 
438  int nb_base_functions = data.getN().size2();
439  auto t_row_base_fun = data.getFTensor0N();
440  for (int gg = 0; gg != nb_integration_pts; ++gg) {
441  double a = v * t_w;
442  auto t_nf = get_ftensor2(nF);
443 
444  double log_det = t_log_stretch_h1(i, i);
445  double log_det2 = log_det * log_det;
447  t_dev(i, j) = t_log_stretch_h1(i, j) - t_kd(i, j) * (third * log_det);
448  double dev_norm2 = t_dev(i, j) * t_dev(i, j);
449 
451  auto A = 2 * mu * std::exp(nohat_k * dev_norm2);
452  auto B = lambda * std::exp(hat_k * log_det2) * log_det;
453  t_T(i, j) =
454 
455  A * (t_dev(k, l) * t_diff_deviator(k, l, i, j))
456 
457  +
458 
459  B * t_kd(i, j)
460 
461  +
462 
463  alphaU * t_D(i, j, k, l) * t_dot_log_u(k, l);
464 
466  t_residual(L) =
467  a * (t_approx_P_adjoint_log_du(L) - t_L(i, j, L) * t_T(i, j));
468 
469  int bb = 0;
470  for (; bb != nb_dofs / size_symm; ++bb) {
471  t_nf(L) -= t_row_base_fun * t_residual(L);
472  ++t_nf;
473  ++t_row_base_fun;
474  }
475  for (; bb != nb_base_functions; ++bb)
476  ++t_row_base_fun;
477 
478  ++t_w;
479  ++t_approx_P_adjoint_log_du;
480  ++t_dot_log_u;
481  ++t_log_stretch_h1;
482  }
484 }
485 
487  std::string row_field, std::string col_field,
488  boost::shared_ptr<DataAtIntegrationPts> data_ptr, const double alpha)
489  : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
490  alphaU(alpha) {
491  sYmm = false;
492 
493  CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULL, "", "-poly_convex",
494  &polyConvex, PETSC_NULL),
495  "get polyconvex option failed");
496 }
497 
500  EntData &col_data) {
502 
503  if (polyConvex) {
504  CHKERR integratePolyconvexHencky(row_data, col_data);
505  } else {
506  CHKERR integrateHencky(row_data, col_data);
507  }
509 }
510 
513  EntData &col_data) {
515 
518  auto t_L = symm_L_tensor();
519  auto t_diff = diff_tensor();
520 
521  int nb_integration_pts = row_data.getN().size1();
522  int row_nb_dofs = row_data.getIndices().size();
523  int col_nb_dofs = col_data.getIndices().size();
524 
525  auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
527  size_symm>(
528 
529  &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
530  &m(r + 0, c + 4), &m(r + 0, c + 5),
531 
532  &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
533  &m(r + 1, c + 4), &m(r + 1, c + 5),
534 
535  &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
536  &m(r + 2, c + 4), &m(r + 2, c + 5),
537 
538  &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
539  &m(r + 3, c + 4), &m(r + 3, c + 5),
540 
541  &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
542  &m(r + 4, c + 4), &m(r + 4, c + 5),
543 
544  &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
545  &m(r + 5, c + 4), &m(r + 5, c + 5)
546 
547  );
548  };
555 
556  auto v = getVolume();
557  auto t_w = getFTensor0IntegrationWeight();
558 
559  auto t_approx_P_adjoint_dstretch =
560  getFTensor2FromMat<3, 3>(dataAtPts->adjointPdstretchAtPts);
561  auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
562  auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
563  auto &nbUniq = dataAtPts->nbUniq;
564 
565  int row_nb_base_functions = row_data.getN().size2();
566  auto t_row_base_fun = row_data.getFTensor0N();
567 
568  auto get_dP = [&]() {
569  dP.resize(size_symm * size_symm, nb_integration_pts, false);
570  auto ts_a = getTSa();
571 
572  auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
574  t_dP_tmp(L, J) = -(1 + alphaU * ts_a) *
575  (t_L(i, j, L) *
576  ((t_D(i, j, m, n) * t_diff(m, n, k, l)) * t_L(k, l, J)));
577 
580  auto t_approx_P_adjoint_dstretch =
581  getFTensor2FromMat<3, 3>(dataAtPts->adjointPdstretchAtPts);
582  auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
583  auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
584  auto &nbUniq = dataAtPts->nbUniq;
585 
586  auto t_dP = getFTensor2FromMat<size_symm, size_symm>(dP);
587  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
588 
589  // Work of symmetric tensor on undefined tensor is equal to the work
590  // of the symmetric part of it
592  t_sym(i, j) = (t_approx_P_adjoint_dstretch(i, j) ||
593  t_approx_P_adjoint_dstretch(j, i));
594  t_sym(i, j) /= 2.0;
595  auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
596  t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
597  EshelbianCore::dd_f, t_sym, nbUniq[gg]);
598  t_dP(L, J) = t_L(i, j, L) *
599  ((t_diff2_uP2(i, j, k, l) + t_diff2_uP2(k, l, i, j)) *
600  t_L(k, l, J)) /
601  2. +
602  t_dP_tmp(L, J);
603 
604  ++t_dP;
605  ++t_approx_P_adjoint_dstretch;
606  ++t_eigen_vals;
607  ++t_eigen_vecs;
608  }
609  } else {
610  auto t_dP = getFTensor2FromMat<size_symm, size_symm>(dP);
611  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
612  t_dP(L, J) = t_dP_tmp(L, J);
613  ++t_dP;
614  }
615  }
616 
617  return getFTensor2FromMat<size_symm, size_symm>(dP);
618  };
619 
620  auto t_dP = get_dP();
621  for (int gg = 0; gg != nb_integration_pts; ++gg) {
622  double a = v * t_w;
623 
624  int rr = 0;
625  for (; rr != row_nb_dofs / 6; ++rr) {
626  auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
627  auto t_m = get_ftensor2(K, 6 * rr, 0);
628  for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
629  const double b = a * t_row_base_fun * t_col_base_fun;
630  t_m(L, J) -= b * t_dP(L, J);
631  ++t_m;
632  ++t_col_base_fun;
633  }
634  ++t_row_base_fun;
635  }
636 
637  for (; rr != row_nb_base_functions; ++rr) {
638  ++t_row_base_fun;
639  }
640 
641  ++t_w;
642  ++t_dP;
643  }
645 }
646 
648  EntData &row_data, 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  };
690 
691  auto v = getVolume();
692  auto t_w = getFTensor0IntegrationWeight();
693 
694  int row_nb_base_functions = row_data.getN().size2();
695  auto t_row_base_fun = row_data.getFTensor0N();
696 
697  auto get_dP = [&]() {
698  dP.resize(size_symm * size_symm, nb_integration_pts, false);
699  auto ts_a = getTSa();
700 
701  auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
702 
703  constexpr double nohat_k = 1. / 4;
704  constexpr double hat_k = 1. / 8;
705  double mu = dataAtPts->mu;
706  double lambda = dataAtPts->lambda;
707 
708  constexpr double third = boost::math::constants::third<double>();
710  auto t_diff_deviator = diff_deviator(diff_tensor());
711 
712  auto t_approx_P_adjoint_dstretch =
713  getFTensor2FromMat<3, 3>(dataAtPts->adjointPdstretchAtPts);
714  auto t_log_stretch_h1 =
715  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
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  double log_det = t_log_stretch_h1(i, i);
724  double log_det2 = log_det * log_det;
726  t_dev(i, j) = t_log_stretch_h1(i, j) - t_kd(i, j) * (third * log_det);
727  double dev_norm2 = t_dev(i, j) * t_dev(i, j);
728 
729  auto A = 2 * mu * std::exp(nohat_k * dev_norm2);
730  auto B = lambda * std::exp(hat_k * log_det2) * log_det;
731 
732  FTensor::Tensor2_symmetric<double, 3> t_A_diff, t_B_diff;
733  t_A_diff(i, j) =
734  (A * 2 * nohat_k) * (t_dev(k, l) * t_diff_deviator(k, l, i, j));
735  t_B_diff(i, j) = (B * 2 * hat_k) * log_det * t_kd(i, j) +
736  lambda * std::exp(hat_k * log_det2) * t_kd(i, j);
738  t_dT(i, j, k, l) =
739  t_A_diff(i, j) * (t_dev(m, n) * t_diff_deviator(m, n, k, l))
740 
741  +
742 
743  A * t_diff_deviator(m, n, i, j) * t_diff_deviator(m, n, k, l)
744 
745  +
746 
747  t_B_diff(i, j) * t_kd(k, l);
748 
749  t_dP(L, J) = -t_L(i, j, L) *
750  ((
751 
752  t_dT(i, j, k, l)
753 
754  +
755 
756  (alphaU * ts_a) * (t_D(i, j, m, n) * t_diff(m, n, k, l)
757 
758  )) *
759  t_L(k, l, J));
760 
761  // Work of symmetric tensor on undefined tensor is equal to the work
762  // of the symmetric part of it
766  t_sym(i, j) = (t_approx_P_adjoint_dstretch(i, j) ||
767  t_approx_P_adjoint_dstretch(j, i));
768  t_sym(i, j) /= 2.0;
769  auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
770  t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
771  EshelbianCore::dd_f, t_sym, nbUniq[gg]);
772  t_dP(L, J) += t_L(i, j, L) *
773  ((t_diff2_uP2(i, j, k, l) + t_diff2_uP2(k, l, i, j)) *
774  t_L(k, l, J)) /
775  2.;
776  }
777 
778  ++t_dP;
779  ++t_approx_P_adjoint_dstretch;
780  ++t_log_stretch_h1;
781  ++t_eigen_vals;
782  ++t_eigen_vecs;
783  }
784 
785  return getFTensor2FromMat<size_symm, size_symm>(dP);
786  };
787 
788  auto t_dP = get_dP();
789  for (int gg = 0; gg != nb_integration_pts; ++gg) {
790  double a = v * t_w;
791 
792  int rr = 0;
793  for (; rr != row_nb_dofs / 6; ++rr) {
794  auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
795  auto t_m = get_ftensor2(K, 6 * rr, 0);
796  for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
797  const double b = a * t_row_base_fun * t_col_base_fun;
798  t_m(L, J) -= b * t_dP(L, J);
799  ++t_m;
800  ++t_col_base_fun;
801  }
802  ++t_row_base_fun;
803  }
804 
805  for (; rr != row_nb_base_functions; ++rr) {
806  ++t_row_base_fun;
807  }
808 
809  ++t_w;
810  ++t_dP;
811  }
813 }
814 
816  boost::shared_ptr<DataAtIntegrationPts> data_ptr,
817  boost::shared_ptr<double> total_energy_ptr)
818  : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
819  totalEnergyPtr(total_energy_ptr) {}
820 
822  EntData &data) {
824 
829 
830  int nb_integration_pts = getGaussPts().size2();
831  auto t_log_u =
832  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
833  auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
834 
835  dataAtPts->energyAtPts.resize(nb_integration_pts, false);
836  auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
837 
838  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
839 
840  t_energy = 0.5 * (t_log_u(i, j) * (t_D(i, j, k, l) * t_log_u(k, l)));
841 
842  ++t_log_u;
843  ++t_energy;
844  }
845 
846  if (totalEnergyPtr) {
847  auto t_w = getFTensor0IntegrationWeight();
848  auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
849  double loc_energy = 0;
850  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
851  loc_energy += t_energy * t_w;
852  ++t_w;
853  ++t_energy;
854  }
855  *totalEnergyPtr += getMeasure() * loc_energy;
856  }
857 
859 }
860 
862  boost::shared_ptr<DataAtIntegrationPts> data_ptr,
863  boost::shared_ptr<MatrixDouble> strain_ptr,
864  boost::shared_ptr<MatrixDouble> stress_ptr,
865  boost::shared_ptr<HMHHencky> hencky_ptr)
866  : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
867  strainPtr(strain_ptr), stressPtr(stress_ptr), henckyPtr(hencky_ptr) {}
868 
870  EntityType type,
871  EntData &data) {
873 
880 
881  auto nb_integration_pts = stressPtr->size2();
882 #ifndef NDEBUG
883  if (nb_integration_pts != getGaussPts().size2()) {
884  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
885  "inconsistent number of integration points");
886  }
887 #endif // NDEBUG
888 
889  auto get_D = [&]() {
891  for (auto &b : henckyPtr->blockData) {
892 
893  if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
894  dataAtPts->mu = b.shearModulusG;
895  dataAtPts->lambda = b.bulkModulusK - 2 * b.shearModulusG / 3;
896 #ifndef NDEBUG
897  CHKERR henckyPtr->getMatDPtr(
898  dataAtPts->getMatDPtr(), dataAtPts->getMatAxiatorDPtr(),
899  dataAtPts->getMatDeviatorDPtr(), b.bulkModulusK, b.shearModulusG);
900 #endif
901  CHKERR henckyPtr->getInvMatDPtr(dataAtPts->getMatInvDPtr(),
902  b.bulkModulusK, b.shearModulusG);
904  }
905  }
906 
907  const auto E = henckyPtr->E;
908  const auto nu = henckyPtr->nu;
909 
910  double bulk_modulus_K = E / (3 * (1 - 2 * nu));
911  double shear_modulus_G = E / (2 * (1 + nu));
912 
913  dataAtPts->mu = shear_modulus_G;
914  dataAtPts->lambda = bulk_modulus_K - 2 * shear_modulus_G / 3;
915 
916  CHKERR henckyPtr->getMatDPtr(
917  dataAtPts->getMatDPtr(), dataAtPts->getMatAxiatorDPtr(),
918  dataAtPts->getMatDeviatorDPtr(), bulk_modulus_K, shear_modulus_G);
919  CHKERR henckyPtr->getInvMatDPtr(dataAtPts->getMatInvDPtr(), bulk_modulus_K,
922  };
923 
924  CHKERR get_D();
925 
926  strainPtr->resize(size_symm, nb_integration_pts, false);
927  auto t_strain = getFTensor2SymmetricFromMat<3>(*strainPtr);
928  auto t_stress = getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(*stressPtr);
929  auto t_inv_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
930  &*dataAtPts->matInvD.data().begin());
931 #ifndef NDEBUG
932  auto t_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
933  &*dataAtPts->matD.data().begin());
934 #endif
935 
936  const double lambda = dataAtPts->lambda;
937  const double mu = dataAtPts->mu;
939 
940  // note: add rotation, so we can extract rigid body motion, work then with
941  // symmetric part.
942  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
943  t_strain(i, j) = t_inv_D(i, j, k, l) * t_stress(k, l);
944 
945 #ifndef NDEBUG
946  FTensor::Tensor2_symmetric<double, 3> t_stress_symm_debug;
947  t_stress_symm_debug(i, j) = (t_stress(i, j) || t_stress(j, i)) / 2;
948  FTensor::Tensor2_symmetric<double, 3> t_stress_symm_debug_diff;
949  t_stress_symm_debug_diff(i, j) =
950  t_D(i, j, k, l) * t_strain(k, l) - t_stress_symm_debug(i, j);
951  double nrm =
952  t_stress_symm_debug_diff(i, j) * t_stress_symm_debug_diff(i, j);
953  double nrm0 = t_stress_symm_debug(i, j) * t_stress_symm_debug(i, j) +
954  std::numeric_limits<double>::epsilon();
955  constexpr double eps = 1e-10;
956  if (std::fabs(std::sqrt(nrm / nrm0)) > eps) {
957  MOFEM_LOG("SELF", Sev::error)
958  << "Stress symmetry check failed: " << std::endl
959  << t_stress_symm_debug_diff << std::endl
960  << t_stress;
962  "Norm is too big: " + std::to_string(nrm / nrm0));
963  }
964  ++t_D;
965 #endif
966 
967  ++t_strain;
968  ++t_stress;
969  ++t_inv_D;
970  }
971 
973 }
974 
975 } // namespace EshelbianPlasticity
NOSPACE
@ NOSPACE
Definition: definitions.h:83
EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du::integratePolyconvexHencky
MoFEMErrorCode integratePolyconvexHencky(EntData &row_data, EntData &col_data)
Definition: HMHHencky.cpp:647
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:589
get_D
auto get_D
Definition: free_surface.cpp:254
MoFEM::K
VectorDouble K
Definition: Projection10NodeCoordsOnField.cpp:125
EshelbianPlasticity::HMHHencky::OpHenckyJacobian::evaluateRhs
MoFEMErrorCode evaluateRhs(EntData &data)
Definition: HMHHencky.cpp:61
MoFEM::EntitiesFieldData::EntData
Data on single entity (This is passed as argument to DataOperator::doWork)
Definition: EntitiesFieldData.hpp:128
EshelbianPlasticity::HMHHencky::getOptions
MoFEMErrorCode getOptions(boost::shared_ptr< DataAtIntegrationPts > data_ptr)
Definition: HMHHencky.cpp:186
EshelbianPlasticity::HMHHencky::OpCalculateEnergy::totalEnergyPtr
boost::shared_ptr< double > totalEnergyPtr
Definition: HMHHencky.cpp:144
EshelbianPlasticity::HMHHencky::returnOpCalculateVarStretchFromStress
VolUserDataOperator * returnOpCalculateVarStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
Definition: HMHHencky.cpp:178
EshelbianPlasticity::LINEAR
@ LINEAR
Definition: EshelbianPlasticity.hpp:46
EshelbianPlasticity::size_symm
constexpr static auto size_symm
Definition: EshelbianAux.hpp:41
EshelbianCore::dd_f
static boost::function< double(const double)> dd_f
Definition: EshelbianCore.hpp:34
EshelbianPlasticity::HMHHencky::recordTape
MoFEMErrorCode recordTape(const int tag, DTensor2Ptr *t_h)
Definition: HMHHencky.cpp:17
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
young_modulus
double young_modulus
Young modulus.
Definition: plastic.cpp:125
EshelbianCore::f
static boost::function< double(const double)> f
Definition: EshelbianCore.hpp:32
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:609
EshelbianCore::stretchSelector
static enum StretchSelector stretchSelector
Definition: EshelbianCore.hpp:17
EshelbianPlasticity::HMHHencky::OpSpatialPhysical::OpSpatialPhysical
OpSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
Definition: HMHHencky.cpp:322
EshelbianPlasticity::HMHHencky::OpHenckyJacobian
Definition: HMHHencky.cpp:19
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
E
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
EshelbianPlasticity::HMHHencky::OpHenckyJacobian::henckyPtr
boost::shared_ptr< HMHHencky > henckyPtr
Definition: HMHHencky.cpp:66
EshelbianPlasticity
Definition: CGGTonsorialBubbleBase.hpp:11
EshelbianPlasticity::diff_tensor
auto diff_tensor()
Definition: EshelbianAux.hpp:43
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
bulk_modulus_K
double bulk_modulus_K
Definition: dynamic_first_order_con_law.cpp:95
EshelbianPlasticity::HMHHencky::blockData
std::vector< BlockData > blockData
Definition: HMHHencky.cpp:316
EshelbianPlasticity::PhysicalEquations
Definition: EshelbianPlasticity.hpp:277
EshelbianPlasticity::HMHHencky::OpSpatialPhysical::integrate
MoFEMErrorCode integrate(EntData &data)
Definition: HMHHencky.cpp:332
J
FTensor::Index< 'J', DIM1 > J
Definition: level_set.cpp:30
EshelbianPlasticity::HMHHencky::BlockData
Definition: HMHHencky.cpp:311
EshelbianPlasticity::HMHHencky::OpCalculateEnergy
Calculate energy density for Hencky material model.
Definition: HMHHencky.cpp:136
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
FTENSOR_INDEX
#define FTENSOR_INDEX(DIM, I)
Definition: Templates.hpp:2013
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress::henckyPtr
boost::shared_ptr< HMHHencky > henckyPtr
Definition: HMHHencky.cpp:166
EshelbianPlasticity::HMHHencky::nu
double nu
Definition: HMHHencky.cpp:319
EshelbianPlasticity::HMHHencky::returnOpSpatialPhysical
virtual VolUserDataOperator * returnOpSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
Definition: HMHHencky.cpp:95
sdf.r
int r
Definition: sdf.py:8
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du::alphaU
const double alphaU
Definition: HMHHencky.cpp:102
EshelbianPlasticity::HMHHencky::extractBlockData
MoFEMErrorCode extractBlockData(std::vector< const CubitMeshSets * > meshset_vec_ptr, Sev sev)
Definition: HMHHencky.cpp:217
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1502
EshelbianPlasticity::HMHHencky::OpHenckyJacobian::evaluateLhs
MoFEMErrorCode evaluateLhs(EntData &data)
Definition: HMHHencky.cpp:62
EshelbianCore::gradApproximator
static enum RotSelector gradApproximator
Definition: EshelbianCore.hpp:16
EshelbianPlasticity::HMHHencky::OpSpatialPhysical::integrateHencky
MoFEMErrorCode integrateHencky(EntData &data)
Definition: HMHHencky.cpp:342
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
EshelbianPlasticity::HMHHencky::OpHenckyJacobian::OpHenckyJacobian
OpHenckyJacobian(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< HMHHencky > hencky_ptr)
Definition: HMHHencky.cpp:20
MoFEM::Sev
MoFEM::LogManager::SeverityLevel Sev
Definition: CoreTemplates.hpp:17
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Definition: HMHHencky.cpp:163
EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du::integrateHencky
MoFEMErrorCode integrateHencky(EntData &row_data, EntData &col_data)
Definition: HMHHencky.cpp:512
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
EshelbianPlasticity::HMHHencky::OpSpatialPhysical
Definition: HMHHencky.cpp:77
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
a
constexpr double a
Definition: approx_sphere.cpp:30
EshelbianPlasticity::HMHHencky::getInvMatDPtr
MoFEMErrorCode getInvMatDPtr(boost::shared_ptr< MatrixDouble > mat_inv_D_ptr, double bulk_modulus_K, double shear_modulus_G)
Definition: HMHHencky.cpp:283
EshelbianPlasticity::HMHHencky::BlockData::bulkModulusK
double bulkModulusK
Definition: HMHHencky.cpp:312
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress::stressPtr
boost::shared_ptr< MatrixDouble > stressPtr
Definition: HMHHencky.cpp:165
convert.type
type
Definition: convert.py:64
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
OpJacobian
Definition: EshelbianOperators.hpp:14
EshelbianPlasticity::HMHHencky::OpCalculateEnergy::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
Definition: HMHHencky.cpp:143
EshelbianPlasticity::HMHHencky
Definition: HMHHencky.cpp:12
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1214
EshelbianPlasticity::HMHHencky::getMatDPtr
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)
Definition: HMHHencky.cpp:249
poisson_ratio
double poisson_ratio
Poisson ratio.
Definition: plastic.cpp:126
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress
Definition: HMHHencky.cpp:153
EshelbianPlasticity::HMHHencky::E
double E
Definition: HMHHencky.cpp:318
EshelbianPlasticity::HMHHencky::OpCalculateEnergy::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Definition: HMHHencky.cpp:821
EshelbianPlasticity::HMHHencky::OpHenckyJacobian::dataAtGaussPts
boost::shared_ptr< DataAtIntegrationPts > dataAtGaussPts
Definition: HMHHencky.cpp:65
EshelbianPlasticity::HMHHencky::returnOpCalculateStretchFromStress
VolUserDataOperator * returnOpCalculateStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
Definition: HMHHencky.cpp:169
MoFEM::L
VectorDouble L
Definition: Projection10NodeCoordsOnField.cpp:124
EshelbianPlasticity::HMHHencky::mField
MoFEM::Interface & mField
Definition: HMHHencky.cpp:309
EshelbianPlasticity::diff_deviator
auto diff_deviator(FTensor::Ddg< double, 3, 3 > &&t_diff_stress)
Definition: EshelbianAux.hpp:14
EshelbianPlasticity::HMHHencky::returnOpCalculateEnergy
VolUserDataOperator * returnOpCalculateEnergy(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
Definition: HMHHencky.cpp:148
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:139
EshelbianPlasticity::symm_L_tensor
auto symm_L_tensor()
Definition: EshelbianAux.hpp:54
EshelbianPlasticity::HMHHencky::extractBlockData
MoFEMErrorCode extractBlockData(Sev sev)
Definition: HMHHencky.cpp:204
EshelbianPlasticity::HMHHencky::HMHHencky
HMHHencky(MoFEM::Interface &m_field, const double E, const double nu)
Definition: HMHHencky.cpp:14
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
Definition: VolumeElementForcesAndSourcesCore.hpp:109
EntData
EntitiesFieldData::EntData EntData
Definition: child_and_parent.cpp:37
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index
Definition: Index.hpp:23
EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du::polyConvex
PetscBool polyConvex
Definition: HMHHencky.cpp:112
convert.n
n
Definition: convert.py:82
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Definition: HMHHencky.cpp:869
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
Range
MOFEM_TAG_AND_LOG
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
Definition: LogManager.hpp:362
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
shear_modulus_G
double shear_modulus_G
Definition: dynamic_first_order_con_law.cpp:96
MoFEM::EntitiesFieldData::EntData::getN
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
Definition: EntitiesFieldData.hpp:1318
EshelbianPlasticity::HMHHencky::BlockData::shearModulusG
double shearModulusG
Definition: HMHHencky.cpp:313
EshelbianPlasticity::HMHHencky::OpSpatialPhysical::integratePolyconvexHencky
MoFEMErrorCode integratePolyconvexHencky(EntData &data)
Definition: HMHHencky.cpp:401
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
eps
static const double eps
Definition: check_base_functions_derivatives_on_tet.cpp:11
FTensor::Ddg< double, 3, 3 >
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
mu
double mu
Definition: dynamic_first_order_con_law.cpp:97
lambda
static double lambda
Definition: incompressible_elasticity.cpp:199
EshelbianPlasticity::HMHHencky::returnOpSpatialPhysical_du_du
VolUserDataOperator * returnOpSpatialPhysical_du_du(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha)
Definition: HMHHencky.cpp:117
EshelbianPlasticity::HMHHencky::OpSpatialPhysical::alphaU
const double alphaU
Definition: HMHHencky.cpp:90
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
EshelbianPlasticity::HMHHencky::returnOpJacobian
virtual OpJacobian * 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:70
EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du::dP
MatrixDouble dP
Definition: HMHHencky.cpp:114
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress::strainPtr
boost::shared_ptr< MatrixDouble > strainPtr
Definition: HMHHencky.cpp:164
FTensor::Kronecker_Delta_symmetric
Kronecker Delta class symmetric.
Definition: Kronecker_Delta.hpp:49
third
constexpr double third
Definition: EshelbianADOL-C.cpp:17
EshelbianPlasticity::HMHHencky::OpSpatialPhysical::polyConvex
PetscBool polyConvex
Definition: HMHHencky.cpp:91
EshelbianPlasticity::HMHHencky::BlockData::blockEnts
Range blockEnts
Definition: HMHHencky.cpp:314
EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du::OpSpatialPhysical_du_du
OpSpatialPhysical_du_du(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha)
Definition: HMHHencky.cpp:486
EshelbianPlasticity::MODERATE_ROT
@ MODERATE_ROT
Definition: EshelbianPlasticity.hpp:45
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
EshelbianPlasticity::HMHHencky::OpCalculateEnergy::OpCalculateEnergy
OpCalculateEnergy(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
Definition: HMHHencky.cpp:815
MoFEM::DataOperator::sYmm
bool sYmm
If true assume that matrix is symmetric structure.
Definition: DataOperators.hpp:82
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du
Definition: HMHHencky.cpp:101
CHKERRG
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:496
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du::integrate
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
Definition: HMHHencky.cpp:499
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress::OpCalculateStretchFromStress
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)
Definition: HMHHencky.cpp:861
EshelbianPlasticity::HMHHencky::OpHenckyJacobian::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Definition: HMHHencky.cpp:29
EigenMatrix::getDiffDiffMat
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.
Definition: MatrixFunction.hpp:279
EshelbianCore::d_f
static boost::function< double(const double)> d_f
Definition: EshelbianCore.hpp:33
MoFEM::PetscOptionsGetBool
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:182
OpAssembleVolume
Definition: EshelbianOperators.hpp:151