v0.14.0
ADOLCPlasticity.cpp
Go to the documentation of this file.
1 /**
2  * \file ADOLCPlasticity.cpp
3  * \ingroup adoc_plasticity
4  * \brief Operators and data structures for ADOL-C plasticity
5  *
6  */
7 
8 #include <MoFEM.hpp>
9 using namespace MoFEM;
10 
11 #include <ADOLCPlasticity.hpp>
12 
13 namespace ADOLCPlasticity {
14 
16 
17 template <typename T1, typename T2, int DIM1, int DIM2>
18 double calcAveStrain(bool b_bar, const int nb_gauss_pts,
20  FTensor::Tensor0<T2> &&t_w) {
21  if constexpr (DIM1 != DIM2)
23  "Case of mixed dimension by gradient not implemented");
24 
25 
27  double ave_tr_strain = 0;
28  if (b_bar) {
29  double v = 0;
30  for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
31  v += t_w;
32  ave_tr_strain += t_w * t_grad(i, i);
33  ++t_grad;
34  ++t_w;
35  }
36  ave_tr_strain /= (DIM1 * v);
37  }
38  return ave_tr_strain;
39 }
40 
41 template <typename T1, typename T2, int DIM1, int DIM2, int DIM3>
43 calcStrain(bool b_bar, double ave_tr_strain,
45  FTensor::Tensor1<T2, DIM3> &&t_voight_strain) {
46 
47  if constexpr (DIM1 != DIM2)
49  "Case of mixed dimessnion by gradient not implemented");
50 
54  FTensor::Tensor2_symmetric<double, 3> t_strain{0., 0., 0., 0., 0., 0.};
55  t_strain(i, j) = (t_grad(i, j) || t_grad(j, i)) / 2;
56  double tr_strain = t_grad(i, i) / DIM1;
57  if (b_bar) {
61  t_strain(i, j) += (ave_tr_strain - tr_strain) * t_kd(i, j);
62  }
63  {
66  t_voight_strain(Z) = tStrainToVoightOp(i, j, Z) * t_strain(i, j);
67  }
68  return t_voight_strain;
69 };
70 
71 //! [BBar method]
72 /**
73  * @brief Calculate base for B-bar method
74  *
75  * @tparam DIM Dimension of problem
76  * @param data access to base functions
77  * @param storage storage for base functions at integration points
78  * @param b_bar flag to sith on B-bar method
79  * @param nb_integration_pts number of integration points
80  * @param w_ptr integration weights
81  * @return FTensor::Tensor2_symmetric<FTensor::PackPtr<double *, 6>, 3>
82  */
83 template <int DIM>
86  MatrixDouble &storage, const bool b_bar,
87  const int nb_integration_pts, double *w_ptr,
89  const auto nb_dofs = data.getFieldData().size();
90  const auto nb_bases = data.getN().size2();
91 
92  storage.resize(nb_integration_pts, 6 * nb_dofs, false);
93 
101 
102  // get tensorial base
103  auto get_ftensor2_symmetric = [&](const int gg, const int rr) {
104  return getFTensor2SymmetricFromPtr<3>(&storage(gg, 6 * rr));
105  };
106 
107  // calculate base
108  auto calc_base = [&]() {
109  auto t_t2_diff = get_ftensor2_symmetric(0, 0);
110  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
111  auto t_diff = data.getFTensor1DiffN<DIM>(gg, 0);
112  for (auto b = 0; b != nb_dofs / DIM; ++b) {
114 
115  t_grad(i, j) = 0;
116 
117  t_grad(N0, J) = t_diff(J);
118  t_t2_diff(i, j) = (t_grad(i, j) || t_grad(j, i)) / 2;
119  ++t_t2_diff;
120 
121  t_grad(i, j) = 0;
122  t_grad(N1, J) = t_diff(J);
123  t_t2_diff(i, j) = (t_grad(i, j) || t_grad(j, i)) / 2;
124  ++t_t2_diff;
125 
126  t_grad(i, j) = 0;
127  if constexpr (DIM == 3) {
128  t_grad(N2, J) = t_diff(J);
129  t_t2_diff(i, j) = (t_grad(i, j) || t_grad(j, i)) / 2;
130  ++t_t2_diff;
131  }
132 
133  ++t_diff;
134  }
135  }
136  return get_ftensor2_symmetric(0, 0);
137  };
138 
139  // calculate volume average of trace
140  auto calc_vol = [&](auto &&t_t2_dff) {
141  std::vector<double> vol(nb_dofs, 0);
142  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
143  for (auto b = 0; b != nb_dofs; ++b) {
144  vol[b] += w_ptr[gg] * t_t2_dff(i, i) / DIM;
145  ++t_t2_dff;
146  }
147  }
148  double sum = 0;
149  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
150  sum += w_ptr[gg];
151  }
152  for (auto &v : vol) {
153  v /= sum;
154  }
155  return vol;
156  };
157 
158  // modify base for B-bar method
159  auto make_b_bar = [&](auto &&vol) {
160  auto t_t2_diff = get_ftensor2_symmetric(0, 0);
162  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
163  for (auto b = 0; b != nb_dofs; ++b) {
164  const auto trace = t_t2_diff(J, J) / DIM;
165  t_t2_diff(I, J) += (vol[b] - trace) * t_kd(I, J);
166  ++t_t2_diff;
167  }
168  }
169  return get_ftensor2_symmetric(0, 0);
170  };
171 
172  return b_bar ? make_b_bar(calc_vol(calc_base())) : calc_base();
173 };
174 //! [BBar method]
175 
177 MakeB::getFTensor2SymmetricDiffBase(DataForcesAndSourcesCore::EntData &data,
178  MatrixDouble &storage, const bool b_bar,
179  const int nb_integration_pts, double *w_ptr,
182  data, storage, b_bar, nb_integration_pts, w_ptr, FTensor::Number<3>());
183 }
184 
186 MakeB::getFTensor2SymmetricDiffBase(DataForcesAndSourcesCore::EntData &data,
187  MatrixDouble &storage, const bool b_bar,
188  const int nb_integration_pts, double *w_ptr,
191  data, storage, b_bar, nb_integration_pts, w_ptr, FTensor::Number<2>());
192 }
193 
195 
196  OpUpdate(boost::shared_ptr<CommonData> common_data_ptr);
197 
198  MoFEMErrorCode doWork(int side, EntityType type,
200 
201 protected:
202  boost::shared_ptr<CommonData> commonDataPtr;
203 };
204 
205 OpUpdate::OpUpdate(boost::shared_ptr<CommonData> common_data_ptr)
207  UserDataOperator::OPSPACE),
208  commonDataPtr(common_data_ptr) {}
209 
210 MoFEMErrorCode OpUpdate::doWork(int side, EntityType type,
213 
214  int nb_gauss_pts = getGaussPts().size2();
215 
216  for (int gg = 0; gg < nb_gauss_pts; gg++) {
217  if (commonDataPtr->deltaGamma[gg] > 0) {
218  auto cp_plastic_strain = commonDataPtr->getPlasticStrain(gg);
219  auto cp_internal_variables = commonDataPtr->getInternalVariables(gg);
220  const auto nb_internal_variables = cp_internal_variables.size();
221  auto plastic_strain =
222  getVectorAdaptor(&commonDataPtr->plasticStrainPtr[gg * 6], 6);
223  auto internal_variables = getVectorAdaptor(
224  &commonDataPtr->internalVariablesPtr[gg * nb_internal_variables],
225  nb_internal_variables);
226  plastic_strain = cp_plastic_strain;
227  internal_variables = cp_internal_variables;
228  }
229  }
230 
232 }
233 
234 template <int DIM>
236 
238  boost::shared_ptr<CommonData> common_data_ptr,
239  boost::shared_ptr<ClosestPointProjection> cp_ptr,
240  bool calc_lhs);
241 
242  MoFEMErrorCode doWork(int side, EntityType type,
244 
245 protected:
247  boost::shared_ptr<CommonData> commonDataPtr;
248  boost::shared_ptr<ClosestPointProjection> cpPtr;
249  bool calcLhs;
250 
253 
255 
256  MoFEMErrorCode setTagsData(const EntityHandle tet, const int nb_gauss_pts,
257  const int nb_internal_variables);
258 };
259 
260 template <int DIM>
262  MoFEM::Interface &m_field, boost::shared_ptr<CommonData> common_data_ptr,
263  boost::shared_ptr<ClosestPointProjection> cp_ptr, bool calc_lhs)
265  NOSPACE, UserDataOperator::OPSPACE),
266  mField(m_field), commonDataPtr(common_data_ptr), cpPtr(cp_ptr),
267  calcLhs(calc_lhs) {
268 
269  CHK_THROW_MESSAGE(getTags(), "get tags");
270 }
271 
274  int def_length = 0;
275  CHKERR mField.get_moab().tag_get_handle(
276  "PLASTIC_STRAIN", def_length, MB_TYPE_DOUBLE, thPlasticStrain,
277  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
278  CHKERR mField.get_moab().tag_get_handle(
279  "INTERNAL_VARIABLES", def_length, MB_TYPE_DOUBLE, thInternalVariables,
280  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
282 }
283 
284 template <int DIM>
287  const int nb_gauss_pts,
288  const int nb_internal_variables) {
290 
291  VectorDouble v;
292  {
293  rval = mField.get_moab().tag_get_by_ptr(
294  thPlasticStrain, &tet, 1,
295  (const void **)&commonDataPtr->plasticStrainPtr,
296  &commonDataPtr->plasticStrainSize);
297  if (rval != MB_SUCCESS ||
298  commonDataPtr->plasticStrainSize != 6 * nb_gauss_pts) {
299  v.resize(6 * nb_gauss_pts, false);
300  v.clear();
301  int tag_size[1];
302  tag_size[0] = v.size();
303  void const *tag_data[] = {&v[0]};
304  CHKERR mField.get_moab().tag_set_by_ptr(thPlasticStrain, &tet, 1,
305  tag_data, tag_size);
306  CHKERR mField.get_moab().tag_get_by_ptr(
307  thPlasticStrain, &tet, 1,
308  (const void **)&commonDataPtr->plasticStrainPtr,
309  &commonDataPtr->plasticStrainSize);
310  }
311  }
312  if (nb_internal_variables > 0) {
313  rval = mField.get_moab().tag_get_by_ptr(
314  thInternalVariables, &tet, 1,
315  (const void **)&commonDataPtr->internalVariablesPtr,
316  &commonDataPtr->internalVariablesSize);
317  if (rval != MB_SUCCESS || commonDataPtr->internalVariablesSize !=
318  nb_internal_variables * nb_gauss_pts) {
319  v.resize(nb_internal_variables * nb_gauss_pts, false);
320  v.clear();
321  int tag_size[1];
322  tag_size[0] = v.size();
323  void const *tag_data[] = {&v[0]};
324  CHKERR mField.get_moab().tag_set_by_ptr(thInternalVariables, &tet, 1,
325  tag_data, tag_size);
326  CHKERR mField.get_moab().tag_get_by_ptr(
327  thInternalVariables, &tet, 1,
328  (const void **)&commonDataPtr->internalVariablesPtr,
329  &commonDataPtr->internalVariablesSize);
330  }
331  }
333 }
334 
335 template <int DIM>
340 
341  int nb_gauss_pts = getGaussPts().size2();
342 
343  int nb_internal_variables = cpPtr->nbInternalVariables;
344  auto tet = getNumeredEntFiniteElementPtr()->getEnt();
345  CHKERR setTagsData(tet, nb_gauss_pts, nb_internal_variables);
346 
347  commonDataPtr->activeVariablesW.resize(
348  nb_gauss_pts, 12 + cpPtr->nbInternalVariables, false);
349  commonDataPtr->gradientW.resize(nb_gauss_pts, 12 + cpPtr->nbInternalVariables,
350  false);
351  commonDataPtr->materialTangentOperator.resize(36, nb_gauss_pts, false);
352  commonDataPtr->deltaGamma.resize(nb_gauss_pts);
353 
360 
361  // Code use trail stress, until first solve of linear system of equations
362  int iter = 1;
363  if (getFEMethod()->snes_ctx != SnesMethod::CTX_SNESNONE) {
364  CHKERR SNESGetLinearSolveIterations(getFEMethod()->snes, &iter);
365  }
366 
367  // b-bar
368  double ave_tr_strain = calcAveStrain(
369  commonDataPtr->bBar, nb_gauss_pts,
370  getFTensor2FromMat<DIM, DIM>(commonDataPtr->gradAtGaussPts),
371  getFTensor0IntegrationWeight());
372 
373  auto t_voight_stress_op = voight_to_stress_op();
374  auto t_grad = getFTensor2FromMat<DIM, DIM>(commonDataPtr->gradAtGaussPts);
375 
376  auto t_Cep =
377  getFTensor4DdgFromMat<3, 3, 1>(commonDataPtr->materialTangentOperator);
378  for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
379 
380  auto tmp_active =
381  getVectorAdaptor(&(commonDataPtr->activeVariablesW(gg, 0)),
382  12 + cpPtr->nbInternalVariables);
383  cpPtr->activeVariablesW.swap(tmp_active);
384  auto tmp_gradient = getVectorAdaptor(&(commonDataPtr->gradientW(gg, 0)),
385  12 + cpPtr->nbInternalVariables);
386  cpPtr->gradientW.swap(tmp_gradient);
387 
388  auto t_voigt_strain =
389  calcStrain(commonDataPtr->bBar, ave_tr_strain, t_grad,
390  getFTensor1FromPtr<6>(&(cpPtr->activeVariablesW[6])));
391  ++t_grad;
392 
393  // Copy plastic strains and internal variables from tags
394  auto copy_plastic_strain_and_internal_variables = [&]() {
396 
397  // Get data stored on Tags
398  VectorAdaptor plastic_strain_tags =
399  VectorAdaptor(6, ublas::shallow_array_adaptor<double>(
400  6, &commonDataPtr->plasticStrainPtr[gg * 6]));
401  VectorAdaptor internal_variables_tags = VectorAdaptor(
402  nb_internal_variables,
403  ublas::shallow_array_adaptor<double>(
404  nb_internal_variables,
405  &commonDataPtr
406  ->internalVariablesPtr[gg * nb_internal_variables]));
407 
408  // Set values to closest point projection
409  cpPtr->plasticStrain0.resize(6, false);
410  noalias(cpPtr->plasticStrain0) = plastic_strain_tags;
411  cpPtr->internalVariables0.resize(nb_internal_variables, false);
412  noalias(cpPtr->internalVariables0) = internal_variables_tags;
413 
414  auto cp_plastic_strain = cpPtr->getPlasticStrain();
415  auto cp_internal_variables = cpPtr->getInternalVariables();
416  noalias(cp_plastic_strain) = plastic_strain_tags;
417  noalias(cp_internal_variables) = internal_variables_tags;
419  };
420 
421  CHKERR copy_plastic_strain_and_internal_variables();
422 
423  auto closest_point_projection = [&](auto &recalculate_elastic_tangent) {
427  CHKERR cpPtr->setParams(t, recalculate_elastic_tangent);
428  }
429  CHKERR cpPtr->playW_NoHessian();
430  CHKERR cpPtr->playY_NoGradient();
431  double y = cpPtr->y;
432  cpPtr->deltaGamma = 0; // zero lagrange multiplier
433  if (iter > 0 && y > std::numeric_limits<double>::epsilon()) {
434  CHKERR cpPtr->solveClosetProjection();
435  }
436  commonDataPtr->deltaGamma[gg] = cpPtr->deltaGamma;
438  };
439 
440  auto evaluate_consistent_tangent_matrix =
441  [&](auto &recalculate_elastic_tangent) {
443  if (recalculate_elastic_tangent)
444  CHKERR cpPtr->playW();
445 
446  if (iter > 0 &&
447  cpPtr->deltaGamma > std::numeric_limits<double>::epsilon()) {
448 
449  CHKERR cpPtr->consistentTangent();
450 
451  auto &m = cpPtr->Cep;
452  // for generic case of non-associated plasticity consistent tangent
453  // matrix is non-symmetric
454  auto t_voight_cep =
456  &m(0, 0), &m(0, 1), &m(0, 2), &m(0, 3), &m(0, 4), &m(0, 5),
457 
458  &m(1, 0), &m(1, 1), &m(1, 2), &m(1, 3), &m(1, 4), &m(1, 5),
459 
460  &m(2, 0), &m(2, 1), &m(2, 2), &m(2, 3), &m(2, 4), &m(2, 5),
461 
462  &m(3, 0), &m(3, 1), &m(3, 2), &m(3, 3), &m(3, 4), &m(3, 5),
463 
464  &m(4, 0), &m(4, 1), &m(4, 2), &m(4, 3), &m(4, 4), &m(4, 5),
465 
466  &m(5, 0), &m(5, 1), &m(5, 2), &m(5, 3), &m(5, 4), &m(5, 5)
467 
468  );
469 
470  t_Cep(i, j, k, l) =
471  t_voight_stress_op(i, j, Z) *
472  (t_voight_cep(Z, Y) * t_voight_stress_op(k, l, Y));
473 
474  } else {
475 
476  auto &m = cpPtr->C;
477  auto t_voight_cep =
479  &m(0, 0), &m(0, 1), &m(0, 2), &m(0, 3), &m(0, 4), &m(0, 5),
480 
481  &m(1, 1), &m(1, 2), &m(1, 3), &m(1, 4), &m(1, 5),
482 
483  &m(2, 2), &m(2, 3), &m(2, 4), &m(2, 5),
484 
485  &m(3, 3), &m(3, 4), &m(3, 5),
486 
487  &m(4, 4), &m(4, 5),
488 
489  &m(5, 5));
490 
491  t_Cep(i, j, k, l) =
492  t_voight_stress_op(i, j, Z) *
493  (t_voight_cep(Z, Y) * t_voight_stress_op(k, l, Y));
494  }
495 
496  ++t_Cep;
498  };
499 
500  // Always recalculate elastic tangent if first element
501  bool recalculate_elastic_tangent = (getNinTheLoop() == 0) ? true : false;
502  CHKERR closest_point_projection(recalculate_elastic_tangent);
503  if (calcLhs)
504  CHKERR evaluate_consistent_tangent_matrix(recalculate_elastic_tangent);
505  }
506 
507  auto calcs_stress_matrix = [&]() {
509  auto t_voight_stress_op = voight_to_stress_op();
510  commonDataPtr->stressMatrix.resize(6, commonDataPtr->gradientW.size1(),
511  false);
512  auto t_stess = getFTensor2SymmetricFromMat<3>(commonDataPtr->stressMatrix);
513  auto t_voight_stress = commonDataPtr->getFTensor1StressAtGaussPts();
514  for (auto gg = 0; gg != commonDataPtr->gradientW.size1(); ++gg) {
515  t_stess(i, j) = t_voight_stress_op(i, j, Z) * t_voight_stress(Z);
516  ++t_voight_stress;
517  ++t_stess;
518  }
520  };
521 
522  auto calcs_plastic_strain_matrix = [&]() {
524  auto t_voight_strain_op = voight_to_stress_op();
525  commonDataPtr->plasticStrainMatrix.resize(
526  6, commonDataPtr->activeVariablesW.size1(), false);
527  auto t_plastic_strain =
528  getFTensor2SymmetricFromMat<3>(commonDataPtr->plasticStrainMatrix);
529  auto t_voight_plastic_strain =
530  commonDataPtr->getFTensor1PlasticStrainAtGaussPts();
531  for (auto gg = 0; gg != commonDataPtr->activeVariablesW.size1(); ++gg) {
532  t_plastic_strain(i, j) =
533  t_voight_strain_op(i, j, Z) * t_voight_plastic_strain(Z);
534  ++t_voight_plastic_strain;
535  ++t_plastic_strain;
536  }
538  };
539 
540  CHKERR calcs_stress_matrix();
541  CHKERR calcs_plastic_strain_matrix();
542 
544 }
545 
546 template <>
548  MoFEM::Interface &m_field, boost::shared_ptr<CommonData> common_data_ptr,
549  boost::shared_ptr<ClosestPointProjection> cp_ptr, bool calc_lhs) {
550  return new OpCalculateStress<3>(m_field, common_data_ptr, cp_ptr, calc_lhs);
551 }
552 
553 template <>
555  MoFEM::Interface &m_field, boost::shared_ptr<CommonData> common_data_ptr,
556  boost::shared_ptr<ClosestPointProjection> cp_ptr, bool calc_lhs) {
557  return new OpCalculateStress<2>(m_field, common_data_ptr, cp_ptr, calc_lhs);
558 }
559 
560 template <int DIM>
563  std::string block_name,
564  boost::shared_ptr<CommonData> common_data_ptr,
565  boost::shared_ptr<ClosestPointProjection> cp_ptr) {
567  CHKERR cp_ptr->addMatBlockOps(m_field, pip, block_name, Sev::noisy);
568  pip.push_back(
569  getRawPtrOpCalculateStress<DIM>(m_field, common_data_ptr, cp_ptr, false));
570  pip.push_back(new OpUpdate(common_data_ptr));
572 };
573 
574 template <>
577  std::string block_name,
578  boost::shared_ptr<CommonData> common_data_ptr,
579  boost::shared_ptr<ClosestPointProjection> cp_ptr) {
580  return opFactoryDomainUpdateImpl<3>(m_field, pip, block_name, common_data_ptr,
581  cp_ptr);
582 };
583 
584 template <>
587  std::string block_name,
588  boost::shared_ptr<CommonData> common_data_ptr,
589  boost::shared_ptr<ClosestPointProjection> cp_ptr) {
590  return opFactoryDomainUpdateImpl<2>(m_field, pip, block_name, common_data_ptr,
591  cp_ptr);
592 };
593 
594 
595 //! [TSUpdateImpl]
596 /**
597  * @brief TS update history variables
598  */
599 struct TSUpdateImpl : public TSUpdate {
600 
601  TSUpdateImpl(std::string fe_name, boost::shared_ptr<FEMethod> fe_ptr);
603 
604 private:
605  boost::shared_ptr<FEMethod> fePtr;
606  const std::string feName;
607 };
608 
609 TSUpdateImpl::TSUpdateImpl(std::string fe_name,
610  boost::shared_ptr<FEMethod> fe_ptr)
611  : feName(fe_name), fePtr(fe_ptr) {}
612 
615  DM dm;
616  CHKERR TSGetDM(ts, &dm);
617  // This is where update is preformed. Element list is iterated and on each
618  // element pipeline accessed throng fePtr is executed.
621 }
622 
623 /**
624  * @brief Create test update object
625  *
626  * @param fe_name
627  * @param fe_ptr
628  * @return boost::shared_ptr<TSUpdate>
629  */
630 boost::shared_ptr<TSUpdate> createTSUpdate(std::string fe_name,
631  boost::shared_ptr<FEMethod> fe_ptr) {
632  return boost::make_shared<TSUpdateImpl>(fe_name, fe_ptr);
633 }
634 //! [TSUpdateImpl]
635 
636 } // namespace ADOLCPlasticity
NOSPACE
@ NOSPACE
Definition: definitions.h:83
ADOLCPlasticity::OpCalculateStress
Definition: ADOLCPlasticity.cpp:235
ADOLCPlasticity::OpCalculateStress::doWork
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: ADOLCPlasticity.cpp:337
ADOLCPlasticity::TSUpdateImpl::fePtr
boost::shared_ptr< FEMethod > fePtr
Definition: ADOLCPlasticity.cpp:605
ADOLCPlasticity::getFTensor2SymmetricDiffBaseImpl
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 6 >, 3 > getFTensor2SymmetricDiffBaseImpl(DataForcesAndSourcesCore::EntData &data, MatrixDouble &storage, const bool b_bar, const int nb_integration_pts, double *w_ptr, FTensor::Number< DIM >)
[BBar method]
Definition: ADOLCPlasticity.cpp:85
ADOLCPlasticity::getRawPtrOpCalculateStress< 3 >
ForcesAndSourcesCore::UserDataOperator * getRawPtrOpCalculateStress< 3 >(MoFEM::Interface &m_field, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr, bool calc_lhs)
Definition: ADOLCPlasticity.cpp:547
ADOLCPlasticity::Pip
boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > Pip
Definition: ADOLCPlasticity.hpp:399
ADOLCPlasticity::TSUpdateImpl::TSUpdateImpl
TSUpdateImpl(std::string fe_name, boost::shared_ptr< FEMethod > fe_ptr)
Definition: ADOLCPlasticity.cpp:609
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
EntityHandle
ADOLCPlasticity::createTSUpdate
boost::shared_ptr< TSUpdate > createTSUpdate(std::string fe_name, boost::shared_ptr< FEMethod > fe_ptr)
ADOLCPlasticity::TSUpdate
Update internal fluxes (update history variables)
Definition: ADOLCPlasticity.hpp:508
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:609
ADOLCPlasticity::strain_to_voight_op
FTensor::Dg< double, 3, 6 > strain_to_voight_op()
Op convert strain tensor to Vight strain vector.
Definition: ADOLCPlasticity.hpp:39
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
ADOLCPlasticity::TSUpdateImpl
[TSUpdateImpl]
Definition: ADOLCPlasticity.cpp:599
ADOLCPlasticity::OpUpdate::commonDataPtr
boost::shared_ptr< CommonData > commonDataPtr
Definition: ADOLCPlasticity.cpp:202
MoFEM.hpp
ADOLCPlasticity::OpCalculateStress::setTagsData
MoFEMErrorCode setTagsData(const EntityHandle tet, const int nb_gauss_pts, const int nb_internal_variables)
Definition: ADOLCPlasticity.cpp:286
J
FTensor::Index< 'J', DIM1 > J
Definition: level_set.cpp:30
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
ADOLCPlasticity::OpCalculateStress::OpCalculateStress
OpCalculateStress(MoFEM::Interface &m_field, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr, bool calc_lhs)
Definition: ADOLCPlasticity.cpp:261
MoFEM::getFTensor2SymmetricFromPtr< 3 >
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 6 >, 3 > getFTensor2SymmetricFromPtr< 3 >(double *ptr)
Definition: Templates.hpp:1005
ADOLCPlasticity::OpCalculateStress::mField
MoFEM::Interface & mField
Definition: ADOLCPlasticity.cpp:246
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
I
constexpr IntegrationType I
Definition: operators_tests.cpp:31
MoFEM::ForcesAndSourcesCore::UserDataOperator::getGaussPts
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
Definition: ForcesAndSourcesCore.hpp:1236
ADOLCPlasticity::calcAveStrain
double calcAveStrain(bool b_bar, const int nb_gauss_pts, FTensor::Tensor2< T1, DIM1, DIM2 > &&t_grad, FTensor::Tensor0< T2 > &&t_w)
Definition: ADOLCPlasticity.cpp:18
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
ADOLCPlasticity::OpCalculateStress::thInternalVariables
Tag thInternalVariables
Definition: ADOLCPlasticity.cpp:252
FTensor::Number
Definition: Number.hpp:11
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
ADOLCPlasticity::ClosestPointProjection::H
@ H
Definition: ADOLCPlasticity.hpp:168
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::getVectorAdaptor
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition: Templates.hpp:31
MoFEM::ForcesAndSourcesCore::UserDataOperator
Definition: ForcesAndSourcesCore.hpp:549
ADOLCPlasticity::OpCalculateStress::commonDataPtr
boost::shared_ptr< CommonData > commonDataPtr
Definition: ADOLCPlasticity.cpp:247
ADOLCPlasticity::OpUpdate
Definition: ADOLCPlasticity.cpp:194
DIM1
constexpr int DIM1
Definition: level_set.cpp:21
ADOLCPlasticity::tStrainToVoightOp
static FTensor::Dg< double, 3, 6 > tStrainToVoightOp
Definition: ADOLCPlasticity.cpp:15
convert.type
type
Definition: convert.py:64
ADOLCPlasticity::OpUpdate::doWork
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: ADOLCPlasticity.cpp:210
ADOLCPlasticity::OpCalculateStress::calcLhs
bool calcLhs
Definition: ADOLCPlasticity.cpp:249
ADOLCPlasticity::TSUpdateImpl::postProcess
MoFEMErrorCode postProcess(TS ts)
Definition: ADOLCPlasticity.cpp:613
ADOLCPlasticity::OpCalculateStress::getTags
MoFEMErrorCode getTags()
Definition: ADOLCPlasticity.cpp:272
ADOLCPlasticity::TSUpdateImpl::feName
const std::string feName
Definition: ADOLCPlasticity.cpp:606
t
constexpr double t
plate stiffness
Definition: plate.cpp:59
ADOLCPlasticity
Definition: ADOLCPlasticity.hpp:24
MoFEM::Types::VectorAdaptor
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:115
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
EntData
EntitiesFieldData::EntData EntData
Definition: child_and_parent.cpp:37
FTensor::Index
Definition: Index.hpp:23
ADOLCPlasticity::OpCalculateStress::cpPtr
boost::shared_ptr< ClosestPointProjection > cpPtr
Definition: ADOLCPlasticity.cpp:248
MoFEM::ForcesAndSourcesCore
structure to get information form mofem into EntitiesFieldData
Definition: ForcesAndSourcesCore.hpp:22
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
ADOLCPlasticity::opFactoryDomainUpdate< 2 >
MoFEMErrorCode opFactoryDomainUpdate< 2 >(MoFEM::Interface &m_field, Pip &pip, std::string block_name, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr)
Push operators to update history variables.
Definition: ADOLCPlasticity.cpp:586
FTensor::Dg
Definition: Dg_value.hpp:9
FTensor::Tensor0
Definition: Tensor0.hpp:16
ADOLCPlasticity.hpp
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
ADOLCPlasticity::voight_to_stress_op
FTensor::Dg< double, 3, 6 > voight_to_stress_op()
Op convert Vight stress vector to stress tensor.
Definition: ADOLCPlasticity.hpp:49
ADOLCPlasticity::calcStrain
FTensor::Tensor1< T2, DIM3 > calcStrain(bool b_bar, double ave_tr_strain, FTensor::Tensor2< T1, DIM1, DIM2 > &t_grad, FTensor::Tensor1< T2, DIM3 > &&t_voight_strain)
Definition: ADOLCPlasticity.cpp:43
DIM2
constexpr int DIM2
Definition: level_set.cpp:22
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
PlasticOps::trace
double trace(FTensor::Tensor2_symmetric< T, 2 > &t_stress)
Definition: PlasticOpsGeneric.hpp:80
FTensor::Kronecker_Delta_symmetric
Kronecker Delta class symmetric.
Definition: Kronecker_Delta.hpp:49
ADOLCPlasticity::getRawPtrOpCalculateStress< 2 >
ForcesAndSourcesCore::UserDataOperator * getRawPtrOpCalculateStress< 2 >(MoFEM::Interface &m_field, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr, bool calc_lhs)
Definition: ADOLCPlasticity.cpp:554
ADOLCPlasticity::opFactoryDomainUpdate< 3 >
MoFEMErrorCode opFactoryDomainUpdate< 3 >(MoFEM::Interface &m_field, Pip &pip, std::string block_name, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr)
Push operators to update history variables.
Definition: ADOLCPlasticity.cpp:576
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEM::DMoFEMLoopFiniteElements
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
Definition: DMMoFEM.cpp:586
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
ADOLCPlasticity::OpCalculateStress::thPlasticStrain
Tag thPlasticStrain
Definition: ADOLCPlasticity.cpp:251
ADOLCPlasticity::ClosestPointProjection::Y
@ Y
Definition: ADOLCPlasticity.hpp:168
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
ADOLCPlasticity::opFactoryDomainUpdateImpl
MoFEMErrorCode opFactoryDomainUpdateImpl(MoFEM::Interface &m_field, Pip &pip, std::string block_name, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr)
Definition: ADOLCPlasticity.cpp:562
ADOLCPlasticity::ClosestPointProjection::W
@ W
Definition: ADOLCPlasticity.hpp:168