v0.15.0
Loading...
Searching...
No Matches
PlasticOps.hpp
Go to the documentation of this file.
1
2
3/** \file PlasticOps.hpp
4 * \example PlasticOps.hpp
5
6\f[
7\left\{
8\begin{array}{ll}
9\frac{\partial \sigma_{ij}}{\partial x_j} - b_i = 0 & \forall x \in \Omega \\
10\varepsilon_{ij} = \frac{1}{2}\left( \frac{\partial u_i}{\partial x_j} +
11\frac{\partial u_j}{\partial x_i} \right)\\
12\sigma_{ij} = D_{ijkl}\left(\varepsilon_{kl}-\varepsilon^p_{kl}\right) \\
13\dot{\varepsilon}^p_{kl} - \dot{\tau} \left( \left. \frac{\partial f}{\partial
14\sigma_{kl}} \right|_{(\sigma,\tau) } \right) = 0 \\
15f(\sigma, \tau) \leq 0,\; \dot{\tau} \geq 0,\;\dot{\tau}f(\sigma, \tau)=0\\
16u_i = \overline{u}_i & \forall x \in \partial\Omega_u \\
17\sigma_{ij}n_j = \overline{t}_i & \forall x \in \partial\Omega_\sigma \\
18\Omega_u \cup \Omega_\sigma = \Omega \\
19\Omega_u \cap \Omega_\sigma = \emptyset
20\end{array}
21\right.
22\f]
23
24\f[
25\left\{
26\begin{array}{ll}
27\left(\frac{\partial \delta u_i}{\partial x_j},\sigma_{ij}\right)_\Omega-(\delta
28u_i,b_i)_\Omega -(\delta u_i,\overline{t}_i)_{\partial\Omega_\sigma}=0 & \forall
29\delta u_i \in H^1(\Omega)\\ \left(\delta\varepsilon^p_{kl} ,D_{ijkl}\left(
30\dot{\varepsilon}^p_{kl} - \dot{\tau} A_{kl} \right)\right) = 0
31& \forall \delta\varepsilon^p_{ij} \in L^2(\Omega) \cap \mathcal{S} \\
32\left(\delta\tau,c_n\dot{\tau} - \frac{1}{2}\left\{c_n \dot{\tau} +
33(f(\pmb\sigma,\tau) - \sigma_y) +
34\| c_n \dot{\tau} + (f(\pmb\sigma,\tau) - \sigma_y) \|\right\}\right) = 0 &
35\forall \delta\tau \in L^2(\Omega) \end{array} \right.
36\f]
37
38*/
39
40namespace PlasticOps {
41
42//! [Common data]
43struct CommonData : public boost::enable_shared_from_this<CommonData> {
44
56
57 using BlockParams = std::array<double, LAST_PARAM>;
59
60 inline auto getParamsPtr() {
61 return boost::shared_ptr<BlockParams>(shared_from_this(), &blockParams);
62 };
63
64 //! [Common data set externally]
65 boost::shared_ptr<MatrixDouble> mDPtr;
66 boost::shared_ptr<MatrixDouble> mGradPtr;
67 boost::shared_ptr<MatrixDouble> mStrainPtr;
68 boost::shared_ptr<MatrixDouble> mStressPtr;
69 //! [Common data set externally]
70
71 VectorDouble plasticIsoHardening;
72 MatrixDouble plasticKinHardening;
73 VectorDouble plasticSurface;
74 MatrixDouble plasticFlow;
75 VectorDouble plasticTau;
76 VectorDouble plasticTauDot;
77 MatrixDouble plasticStrain;
78 MatrixDouble plasticStrainDot;
80 VectorDouble resC;
81 VectorDouble resCdTau;
82 MatrixDouble resCdStrain;
83 MatrixDouble resCdPlasticStrain;
84 MatrixDouble resFlow;
85 MatrixDouble resFlowDtau;
86 MatrixDouble resFlowDstrain;
87 MatrixDouble resFlowDstrainDot;
88
90 return boost::shared_ptr<VectorDouble>(shared_from_this(),
92 }
94 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
96 }
97 inline auto getPlasticSurfacePtr() {
98 return boost::shared_ptr<VectorDouble>(shared_from_this(), &plasticSurface);
99 }
100 inline auto getPlasticTauPtr() {
101 return boost::shared_ptr<VectorDouble>(shared_from_this(), &plasticTau);
102 }
103 inline auto getPlasticTauDotPtr() {
104 return boost::shared_ptr<VectorDouble>(shared_from_this(), &plasticTauDot);
105 }
106 inline auto getPlasticStrainPtr() {
107 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &plasticStrain);
108 }
110 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
112 }
113 inline auto getPlasticFlowPtr() {
114 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &plasticFlow);
117 static std::array<int, 5> activityData;
119
120std::array<int, 5> CommonData::activityData = {0, 0, 0, 0, 0};
122//! [Common data]
123
125FTensor::Index<'J', 3> J;
126FTensor::Index<'M', 3> M;
128
129template <int DIM, IntegrationType I, typename DomainEleOp>
131
132template <int DIM, IntegrationType I, typename DomainEleOp>
134
135template <int DIM, IntegrationType I, typename DomainEleOp>
137
138template <int DIM, IntegrationType I, typename DomainEleOp>
140
141template <int DIM, IntegrationType I, typename DomainEleOp>
143
144template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
146
147template <IntegrationType I, typename AssemblyDomainEleOp>
149
150template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
152
153template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
155
156template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
158
159template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
161
162template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
164
165template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
168template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
170
171template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
173
174template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
177template <IntegrationType I, typename AssemblyDomainEleOp>
179
180template <typename DomainEleOp> struct PlasticityIntegrators {
181 template <int DIM, IntegrationType I>
184
185 template <int DIM, IntegrationType I>
188
189 template <int DIM, IntegrationType I>
191
192 template <int DIM, IntegrationType I>
195
196 template <int DIM, IntegrationType I>
198
199 template <AssemblyType A> struct Assembly {
200
202 typename FormsIntegrators<DomainEleOp>::template Assembly<A>::OpBase;
204 template <int DIM, IntegrationType I>
208 template <IntegrationType I>
212 template <int DIM, IntegrationType I>
216 template <int DIM, IntegrationType I>
220
221 template <int DIM, IntegrationType I>
224
225 template <int DIM, IntegrationType I>
228
229 template <int DIM, IntegrationType I>
232
233 template <int DIM, IntegrationType I>
236
237 template <int DIM, IntegrationType I>
240
241 template <int DIM, IntegrationType I>
245 template <int DIM, IntegrationType I>
249 template <IntegrationType I>
252 };
253};
254
255}; // namespace PlasticOps
256
257#include <PlasticOpsGeneric.hpp>
260#include <PlasticOpsMonitor.hpp>
261
262namespace PlasticOps {
263
264using Pip = boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator>;
265using CommonPlasticPtr = boost::shared_ptr<PlasticOps::CommonData>;
266using CommonHenckyPtr = boost::shared_ptr<HenckyOps::CommonData>;
267
268template <int DIM>
269MoFEMErrorCode
270addMatBlockOps(MoFEM::Interface &m_field, std::string block_name, Pip &pip,
271 boost::shared_ptr<MatrixDouble> mat_D_Ptr,
272 boost::shared_ptr<CommonData::BlockParams> mat_params_ptr,
273 double scale_value, Sev sev) {
275
276 struct OpMatBlocks : public DomainEleOp {
277 OpMatBlocks(boost::shared_ptr<MatrixDouble> m_D_ptr,
278 boost::shared_ptr<CommonData::BlockParams> mat_params_ptr,
279 double scale_value, MoFEM::Interface &m_field, Sev sev,
280 std::vector<const CubitMeshSets *> meshset_vec_ptr)
281 : DomainEleOp(NOSPACE, DomainEleOp::OPSPACE), matDPtr(m_D_ptr),
282 matParamsPtr(mat_params_ptr), scaleVal(scale_value) {
283 CHK_THROW_MESSAGE(extractBlockData(m_field, meshset_vec_ptr, sev),
284 "Can not get data from block");
285 }
286
287 MoFEMErrorCode doWork(int side, EntityType type,
288 EntitiesFieldData::EntData &data) {
290
291 auto getK = [](auto &p) {
292 auto young_modulus = p[CommonData::YOUNG_MODULUS];
293 auto poisson_ratio = p[CommonData::POISSON_RATIO];
294 return young_modulus / (3 * (1 - 2 * poisson_ratio));
295 };
296
297 auto getG = [](auto &p) {
298 auto young_modulus = p[CommonData::YOUNG_MODULUS];
299 auto poisson_ratio = p[CommonData::POISSON_RATIO];
300 return young_modulus / (2 * (1 + poisson_ratio));
301 };
302
303 auto scale_fun = [this](auto &p) {
304 p[CommonData::YOUNG_MODULUS] *= scaleVal;
305 p[CommonData::SIGMA_Y] *= scaleVal;
306 p[CommonData::H] *= scaleVal;
307 p[CommonData::VIS_H] *= scaleVal;
308 p[CommonData::QINF] *= scaleVal;
309 p[CommonData::C1_k] *= scaleVal;
310 };
311
312 for (auto &b : blockData) {
313 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
314 *matParamsPtr = b.bParams;
315 scale_fun(*matParamsPtr);
316 CHKERR getMatDPtr(matDPtr, getK(*matParamsPtr), getG(*matParamsPtr));
318 }
319 }
320
321 (*matParamsPtr) = {young_modulus, poisson_ratio, sigmaY, H,
322 visH, Qinf, b_iso, C1_k};
323 scale_fun(*matParamsPtr);
324 CHKERR getMatDPtr(matDPtr, getK(*matParamsPtr), getG(*matParamsPtr));
325
327 }
328
329 private:
330 boost::shared_ptr<MatrixDouble> matDPtr;
331 boost::shared_ptr<CommonData::BlockParams> matParamsPtr;
332 const double scaleVal;
333
334 struct BlockData {
335 std::array<double, CommonData::LAST_PARAM> bParams;
336 Range blockEnts;
337 };
338 std::vector<BlockData> blockData;
339
340 /**
341 * @brief Extract block data from meshsets
342 *
343 * @param m_field
344 * @param meshset_vec_ptr
345 * @param sev
346 * @return MoFEMErrorCode
347 */
349 extractBlockData(MoFEM::Interface &m_field,
350 std::vector<const CubitMeshSets *> meshset_vec_ptr,
351 Sev sev) {
353
354 for (auto m : meshset_vec_ptr) {
355 MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock") << *m;
356 std::vector<double> block_data;
357 CHKERR m->getAttributes(block_data);
358 if (block_data.size() != CommonData::LAST_PARAM) {
359 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
360 "Wrong number of block attribute");
361 }
362 auto get_block_ents = [&]() {
363 Range ents;
364 CHKERR m_field.get_moab().get_entities_by_handle(m->meshset, ents,
365 true);
366 return ents;
367 };
368
369 CommonData::BlockParams block_params;
370 for (auto i = 0; i != CommonData::LAST_PARAM; ++i) {
371 block_params[i] = block_data[i];
372 }
373
374 MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock")
375 << "E = " << block_params[CommonData::YOUNG_MODULUS]
376 << " nu = " << block_params[CommonData::POISSON_RATIO];
377 MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock")
378 << std::endl
379 << "sigma_y = " << block_params[CommonData::SIGMA_Y] << std::endl
380 << "h = " << block_params[CommonData::H] << std::endl
381 << "vis_h = " << block_params[CommonData::VIS_H] << std::endl
382 << "qinf = " << block_params[CommonData::QINF] << std::endl
383 << "biso = " << block_params[CommonData::BISO] << std::endl
384 << "C1_k = " << block_params[CommonData::C1_k] << std::endl;
385
386 blockData.push_back({block_params, get_block_ents()});
387 }
388 MOFEM_LOG_CHANNEL("WORLD");
390 }
391
392 /**
393 * @brief Get elasticity tensor
394 *
395 * Calculate elasticity tensor for given material parameters
396 *
397 * @param mat_D_ptr
398 * @param bulk_modulus_K
399 * @param shear_modulus_G
400 * @return MoFEMErrorCode
401 *
402 */
403 MoFEMErrorCode getMatDPtr(boost::shared_ptr<MatrixDouble> mat_D_ptr,
404 double bulk_modulus_K, double shear_modulus_G) {
406 //! [Calculate elasticity tensor]
407 auto set_material_stiffness = [&]() {
408 FTensor::Index<'i', DIM> i;
409 FTensor::Index<'j', DIM> j;
410 FTensor::Index<'k', DIM> k;
411 FTensor::Index<'l', DIM> l;
413 double A = (DIM == 2)
414 ? 2 * shear_modulus_G /
415 (bulk_modulus_K + (4. / 3.) * shear_modulus_G)
416 : 1;
417 auto t_D = getFTensor4DdgFromMat<DIM, DIM, 0>(*mat_D_ptr);
418 t_D(i, j, k, l) =
419 2 * shear_modulus_G * ((t_kd(i, k) ^ t_kd(j, l)) / 4.) +
420 A * (bulk_modulus_K - (2. / 3.) * shear_modulus_G) * t_kd(i, j) *
421 t_kd(k, l);
422 };
423 //! [Calculate elasticity tensor]
424 constexpr auto size_symm = (DIM * (DIM + 1)) / 2;
425 mat_D_ptr->resize(size_symm * size_symm, 1);
426 set_material_stiffness();
428 }
429 };
430
431 // push operator to calculate material stiffness matrix for each block
432 pip.push_back(new OpMatBlocks(
433 mat_D_Ptr, mat_params_ptr, scale_value, m_field, sev,
434
435 // Get blockset using regular expression
436 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
437
438 (boost::format("%s(.*)") % block_name).str()
439
440 ))
441
442 ));
443
445}
446
447template <int DIM, IntegrationType I, typename DomainEleOp>
449 MoFEM::Interface &m_field, std::string block_name,
450 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
451 std::string u, std::string ep, std::string tau, double scale, Sev sev) {
452
453 using P = PlasticityIntegrators<DomainEleOp>;
454
455 auto common_plastic_ptr = boost::make_shared<PlasticOps::CommonData>();
456 common_plastic_ptr = boost::make_shared<PlasticOps::CommonData>();
457
458 constexpr auto size_symm = (DIM * (DIM + 1)) / 2;
459 auto make_d_mat = []() {
460 return boost::make_shared<MatrixDouble>(size_symm * size_symm, 1);
461 };
462
463 common_plastic_ptr->mDPtr = make_d_mat();
464 common_plastic_ptr->mGradPtr = boost::make_shared<MatrixDouble>();
465 common_plastic_ptr->mStrainPtr = boost::make_shared<MatrixDouble>();
466 common_plastic_ptr->mStressPtr = boost::make_shared<MatrixDouble>();
467
468 auto m_D_ptr = common_plastic_ptr->mDPtr;
469
470 CHK_THROW_MESSAGE(addMatBlockOps<DIM>(m_field, block_name, pip, m_D_ptr,
471 common_plastic_ptr->getParamsPtr(),
472 scale, sev),
473 "add mat block ops");
474
475 pip.push_back(new OpCalculateScalarFieldValues(
476 tau, common_plastic_ptr->getPlasticTauPtr()));
477 pip.push_back(new OpCalculateTensor2SymmetricFieldValues<DIM>(
478 ep, common_plastic_ptr->getPlasticStrainPtr()));
479 pip.push_back(new OpCalculateVectorFieldGradient<DIM, DIM>(
480 u, common_plastic_ptr->mGradPtr));
481
482 CommonHenckyPtr common_hencky_ptr;
483
484 if (is_large_strains) {
485 common_hencky_ptr = boost::make_shared<HenckyOps::CommonData>();
486 common_hencky_ptr->matGradPtr = common_plastic_ptr->mGradPtr;
487 common_hencky_ptr->matDPtr = common_plastic_ptr->mDPtr;
488 common_hencky_ptr->matLogCPlastic =
489 common_plastic_ptr->getPlasticStrainPtr();
490 common_plastic_ptr->mStrainPtr = common_hencky_ptr->getMatLogC();
491 common_plastic_ptr->mStressPtr = common_hencky_ptr->getMatHenckyStress();
492
494
495 pip.push_back(new typename H::template OpCalculateEigenVals<DIM, I>(
496 u, common_hencky_ptr));
497 pip.push_back(
498 new typename H::template OpCalculateLogC<DIM, I>(u, common_hencky_ptr));
499 pip.push_back(new typename H::template OpCalculateLogC_dC<DIM, I>(
500 u, common_hencky_ptr));
501 pip.push_back(
502 new typename H::template OpCalculateHenckyPlasticStress<DIM, I, 0>(
503 u, common_hencky_ptr, m_D_ptr));
504 pip.push_back(new typename H::template OpCalculatePiolaStress<DIM, I, 0>(
505 u, common_hencky_ptr));
506 } else {
507
508 pip.push_back(new OpSymmetrizeTensor<SPACE_DIM>(
509 common_plastic_ptr->mGradPtr, common_plastic_ptr->mStrainPtr));
510 pip.push_back(new typename P::template OpPlasticStress<DIM, I>(
511 common_plastic_ptr, m_D_ptr));
512 }
513
514 pip.push_back(new typename P::template OpCalculatePlasticSurface<DIM, I>(
515 u, common_plastic_ptr));
516
517 return std::make_tuple(common_plastic_ptr, common_hencky_ptr);
518}
519
520template <int DIM, AssemblyType A, IntegrationType I, typename DomainEleOp>
522opFactoryDomainRhs(MoFEM::Interface &m_field, std::string block_name, Pip &pip,
523 std::string u, std::string ep, std::string tau) {
525
526 using B = typename FormsIntegrators<DomainEleOp>::template Assembly<
527 A>::template LinearForm<I>;
529 typename B::template OpGradTimesSymTensor<1, DIM, DIM>;
531 typename B::template OpGradTimesTensor<1, DIM, DIM>;
532
533 using P = PlasticityIntegrators<DomainEleOp>;
534
535 auto [common_plastic_ptr, common_hencky_ptr] =
536 createCommonPlasticOps<DIM, I, DomainEleOp>(m_field, block_name, pip, u,
537 ep, tau, scale, Sev::inform);
538
539 auto m_D_ptr = common_plastic_ptr->mDPtr;
540
541 pip.push_back(new OpCalculateTensor2SymmetricFieldValuesDot<DIM>(
542 ep, common_plastic_ptr->getPlasticStrainDotPtr()));
543 pip.push_back(new OpCalculateScalarFieldValuesDot(
544 tau, common_plastic_ptr->getPlasticTauDotPtr()));
545 pip.push_back(new typename P::template OpCalculatePlasticity<DIM, I>(
546 u, common_plastic_ptr, m_D_ptr));
548 // Calculate internal forces
549 if (common_hencky_ptr) {
550 pip.push_back(new OpInternalForcePiola(
551 u, common_hencky_ptr->getMatFirstPiolaStress()));
552 } else {
553 pip.push_back(new OpInternalForceCauchy(u, common_plastic_ptr->mStressPtr));
554 }
555
556 pip.push_back(
557 new
558 typename P::template Assembly<A>::template OpCalculateConstraintsRhs<I>(
559 tau, common_plastic_ptr, m_D_ptr));
560 pip.push_back(
561 new typename P::template Assembly<A>::template OpCalculatePlasticFlowRhs<
562 DIM, I>(ep, common_plastic_ptr, m_D_ptr));
563
565}
566
567template <int DIM, AssemblyType A, IntegrationType I, typename DomainEleOp>
569opFactoryDomainLhs(MoFEM::Interface &m_field, std::string block_name, Pip &pip,
570 std::string u, std::string ep, std::string tau) {
572
573 using namespace HenckyOps;
574
575 using B = typename FormsIntegrators<DomainEleOp>::template Assembly<
576 A>::template BiLinearForm<I>;
577 using OpKPiola = typename B::template OpGradTensorGrad<1, DIM, DIM, 1>;
578 using OpKCauchy = typename B::template OpGradSymTensorGrad<1, DIM, DIM, 0>;
579
580 using P = PlasticityIntegrators<DomainEleOp>;
581
582 auto [common_plastic_ptr, common_hencky_ptr] =
583 createCommonPlasticOps<DIM, I, DomainEleOp>(m_field, block_name, pip, u,
584 ep, tau, scale, Sev::verbose);
585
586 auto m_D_ptr = common_plastic_ptr->mDPtr;
587
588 pip.push_back(new OpCalculateTensor2SymmetricFieldValuesDot<DIM>(
589 ep, common_plastic_ptr->getPlasticStrainDotPtr()));
590 pip.push_back(new OpCalculateScalarFieldValuesDot(
591 tau, common_plastic_ptr->getPlasticTauDotPtr()));
592 pip.push_back(new typename P::template OpCalculatePlasticity<DIM, I>(
593 u, common_plastic_ptr, m_D_ptr));
594
595 if (common_hencky_ptr) {
597 pip.push_back(new typename H::template OpHenckyTangent<DIM, I, 0>(
598 u, common_hencky_ptr, m_D_ptr));
599 pip.push_back(new OpKPiola(u, u, common_hencky_ptr->getMatTangent()));
600 pip.push_back(
601 new typename P::template Assembly<A>::
602 template OpCalculatePlasticInternalForceLhs_LogStrain_dEP<DIM, I>(
603 u, ep, common_plastic_ptr, common_hencky_ptr, m_D_ptr));
604 } else {
605 pip.push_back(new OpKCauchy(u, u, m_D_ptr));
606 pip.push_back(new typename P::template Assembly<A>::
607 template OpCalculatePlasticInternalForceLhs_dEP<DIM, I>(
608 u, ep, common_plastic_ptr, m_D_ptr));
609 }
610
611 if (common_hencky_ptr) {
612 pip.push_back(
613 new typename P::template Assembly<A>::
614 template OpCalculateConstraintsLhs_LogStrain_dU<DIM, I>(
615 tau, u, common_plastic_ptr, common_hencky_ptr, m_D_ptr));
616 pip.push_back(
617 new typename P::template Assembly<A>::
618 template OpCalculatePlasticFlowLhs_LogStrain_dU<DIM, I>(
619 ep, u, common_plastic_ptr, common_hencky_ptr, m_D_ptr));
620 } else {
621 pip.push_back(
622 new
623 typename P::template Assembly<A>::template OpCalculateConstraintsLhs_dU<
624 DIM, I>(tau, u, common_plastic_ptr, m_D_ptr));
625 pip.push_back(
626 new
627 typename P::template Assembly<A>::template OpCalculatePlasticFlowLhs_dU<
628 DIM, I>(ep, u, common_plastic_ptr, m_D_ptr));
629 }
631 pip.push_back(
632 new
633 typename P::template Assembly<A>::template OpCalculatePlasticFlowLhs_dEP<
634 DIM, I>(ep, ep, common_plastic_ptr, m_D_ptr));
635 pip.push_back(
636 new
637 typename P::template Assembly<A>::template OpCalculatePlasticFlowLhs_dTAU<
638 DIM, I>(ep, tau, common_plastic_ptr, m_D_ptr));
639 pip.push_back(
640 new
641 typename P::template Assembly<A>::template OpCalculateConstraintsLhs_dEP<
642 DIM, I>(tau, ep, common_plastic_ptr, m_D_ptr));
643 pip.push_back(
644 new
645 typename P::template Assembly<A>::template OpCalculateConstraintsLhs_dTAU<
646 I>(tau, tau, common_plastic_ptr));
647
649}
650
651template <int DIM, AssemblyType A, IntegrationType I, typename DomainEleOp>
652MoFEMErrorCode opFactoryDomainReactions(MoFEM::Interface &m_field,
653 std::string block_name, Pip &pip,
654 std::string u, std::string ep,
655 std::string tau) {
657
658 using B = typename FormsIntegrators<DomainEleOp>::template Assembly<
659 A>::template LinearForm<I>;
661 typename B::template OpGradTimesSymTensor<1, DIM, DIM>;
663 typename B::template OpGradTimesTensor<1, DIM, DIM>;
664
665 auto [common_plastic_ptr, common_hencky_ptr] =
666 createCommonPlasticOps<DIM, I, DomainEleOp>(m_field, block_name, pip, u,
667 ep, tau, 1., Sev::inform);
668
669 // Calculate internal forces
670 if (common_hencky_ptr) {
671 pip.push_back(new OpInternalForcePiola(
672 u, common_hencky_ptr->getMatFirstPiolaStress()));
673 } else {
674 pip.push_back(new OpInternalForceCauchy(u, common_plastic_ptr->mStressPtr));
675 }
676
678}
679
680} // namespace PlasticOps
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
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 ...
@ 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
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
OpCalculateScalarFieldValuesFromPetscVecImpl< PetscData::CTX_SET_X_T > OpCalculateScalarFieldValuesDot
auto createCommonPlasticOps(MoFEM::Interface &m_field, std::string block_name, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string u, std::string ep, std::string tau, double scale, Sev sev)
FTensor::Index< 'N', 3 > N
boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > Pip
MoFEMErrorCode opFactoryDomainReactions(MoFEM::Interface &m_field, std::string block_name, Pip &pip, std::string u, std::string ep, std::string tau)
MoFEMErrorCode opFactoryDomainRhs(MoFEM::Interface &m_field, std::string block_name, Pip &pip, std::string u, std::string ep, std::string tau)
boost::shared_ptr< HenckyOps::CommonData > CommonHenckyPtr
FTensor::Index< 'J', 3 > J
MoFEMErrorCode addMatBlockOps(MoFEM::Interface &m_field, std::string block_name, Pip &pip, boost::shared_ptr< MatrixDouble > mat_D_Ptr, boost::shared_ptr< CommonData::BlockParams > mat_params_ptr, double scale_value, Sev sev)
FTensor::Index< 'M', 3 > M
MoFEMErrorCode opFactoryDomainLhs(MoFEM::Interface &m_field, std::string block_name, Pip &pip, std::string u, std::string ep, std::string tau)
boost::shared_ptr< PlasticOps::CommonData > CommonPlasticPtr
FTensor::Index< 'I', 3 > I
[Common data]
FormsIntegrators< DomainEleOp >::Assembly< A >::LinearForm< I >::OpGradTimesTensor< 1, FIELD_DIM, SPACE_DIM > OpGradTimesTensor
constexpr AssemblyType A
[Define dimension]
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForcePiola
Definition seepage.cpp:65
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradTensorGrad< 1, SPACE_DIM, SPACE_DIM, 1 > OpKPiola
[Only used for dynamics]
Definition seepage.cpp:63
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesSymTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForceCauchy
Definition seepage.cpp:51
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradSymTensorGrad< 1, SPACE_DIM, SPACE_DIM, 0 > OpKCauchy
[Only used with Hooke equation (linear material model)]
Definition seepage.cpp:49
FTensor::Index< 'm', 3 > m
virtual moab::Interface & get_moab()=0
Deprecated interface functions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
MatrixDouble resFlowDstrainDot
boost::shared_ptr< MatrixDouble > mStressPtr
boost::shared_ptr< MatrixDouble > mDPtr
[Common data set externally]
static std::array< int, 5 > activityData
VectorDouble plasticTau
boost::shared_ptr< MatrixDouble > mGradPtr
MatrixDouble plasticKinHardening
MatrixDouble resFlowDtau
VectorDouble plasticIsoHardening
[Common data set externally]
MatrixDouble resFlowDstrain
VectorDouble plasticTauDot
boost::shared_ptr< MatrixDouble > mStrainPtr
VectorDouble plasticSurface
[Common data set externally]
MatrixDouble resCdPlasticStrain
MatrixDouble resCdStrain
MatrixDouble plasticStrainDot
MatrixDouble plasticFlow
std::array< double, LAST_PARAM > BlockParams
MatrixDouble plasticStrain
double young_modulus
Young modulus.
Definition plastic.cpp:125
double C1_k
Kinematic hardening.
Definition plastic.cpp:133
double Qinf
Saturation yield stress.
Definition plastic.cpp:131
double visH
Viscous hardening.
Definition plastic.cpp:129
double poisson_ratio
Poisson ratio.
Definition plastic.cpp:126
double scale
Definition plastic.cpp:123
constexpr auto size_symm
Definition plastic.cpp:42
double H
Hardening.
Definition plastic.cpp:128
double b_iso
Saturation exponent.
Definition plastic.cpp:132
PetscBool is_large_strains
Large strains.
Definition plastic.cpp:117
double sigmaY
Yield stress.
Definition plastic.cpp:127