v0.13.1
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 boost::shared_ptr<MatrixDouble> mDPtr;
45 boost::shared_ptr<MatrixDouble> mDPtr_Axiator;
46 boost::shared_ptr<MatrixDouble> mDPtr_Deviator;
47 boost::shared_ptr<MatrixDouble> mGradPtr;
48 boost::shared_ptr<MatrixDouble> mStrainPtr;
49 boost::shared_ptr<MatrixDouble> mStressPtr;
50
51 VectorDouble plasticSurface;
52 MatrixDouble plasticFlow;
53 VectorDouble plasticTau;
54 VectorDouble plasticTauDot;
55 MatrixDouble plasticStrain;
56 MatrixDouble plasticStrainDot;
57
58 VectorDouble resC;
59 VectorDouble resCdTau;
60 MatrixDouble resCdStrain;
61 MatrixDouble resFlow;
62 MatrixDouble resFlowDtau;
63 MatrixDouble resFlowDstrain;
64 MatrixDouble resFlowDstrainDot;
65
66 VectorDouble argTau;
67 MatrixDouble argStrain;
68 VectorDouble argTauTau;
69 MatrixDouble argTauStrain;
70 MatrixDouble argStrainStrain;
71
72 inline auto getPlasticSurfacePtr() {
73 return boost::shared_ptr<VectorDouble>(shared_from_this(), &plasticSurface);
74 }
75 inline auto getPlasticTauPtr() {
76 return boost::shared_ptr<VectorDouble>(shared_from_this(), &plasticTau);
77 }
78 inline auto getPlasticTauDotPtr() {
79 return boost::shared_ptr<VectorDouble>(shared_from_this(), &plasticTauDot);
80 }
81 inline auto getPlasticStrainPtr() {
82 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &plasticStrain);
83 }
84 inline auto getPlasticStrainDotPtr() {
85 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
87 }
88 inline auto getPlasticFlowPtr() {
89 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &plasticFlow);
90 }
91};
92//! [Common data]
93
102
107
110
111//! [Operators definitions]
113 OpCalculatePlasticSurface(const std::string field_name,
114 boost::shared_ptr<CommonData> common_data_ptr);
115 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
116
117protected:
118 boost::shared_ptr<CommonData> commonDataPtr;
119};
120
122 OpCalculatePlasticity(const std::string field_name,
123 boost::shared_ptr<CommonData> common_data_ptr,
124 boost::shared_ptr<MatrixDouble> m_D_ptr);
125 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
126
127protected:
128 boost::shared_ptr<CommonData> commonDataPtr;
129 boost::shared_ptr<MatrixDouble> mDPtr;
130};
131
133 OpPlasticStress(const std::string field_name,
134 boost::shared_ptr<CommonData> common_data_ptr,
135 boost::shared_ptr<MatrixDouble> mDPtr,
136 const double scale = 1);
137 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
138
139private:
140 boost::shared_ptr<MatrixDouble> mDPtr;
141 const double scaleStress;
142 boost::shared_ptr<CommonData> commonDataPtr;
143};
144
146 OpCalculatePlasticFlowRhs(const std::string field_name,
147 boost::shared_ptr<CommonData> common_data_ptr,
148 boost::shared_ptr<MatrixDouble> m_D_ptr);
149 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data);
150
151private:
152 boost::shared_ptr<CommonData> commonDataPtr;
153 boost::shared_ptr<MatrixDouble> mDPtr;
154};
155
157 OpCalculateConstraintsRhs(const std::string field_name,
158 boost::shared_ptr<CommonData> common_data_ptr,
159 boost::shared_ptr<MatrixDouble> m_D_ptr);
160 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data);
161
162private:
163 boost::shared_ptr<CommonData> commonDataPtr;
164 boost::shared_ptr<MatrixDouble> mDPtr;
165};
166
169 const std::string row_field_name, const std::string col_field_name,
170 boost::shared_ptr<CommonData> common_data_ptr,
171 boost::shared_ptr<MatrixDouble> m_D_ptr);
172 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
173 EntitiesFieldData::EntData &col_data);
174
175private:
176 boost::shared_ptr<CommonData> commonDataPtr;
177 boost::shared_ptr<MatrixDouble> mDPtr;
178};
179
181 : public AssemblyDomainEleOp {
183 const std::string row_field_name, const std::string col_field_name,
184 boost::shared_ptr<CommonData> common_data_ptr,
185 boost::shared_ptr<HenckyOps::CommonData> common_henky_data_ptr,
186 boost::shared_ptr<MatrixDouble> m_D_ptr);
187 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
188 EntitiesFieldData::EntData &col_data);
189
190private:
191 boost::shared_ptr<CommonData> commonDataPtr;
192 boost::shared_ptr<HenckyOps::CommonData> commonHenckyDataPtr;
193 boost::shared_ptr<MatrixDouble> mDPtr;
194 MatrixDouble locMat;
195 MatrixDouble resDiff;
196};
197
199 OpCalculatePlasticFlowLhs_dU(const std::string row_field_name,
200 const std::string col_field_name,
201 boost::shared_ptr<CommonData> common_data_ptr,
202 boost::shared_ptr<MatrixDouble> m_D_ptr);
203 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
204 EntitiesFieldData::EntData &col_data);
205
206private:
207 boost::shared_ptr<CommonData> commonDataPtr;
208 boost::shared_ptr<MatrixDouble> mDPtr;
209};
210
213 const std::string row_field_name, const std::string col_field_name,
214 boost::shared_ptr<CommonData> common_data_ptr,
215 boost::shared_ptr<HenckyOps::CommonData> comman_henky_data_ptr,
216 boost::shared_ptr<MatrixDouble> m_D_ptr);
217 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
218 EntitiesFieldData::EntData &col_data);
219
220private:
221 boost::shared_ptr<CommonData> commonDataPtr;
222 boost::shared_ptr<HenckyOps::CommonData> commonHenckyDataPtr;
223 boost::shared_ptr<MatrixDouble> mDPtr;
224 MatrixDouble resDiff;
225};
226
228 OpCalculatePlasticFlowLhs_dEP(const std::string row_field_name,
229 const std::string col_field_name,
230 boost::shared_ptr<CommonData> common_data_ptr,
231 boost::shared_ptr<MatrixDouble> m_D_ptr);
232 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
233 EntitiesFieldData::EntData &col_data);
234
235private:
236 boost::shared_ptr<CommonData> commonDataPtr;
237 boost::shared_ptr<MatrixDouble> mDPtr;
238};
239
241 OpCalculatePlasticFlowLhs_dTAU(const std::string row_field_name,
242 const std::string col_field_name,
243 boost::shared_ptr<CommonData> common_data_ptr,
244 boost::shared_ptr<MatrixDouble> m_D_ptr);
245 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
246 EntitiesFieldData::EntData &col_data);
247
248private:
249 boost::shared_ptr<CommonData> commonDataPtr;
250 boost::shared_ptr<MatrixDouble> mDPtr;
251};
252
254 OpCalculateConstraintsLhs_dU(const std::string row_field_name,
255 const std::string col_field_name,
256 boost::shared_ptr<CommonData> common_data_ptr,
257 boost::shared_ptr<MatrixDouble> m_D_ptr);
258 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
259 EntitiesFieldData::EntData &col_data);
260
261private:
262 boost::shared_ptr<CommonData> commonDataPtr;
263 boost::shared_ptr<MatrixDouble> mDPtr;
264};
265
268 const std::string row_field_name, const std::string col_field_name,
269 boost::shared_ptr<CommonData> common_data_ptr,
270 boost::shared_ptr<HenckyOps::CommonData> comman_henky_data_ptr,
271 boost::shared_ptr<MatrixDouble> m_D_ptr);
272 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
273 EntitiesFieldData::EntData &col_data);
274
275private:
276 boost::shared_ptr<CommonData> commonDataPtr;
277 boost::shared_ptr<HenckyOps::CommonData> commonHenckyDataPtr;
278 boost::shared_ptr<MatrixDouble> mDPtr;
279 MatrixDouble resDiff;
280};
281
283 OpCalculateConstraintsLhs_dEP(const std::string row_field_name,
284 const std::string col_field_name,
285 boost::shared_ptr<CommonData> common_data_ptr,
286 boost::shared_ptr<MatrixDouble> mat_D_ptr);
287 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
288 EntitiesFieldData::EntData &col_data);
289
290private:
291 boost::shared_ptr<CommonData> commonDataPtr;
292 boost::shared_ptr<MatrixDouble> mDPtr;
293};
294
296 OpCalculateConstraintsLhs_dTAU(const std::string row_field_name,
297 const std::string col_field_name,
298 boost::shared_ptr<CommonData> common_data_ptr);
299 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
300 EntitiesFieldData::EntData &col_data);
301
302private:
303 boost::shared_ptr<CommonData> commonDataPtr;
304};
305
307 OpCalculateArgRhs_dU(const std::string field_name,
308 boost::shared_ptr<CommonData> common_data_ptr);
309 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data);
310
311private:
312 boost::shared_ptr<CommonData> commonDataPtr;
313};
314
316 OpCalculateArgLhs_dUdTau(const std::string row_field_name,
317 const std::string col_field_name,
318 boost::shared_ptr<CommonData> common_data_ptr);
319 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
320 EntitiesFieldData::EntData &col_data);
321
322private:
323 boost::shared_ptr<CommonData> commonDataPtr;
324};
325
327 OpCalculateArgLhs_dUdU(const std::string row_field_name,
328 const std::string col_field_name,
329 boost::shared_ptr<CommonData> common_data_ptr);
330 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
331 EntitiesFieldData::EntData &col_data);
332
333private:
334 boost::shared_ptr<CommonData> commonDataPtr;
335};
336
339 const std::string field_name,
340 boost::shared_ptr<CommonData> common_data_ptr,
341 boost::shared_ptr<HenckyOps::CommonData> common_henky_data_ptr);
342 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data);
343
344private:
345 boost::shared_ptr<CommonData> commonDataPtr;
346 boost::shared_ptr<HenckyOps::CommonData> commonHenckyDataPtr;
347 MatrixDouble resDiff;
348};
349
352 const std::string row_field_name, const std::string col_field_name,
353 boost::shared_ptr<CommonData> common_data_ptr,
354 boost::shared_ptr<HenckyOps::CommonData> common_henky_data_ptr);
355 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
356 EntitiesFieldData::EntData &col_data);
357
358private:
359 boost::shared_ptr<CommonData> commonDataPtr;
360 boost::shared_ptr<HenckyOps::CommonData> commonHenckyDataPtr;
361 MatrixDouble resDiff;
362};
363
366 const std::string row_field_name, const std::string col_field_name,
367 boost::shared_ptr<CommonData> common_data_ptr,
368 boost::shared_ptr<HenckyOps::CommonData> common_henky_data_ptr);
369 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data,
370 EntitiesFieldData::EntData &col_data);
371
372private:
373 boost::shared_ptr<CommonData> commonDataPtr;
374 boost::shared_ptr<HenckyOps::CommonData> commonHenckyDataPtr;
375 MatrixDouble resDiff;
376};
377
379 OpPostProcPlastic(const std::string field_name,
380 moab::Interface &post_proc_mesh,
381 std::vector<EntityHandle> &map_gauss_pts,
382 boost::shared_ptr<CommonData> common_data_ptr);
383 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
384
385private:
386 moab::Interface &postProcMesh;
387 std::vector<EntityHandle> &mapGaussPts;
388 boost::shared_ptr<CommonData> commonDataPtr;
389};
390//! [Operators definitions]
391
392//! [Lambda functions]
393inline auto diff_tensor() {
396 t_diff(i, j, k, l) = (t_kd(i, k) ^ t_kd(j, l)) / 4.;
397 return t_diff;
398};
399
400inline auto symm_L_tensor() {
402 t_L(i, j, L) = 0;
403 if constexpr (SPACE_DIM == 2) {
404 t_L(0, 0, 0) = 1;
405 t_L(1, 0, 1) = 1;
406 t_L(1, 1, 2) = 1;
407 } else {
408 t_L(0, 0, 0) = 1;
409 t_L(1, 0, 1) = 1;
410 t_L(2, 0, 2) = 1;
411 t_L(1, 1, 3) = 1;
412 t_L(2, 1, 4) = 1;
413 t_L(2, 2, 5) = 1;
414 }
415 return t_L;
416}
417
418inline auto diff_symmetrize() {
420
421 t_diff(i, j, k, l) = 0;
422 t_diff(0, 0, 0, 0) = 1;
423 t_diff(1, 1, 1, 1) = 1;
424
425 t_diff(1, 0, 1, 0) = 0.5;
426 t_diff(1, 0, 0, 1) = 0.5;
427
428 t_diff(0, 1, 0, 1) = 0.5;
429 t_diff(0, 1, 1, 0) = 0.5;
430
431 if constexpr (SPACE_DIM == 3) {
432 t_diff(2, 2, 2, 2) = 1;
433
434 t_diff(2, 0, 2, 0) = 0.5;
435 t_diff(2, 0, 0, 2) = 0.5;
436 t_diff(0, 2, 0, 2) = 0.5;
437 t_diff(0, 2, 2, 0) = 0.5;
438
439 t_diff(2, 1, 2, 1) = 0.5;
440 t_diff(2, 1, 1, 2) = 0.5;
441 t_diff(1, 2, 1, 2) = 0.5;
442 t_diff(1, 2, 2, 1) = 0.5;
443 }
444
445 return t_diff;
446};
447
448template <typename T>
450 constexpr double third = boost::math::constants::third<double>();
451 if constexpr (SPACE_DIM == 2)
452 return (t_stress(0, 0) + t_stress(1, 1)) * third;
453 else
454 return (t_stress(0, 0) + t_stress(1, 1) + t_stress(2, 2)) * third;
455};
456
457template <typename T>
459 double trace) {
461 t_dev(I, J) = 0;
462 for (int ii = 0; ii != SPACE_DIM; ++ii)
463 for (int jj = ii; jj != SPACE_DIM; ++jj)
464 t_dev(ii, jj) = t_stress(ii, jj);
465 t_dev(0, 0) -= trace;
466 t_dev(1, 1) -= trace;
467 t_dev(2, 2) -= trace;
468 return t_dev;
469};
470
471inline auto
474 t_diff_deviator(I, J, k, l) = 0;
475 for (int ii = 0; ii != SPACE_DIM; ++ii)
476 for (int jj = ii; jj != SPACE_DIM; ++jj)
477 for (int kk = 0; kk != SPACE_DIM; ++kk)
478 for (int ll = kk; ll != SPACE_DIM; ++ll)
479 t_diff_deviator(ii, jj, kk, ll) = t_diff_stress(ii, jj, kk, ll);
480
481 constexpr double third = boost::math::constants::third<double>();
482
483 t_diff_deviator(0, 0, 0, 0) -= third;
484 t_diff_deviator(0, 0, 1, 1) -= third;
485
486 t_diff_deviator(1, 1, 0, 0) -= third;
487 t_diff_deviator(1, 1, 1, 1) -= third;
488
489 t_diff_deviator(2, 2, 0, 0) -= third;
490 t_diff_deviator(2, 2, 1, 1) -= third;
491
492 if constexpr (SPACE_DIM == 3) {
493 t_diff_deviator(0, 0, 2, 2) -= third;
494 t_diff_deviator(1, 1, 2, 2) -= third;
495 t_diff_deviator(2, 2, 2, 2) -= third;
496 }
497
498 return t_diff_deviator;
499};
500
501/**
502 *
503
504\f[
505\begin{split}
506f&=\sqrt{s_{ij}s_{ij}}\\
507A_{ij}&=\frac{\partial f}{\partial \sigma_{ij}}=
508\frac{1}{f} s_{kl} \frac{\partial s_{kl}}{\partial \sigma_{ij}}\\
509\frac{\partial A_{ij}}{\partial \sigma_{kl}}&= \frac{\partial^2 f}{\partial
510\sigma_{ij}\partial\sigma_{mn}}= \frac{1}{f} \left( \frac{\partial
511s_{kl}}{\partial \sigma_{mn}}\frac{\partial s_{kl}}{\partial \sigma_{ij}}
512-A_{mn}A_{ij}
513\right)\\
514\frac{\partial f}{\partial \varepsilon_{ij}}&=A_{mn}D_{mnij}
515\\
516\frac{\partial A_{ij}}{\partial \varepsilon_{kl}}&=
517\frac{\partial A_{ij}}{\partial \sigma_{mn}} \frac{\partial
518\sigma_{mn}}{\partial \varepsilon_{kl}}= \frac{\partial A_{ij}}{\partial
519\sigma_{mn}} D_{mnkl}
520\end{split}
521\f]
522
523 */
524inline double
526 return std::sqrt(1.5 * t_stress_deviator(I, J) * t_stress_deviator(I, J)) +
527 std::numeric_limits<double>::epsilon();
528};
529
530inline auto plastic_flow(long double f,
532 FTensor::Ddg<double, 3, SPACE_DIM> &&t_diff_deviator) {
534 t_diff_f(k, l) =
535 (1.5 * (t_dev_stress(I, J) * t_diff_deviator(I, J, k, l))) / f;
536 return t_diff_f;
537};
538
539template <typename T>
541 long double f, FTensor::Tensor2_symmetric<T, SPACE_DIM> &t_flow,
542 FTensor::Ddg<double, 3, SPACE_DIM> &&t_diff_deviator) {
544 t_diff_flow(i, j, k, l) =
545 (1.5 * (t_diff_deviator(M, N, i, j) * t_diff_deviator(M, N, k, l) -
546 (2. / 3.) * t_flow(i, j) * t_flow(k, l))) /
547 f;
548 return t_diff_flow;
549};
550
551template <typename T>
554 FTensor::Ddg<double, SPACE_DIM, SPACE_DIM> &&t_diff_plastic_flow_dstress) {
556 t_diff_flow(i, j, k, l) =
557 t_diff_plastic_flow_dstress(i, j, m, n) * t_D(m, n, k, l);
558 return t_diff_flow;
559};
560
561inline double constrain_diff_sign(double x) {
562 const auto y = x / zeta;
563 if (y > std::numeric_limits<float>::max_exponent10 ||
564 y < std::numeric_limits<float>::min_exponent10) {
565 return 0;
566 } else {
567 const auto e = std::exp(y);
568 const auto ep1 = e + 1;
569 return (2 / zeta) * (e / (ep1 * ep1));
570 }
571};
572
573inline double constrian_sign(double x) {
574 const auto y = x / zeta;
575 if (y > std::numeric_limits<float>::max_exponent10 ||
576 y < std::numeric_limits<float>::min_exponent10) {
577 if (x > 0)
578 return 1.;
579 else
580 return -1.;
581 } else {
582 const auto e = std::exp(y);
583 return (e - 1) / (1 + e);
584 }
585};
586
587inline double constrain_abs(double x) {
588 const auto y = -x / zeta;
589 if (y > std::numeric_limits<float>::max_exponent10 ||
590 y < std::numeric_limits<float>::min_exponent10) {
591 return std::abs(x);
592 } else {
593 const double e = std::exp(y);
594 return x + 2 * zeta * std::log1p(e);
595 }
596};
597
598inline double w(double dot_tau, double f, double sigma_y) {
599 return (f - sigma_y) / sigmaY + (cn)*dot_tau;
600};
601
602/**
603
604\f[
605\dot{\tau} - \frac{1}{2}\left\{\dot{\tau} + (f(\pmb\sigma) - \sigma_y) +
606\| \dot{\tau} + (f(\pmb\sigma) - \sigma_y) \|\right\} = 0 \\
607c_n \sigma_y \dot{\tau} - \frac{1}{2}\left\{c_n\sigma_y \dot{\tau} +
608(f(\pmb\sigma) - \sigma_y) +
609\| c_n \sigma_y \dot{\tau} + (f(\pmb\sigma) - \sigma_y) \|\right\} = 0
610\f]
611
612 */
613inline double constrain(double dot_tau, double f, double sigma_y,
614 double abs_w) {
615 return visH * dot_tau +
616 (sigmaY / 2) * (((cn)*dot_tau - (f - sigma_y) / sigmaY) - abs_w);
617};
618
619inline double diff_constrain_ddot_tau(double sign) {
620 return visH + (sigmaY / 2) * ((cn) - (cn)*sign);
621};
622
623inline auto diff_constrain_df(double sign) { return (-1 - sign) / 2; };
624
625inline auto diff_constrain_dsigma_y(double sign) { return (1 + sign) / 2; }
626
627inline double diff_constrain_ddot_tau2(double sign2) {
628 return (sigmaY / 2) * (-cn * sign2);
629};
630
631inline auto diff_constrain_df2(double sign2) { return -sign2 / 2; };
632
633inline auto diff_constrain_dsigma_y2(double sign2) { return sign2 / 2; }
634
635template <typename T>
637 double diff_constrain_df,
639 FTensor::Tensor2_symmetric<double, SPACE_DIM> t_diff_constrain_dstress;
640 t_diff_constrain_dstress(i, j) = diff_constrain_df * t_plastic_flow(i, j);
641 return t_diff_constrain_dstress;
642};
643
644template <typename T1, typename T2>
645inline auto diff_constrain_dstrain(T1 &t_D, T2 &&t_diff_constrain_dstress) {
646 FTensor::Tensor2_symmetric<double, SPACE_DIM> t_diff_constrain_dstrain;
647 t_diff_constrain_dstrain(k, l) =
648 t_diff_constrain_dstress(i, j) * t_D(i, j, k, l);
649 return t_diff_constrain_dstrain;
650};
651//! [Lambda functions]
652
653//! [Auxiliary functions functions
654static inline auto get_mat_tensor_sym_dvector(size_t rr, MatrixDouble &mat,
657 &mat(3 * rr + 0, 0), &mat(3 * rr + 0, 1), &mat(3 * rr + 1, 0),
658 &mat(3 * rr + 1, 1), &mat(3 * rr + 2, 0), &mat(3 * rr + 2, 1)};
659}
660
661static inline auto get_mat_tensor_sym_dvector(size_t rr, MatrixDouble &mat,
664 &mat(6 * rr + 0, 0), &mat(6 * rr + 0, 1), &mat(6 * rr + 0, 2),
665 &mat(6 * rr + 1, 0), &mat(6 * rr + 1, 1), &mat(6 * rr + 1, 2),
666 &mat(6 * rr + 2, 0), &mat(6 * rr + 2, 1), &mat(6 * rr + 2, 2),
667 &mat(6 * rr + 3, 0), &mat(6 * rr + 3, 1), &mat(6 * rr + 3, 2),
668 &mat(6 * rr + 4, 0), &mat(6 * rr + 4, 1), &mat(6 * rr + 4, 2),
669 &mat(6 * rr + 5, 0), &mat(6 * rr + 5, 1), &mat(6 * rr + 5, 2)};
670}
671
672inline double step_diff_sign(double x) {
673 const auto y = x / zeta;
674 if (y > std::numeric_limits<float>::max_exponent10 ||
675 y < std::numeric_limits<float>::min_exponent10) {
676 return 0;
677 } else {
678 const auto e = std::exp(y);
679 const auto ep1 = e + 1;
680 return (1 / zeta) * (e / (ep1 * ep1));
681 }
682};
683
684inline double step_sign(double x) {
685 const auto y = x / zeta;
686 if (y > std::numeric_limits<float>::max_exponent10 ||
687 y < std::numeric_limits<float>::min_exponent10) {
688 if (x > 0)
689 return 1.;
690 else
691 return 0;
692 } else {
693 const auto e = std::exp(y);
694 return e / (1 + e);
695 }
696};
697
698inline double step_abs(double x) {
699 const auto y = -x / zeta;
700 if (y > std::numeric_limits<float>::max_exponent10 ||
701 y < std::numeric_limits<float>::min_exponent10) {
702 return std::abs(x);
703 } else {
704 const double e = std::exp(y);
705 return x + zeta * std::log1p(e);
706 }
707};
708
709
710
711//! [Auxiliary functions functions
712
713}; // namespace PlasticOps
714
715#include <PlasticOpsGeneric.hpp>
718#include <PlasticOpsMonitor.hpp>
constexpr double third
constexpr int SPACE_DIM
Kronecker Delta class symmetric.
constexpr auto t_kd
auto diff_constrain_dstress(double diff_constrain_df, FTensor::Tensor2_symmetric< T, SPACE_DIM > &t_plastic_flow)
Definition: PlasticOps.hpp:636
double step_abs(double x)
Definition: PlasticOps.hpp:698
auto symm_L_tensor()
Definition: PlasticOps.hpp:400
auto deviator(FTensor::Tensor2_symmetric< T, SPACE_DIM > &t_stress, double trace)
Definition: PlasticOps.hpp:458
double constrian_sign(double x)
Definition: PlasticOps.hpp:573
double platsic_surface(FTensor::Tensor2_symmetric< double, 3 > &&t_stress_deviator)
Definition: PlasticOps.hpp:525
FTensor::Index< 'p', SPACE_DIM > p
Definition: PlasticOps.hpp:101
double constrain(double dot_tau, double f, double sigma_y, double abs_w)
Definition: PlasticOps.hpp:613
FTensor::Index< 'j', SPACE_DIM > j
Definition: PlasticOps.hpp:95
FTensor::Index< 'M', 3 > M
Definition: PlasticOps.hpp:105
double diff_constrain_ddot_tau2(double sign2)
Definition: PlasticOps.hpp:627
auto diff_constrain_dstrain(T1 &t_D, T2 &&t_diff_constrain_dstress)
Definition: PlasticOps.hpp:645
double step_diff_sign(double x)
Definition: PlasticOps.hpp:672
auto diff_constrain_df2(double sign2)
Definition: PlasticOps.hpp:631
double constrain_diff_sign(double x)
Definition: PlasticOps.hpp:561
auto plastic_flow(long double f, FTensor::Tensor2_symmetric< double, 3 > &&t_dev_stress, FTensor::Ddg< double, 3, SPACE_DIM > &&t_diff_deviator)
Definition: PlasticOps.hpp:530
FTensor::Index< 'O', size_symm > O
Definition: PlasticOps.hpp:109
FTensor::Index< 'L', size_symm > L
Definition: PlasticOps.hpp:108
double diff_constrain_ddot_tau(double sign)
Definition: PlasticOps.hpp:619
FTensor::Index< 'l', SPACE_DIM > l
Definition: PlasticOps.hpp:97
FTensor::Index< 'k', SPACE_DIM > k
Definition: PlasticOps.hpp:96
auto diff_tensor()
[Operators definitions]
Definition: PlasticOps.hpp:393
auto diff_constrain_df(double sign)
Definition: PlasticOps.hpp:623
FTensor::Index< 'N', 3 > N
Definition: PlasticOps.hpp:106
auto diff_constrain_dsigma_y(double sign)
Definition: PlasticOps.hpp:625
FTensor::Index< 'I', 3 > I
Definition: PlasticOps.hpp:103
auto diff_deviator(FTensor::Ddg< double, SPACE_DIM, SPACE_DIM > &&t_diff_stress)
Definition: PlasticOps.hpp:472
FTensor::Index< 'i', SPACE_DIM > i
[Common data]
Definition: PlasticOps.hpp:94
FTensor::Index< 'o', SPACE_DIM > o
Definition: PlasticOps.hpp:100
FTensor::Index< 'm', SPACE_DIM > m
Definition: PlasticOps.hpp:98
double constrain_abs(double x)
Definition: PlasticOps.hpp:587
double w(double dot_tau, double f, double sigma_y)
Definition: PlasticOps.hpp:598
FTensor::Index< 'J', 3 > J
Definition: PlasticOps.hpp:104
auto diff_constrain_dsigma_y2(double sign2)
Definition: PlasticOps.hpp:633
double step_sign(double x)
Definition: PlasticOps.hpp:684
double trace(FTensor::Tensor2_symmetric< T, SPACE_DIM > &t_stress)
Definition: PlasticOps.hpp:449
auto diff_symmetrize()
Definition: PlasticOps.hpp:418
auto diff_plastic_flow_dstress(long double f, FTensor::Tensor2_symmetric< T, SPACE_DIM > &t_flow, FTensor::Ddg< double, 3, SPACE_DIM > &&t_diff_deviator)
Definition: PlasticOps.hpp:540
auto diff_plastic_flow_dstrain(FTensor::Ddg< T, SPACE_DIM, SPACE_DIM > &t_D, FTensor::Ddg< double, SPACE_DIM, SPACE_DIM > &&t_diff_plastic_flow_dstress)
Definition: PlasticOps.hpp:552
FTensor::Index< 'n', SPACE_DIM > n
Definition: PlasticOps.hpp:99
static auto get_mat_tensor_sym_dvector(size_t rr, MatrixDouble &mat, FTensor::Number< 2 >)
[Lambda functions]
Definition: PlasticOps.hpp:654
double visH
Definition: plastic.cpp:112
double scale
Definition: plastic.cpp:105
double zeta
Definition: plastic.cpp:114
double sigmaY
Definition: plastic.cpp:110
double cn
Definition: plastic.cpp:113
constexpr auto field_name
Data on single entity (This is passed as argument to DataOperator::doWork)
boost::shared_ptr< MatrixDouble > mStrainPtr
Definition: PlasticOps.hpp:48
MatrixDouble resFlowDstrainDot
Definition: PlasticOps.hpp:64
VectorDouble resCdTau
Definition: PlasticOps.hpp:59
MatrixDouble resCdStrain
Definition: PlasticOps.hpp:60
boost::shared_ptr< MatrixDouble > mGradPtr
Definition: PlasticOps.hpp:47
MatrixDouble resFlow
Definition: PlasticOps.hpp:61
VectorDouble plasticTauDot
Definition: PlasticOps.hpp:54
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:44
VectorDouble plasticSurface
Definition: PlasticOps.hpp:51
boost::shared_ptr< MatrixDouble > mDPtr_Axiator
Definition: PlasticOps.hpp:45
MatrixDouble resFlowDtau
Definition: PlasticOps.hpp:62
MatrixDouble argStrainStrain
Definition: PlasticOps.hpp:70
VectorDouble argTauTau
Definition: PlasticOps.hpp:68
MatrixDouble plasticStrain
Definition: PlasticOps.hpp:55
boost::shared_ptr< MatrixDouble > mStressPtr
Definition: PlasticOps.hpp:49
MatrixDouble plasticFlow
Definition: PlasticOps.hpp:52
MatrixDouble plasticStrainDot
Definition: PlasticOps.hpp:56
VectorDouble plasticTau
Definition: PlasticOps.hpp:53
MatrixDouble resFlowDstrain
Definition: PlasticOps.hpp:63
MatrixDouble argTauStrain
Definition: PlasticOps.hpp:69
boost::shared_ptr< MatrixDouble > mDPtr_Deviator
Definition: PlasticOps.hpp:46
MatrixDouble argStrain
Definition: PlasticOps.hpp:67
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< HenckyOps::CommonData > commonHenckyDataPtr
Definition: PlasticOps.hpp:360
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:359
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:373
boost::shared_ptr< HenckyOps::CommonData > commonHenckyDataPtr
Definition: PlasticOps.hpp:374
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:323
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:334
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< HenckyOps::CommonData > commonHenckyDataPtr
Definition: PlasticOps.hpp:346
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:345
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:312
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:278
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:276
boost::shared_ptr< HenckyOps::CommonData > commonHenckyDataPtr
Definition: PlasticOps.hpp:277
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:291
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:292
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:303
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:262
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:263
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:163
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:164
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:223
boost::shared_ptr< HenckyOps::CommonData > commonHenckyDataPtr
Definition: PlasticOps.hpp:222
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:221
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:237
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:236
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:249
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:250
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:208
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:207
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:153
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:152
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
boost::shared_ptr< HenckyOps::CommonData > commonHenckyDataPtr
Definition: PlasticOps.hpp:192
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:176
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:177
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:118
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:128
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:129
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:142
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
[Calculate stress]
boost::shared_ptr< MatrixDouble > mDPtr
Definition: PlasticOps.hpp:140
Definition: PlasticOps.hpp:378
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:388
std::vector< EntityHandle > & mapGaussPts
Definition: PlasticOps.hpp:387
OpPostProcPlastic(const std::string field_name, moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, boost::shared_ptr< CommonData > common_data_ptr)
moab::Interface & postProcMesh
Definition: PlasticOps.hpp:386
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.