v0.16.3
Loading...
Searching...
No Matches
ADOLCPlasticityMaterialModels.hpp
Go to the documentation of this file.
1/** \file ADOLCPlasticityMaterialModels.hpp
2 * \ingroup adoc_plasticity
3 * \brief Matetial models for plasticity
4 *
5 * \example
6 * mofem/users_modules/adolc-plasticity/src/ADOLCPlasticityMaterialModels.hpp
7 *
8 */
9
10#ifndef __ADOLC_MATERIAL_MODELS_HPP
11#define __ADOLC_MATERIAL_MODELS_HPP
12
13#ifndef WITH_ADOL_C
14#error "MoFEM need to be compiled with ADOL-C"
15#endif
16
17namespace ADOLCPlasticity {
18
19/** \brief J2 plasticity (Kinematic Isotropic (Linear) Hardening)
20 * \ingroup adoc_plasticity
21 */
22
23/**
24 * @brief J2 plasticity (Kinematic Isotropic (Linear) Hardening)
25 *
26 * @tparam DIM model dimension (2 - is plane stress)
27 */
28template <int DIM> struct J2Plasticity;
29
30/**
31 * @brief J2 (Von Misses) plasticity
32 * @ingroup adoc_plasticity
33 *
34 * Free energy:
35 *
36 * \f[
37 * \psi(\varepsilon^e, \alpha, \beta) =
38 * \frac{1}{2} \lambda \textrm{tr}[\varepsilon^e]^2
39 * + \mu \varepsilon^e : \varepsilon^e
40 * +
41 * \sigma_y\alpha
42 * +
43 * \frac{1}{2} \phi H \alpha^2
44 * +
45 * \frac{1}{2} (1-\phi)K \beta^2
46 * \f]
47 *
48 * Isotropic hardening variable \f$\alpha\f$ is in first index of
49 * internal variables vector. Kinematic hardening variable is in
50 * the remaining indices of internal variables vector.
51 *
52 * Yield function:
53 *
54 * Deviator of actual stress:
55 * \f[
56 * \eta=\textrm{dev}[\sigma]-\overline{\beta}
57 * \f]
58 * where \f$\overline{\beta}\f$ is back stress.
59 *
60 * Square of the deviator norm
61 * \f[
62 * f = \frac{3}{2} \eta:\eta
63 * \f]
64 *
65 * Yield function:
66 * \f[
67 * y = \sqrt{f} - \overline{\alpha}
68 * \f]
69 * where \f$f\f$ is defined in \ref eva
70 *
71 * This is associated potential model, so flow potential is equal to yield
72 *
73 */
74template <> struct J2Plasticity<3> : public ClosestPointProjection {
75
77 nbInternalVariables = 7;
78 activeVariablesW.resize(12 + nbInternalVariables, false);
79 }
80
84
92
94
95 double mu; //< Lamé parameter
96 double lambda; //< Lamé parameters
97 double H; //< Isotropic hardening
98 double K; //< Kinematic hardening
99 double phi; //< Combined isotropic/kinematic hardening
100 double sigmaY; //< Yield stress
101
102 enum ModelParams { LAMBDA, MU, ISOH, KINK, PHI, SIGMA_Y, LAST_PARAM };
103
104 using ParamsArray = std::array<double, LAST_PARAM>;
105 boost::shared_ptr<ParamsArray> defaultParamsArrayPtr = nullptr;
106 boost::shared_ptr<ParamsArray> paramsArrayPtr = nullptr;
107 boost::shared_ptr<ParamsArray> oldParamsArrayPtr = nullptr;
108
111
112 double young_modulus = 1;
113 double poisson_ratio = 0.25;
114 sigmaY = 1;
115 H = 0.1;
116 K = 0;
117 phi = 1;
118
119 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-young_modulus",
120 &young_modulus, PETSC_NULLPTR);
121 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-poisson_ratio",
122 &poisson_ratio, 0);
123 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-sigma_y", &sigmaY,
124 PETSC_NULLPTR);
125 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-H", &H, PETSC_NULLPTR);
126 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-K", &K, PETSC_NULLPTR);
127 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-phi", &phi, PETSC_NULLPTR);
128
129 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
130 << "Young modulus: " << young_modulus;
131 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
132 << "Poisson ratio: " << poisson_ratio;
133
136
137 defaultParamsArrayPtr = boost::make_shared<ParamsArray>();
138 (*defaultParamsArrayPtr)[LAMBDA] = lambda;
139 (*defaultParamsArrayPtr)[MU] = mu;
140 (*defaultParamsArrayPtr)[ISOH] = H;
141 (*defaultParamsArrayPtr)[KINK] = K;
142 (*defaultParamsArrayPtr)[PHI] = phi;
143 (*defaultParamsArrayPtr)[SIGMA_Y] = sigmaY;
144
145 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
146 << "LAMBDA: " << (*defaultParamsArrayPtr)[LAMBDA];
147 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
148 << "MU: " << (*defaultParamsArrayPtr)[MU];
149 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
150 << "H: " << (*defaultParamsArrayPtr)[ISOH];
151 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
152 << "K: " << (*defaultParamsArrayPtr)[KINK];
153 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
154 << "PHI: " << (*defaultParamsArrayPtr)[PHI];
155 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
156 << "SIGMA_Y: " << (*defaultParamsArrayPtr)[SIGMA_Y];
157
158 paramsArrayPtr = boost::make_shared<ParamsArray>();
159 std::copy(defaultParamsArrayPtr->begin(), defaultParamsArrayPtr->end(),
160 paramsArrayPtr->begin());
161 oldParamsArrayPtr = boost::make_shared<ParamsArray>();
162 std::fill(oldParamsArrayPtr->begin(), oldParamsArrayPtr->end(), 0);
163
165 };
166
167 /**
168 * @brief Get material parameters from block
169 *
170 * @param m_field
171 * @param pip
172 * @param block_name
173 * @param sev
174 * @return MoFEMErrorCode
175 */
176 MoFEMErrorCode
178 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
179 std::string block_name, Sev sev) {
181
182 struct OpMatBlocks : public ForcesAndSourcesCore::UserDataOperator {
183
184 using OP = ForcesAndSourcesCore::UserDataOperator;
185
186 OpMatBlocks(boost::shared_ptr<ParamsArray> params_array_ptr,
187 boost::shared_ptr<ParamsArray> def_params_array_otr,
188 MoFEM::Interface &m_field, Sev sev,
189 std::vector<const CubitMeshSets *> meshset_vec_ptr)
190 : OP(NOSPACE, OP::OPSPACE), paramsArrayPtr(params_array_ptr),
191 defParamsArray(def_params_array_otr) {
192 CHK_THROW_MESSAGE(extractBlockData(m_field, meshset_vec_ptr, sev),
193 "Can not get data from block");
194 }
195
196 MoFEMErrorCode doWork(int side, EntityType type,
197 EntitiesFieldData::EntData &data) {
199
200 for (auto &b : blockData) {
201
202 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
203 std::copy(b.paramsArray.begin(), b.paramsArray.end(),
204 paramsArrayPtr->begin());
206 }
207 }
208
209 std::copy(defParamsArray->begin(), defParamsArray->end(),
210 paramsArrayPtr->begin());
211
213 }
214
215 private:
216 boost::shared_ptr<ParamsArray> paramsArrayPtr;
217 boost::shared_ptr<ParamsArray> defParamsArray;
218
219 struct BlockData {
220 ParamsArray paramsArray;
221 Range blockEnts;
222 };
223
224 std::vector<BlockData> blockData;
225
226 MoFEMErrorCode
227 extractBlockData(MoFEM::Interface &m_field,
228 std::vector<const CubitMeshSets *> meshset_vec_ptr,
229 Sev sev) {
231
232 for (auto m : meshset_vec_ptr) {
233 MOFEM_TAG_AND_LOG("ADOLCPlasticityWold", sev, "JP2 parameters") << *m;
234 std::vector<double> block_data;
235 CHKERR m->getAttributes(block_data);
236 if (block_data.size() != 6) {
237 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
238 "Expected that block has two attribute");
239 }
240 auto get_block_ents = [&]() {
241 Range ents;
242 CHKERR
243 m_field.get_moab().get_entities_by_handle(m->meshset, ents, true);
244 return ents;
245 };
246
247 blockData.push_back({*defParamsArray, get_block_ents()});
248 std::copy(block_data.begin(), block_data.end(),
249 blockData.back().paramsArray.begin());
250 const auto young_modulus = blockData.back().paramsArray[LAMBDA];
251 const auto poisson_ratio = blockData.back().paramsArray[MU];
252
253 // It is assumed that user provide young_modulus and poisson_ratio in
254 // first two arguments of the block
255
256 MOFEM_LOG("ADOLCPlasticityWold", sev)
257 << "Young modulus: " << (blockData.back().paramsArray)[LAMBDA];
258 MOFEM_LOG("ADOLCPlasticityWold", sev)
259 << "Poisson ratio: " << (blockData.back().paramsArray)[MU];
260
261 blockData.back().paramsArray[LAMBDA] =
263 blockData.back().paramsArray[MU] = MU(young_modulus, poisson_ratio);
264
265 MOFEM_LOG("ADOLCPlasticityWold", sev)
266 << "LAMBDA: " << (blockData.back().paramsArray)[LAMBDA];
267 MOFEM_LOG("ADOLCPlasticityWold", sev)
268 << "MU: " << (blockData.back().paramsArray)[MU];
269 MOFEM_LOG("ADOLCPlasticityWold", sev)
270 << "H: " << (blockData.back().paramsArray)[ISOH];
271 MOFEM_LOG("ADOLCPlasticityWold", sev)
272 << "K: " << (blockData.back().paramsArray)[KINK];
273 MOFEM_LOG("ADOLCPlasticityWold", sev)
274 << "PHI: " << (blockData.back().paramsArray)[PHI];
275 MOFEM_LOG("ADOLCPlasticityWold", sev)
276 << "SIGMA_Y: " << (blockData.back().paramsArray)[SIGMA_Y];
277 }
279 }
280 };
281
282 auto cubit_meshsets_vec_ptr =
283 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
284 std::regex((boost::format("%s(.*)") % block_name).str()));
285
286 pip.push_back(new OpMatBlocks(paramsArrayPtr, defaultParamsArrayPtr,
287 m_field, sev, cubit_meshsets_vec_ptr));
288
290 }
291
292 /**
293 * @brief Set material parameters at integration point
294 *
295 * @param tag
296 * @param recalculate_elastic_tangent
297 * @return MoFEMErrorCode
298 */
299 MoFEMErrorCode setParams(short tag, bool &recalculate_elastic_tangent) {
301 switch (tag) {
302 case TypesTags::W: {
303 set_param_vec(tapesTags[tag], paramsArrayPtr->size(),
304 paramsArrayPtr->data());
305 for (auto p = 0; p != LAST_PARAM; p++) {
306 if ((*paramsArrayPtr)[p] != (*oldParamsArrayPtr)[p]) {
307 recalculate_elastic_tangent = true;
308 std::copy(paramsArrayPtr->begin(), paramsArrayPtr->end(),
309 oldParamsArrayPtr->begin());
310 break;
311 }
312 }
313
314 } break;
315 case TypesTags::Y:
316 case TypesTags::H:
317 break;
318 default:
319 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
320 "Unknown tag for setParams");
321 }
323 }
324
325 //! [Free energy J2]
326 MoFEMErrorCode freeHemholtzEnergy() {
328
329 // ADOL-C register parameters (those can varied for integration points)
330 auto p_lambda = mkparam(lambda); // 0
331 auto p_mu = mkparam(mu); // 1
332 auto p_H = mkparam(H); // 2
333 auto p_K = mkparam(K); // 3
334 auto p_phi = mkparam(phi); // 4
335 auto p_sigma_y = mkparam(sigmaY); // 5
336
337 // Operator converting Voight and tensor notation
338 auto t_voight_strain_op = voight_to_strain_op();
339
340 // Variable in voight notation
341 auto t_voight_total_strain = getFTensor1FromPtr<6>(&a_sTrain[0]);
342 auto t_voight_plastic_strain = getFTensor1FromPtr<6>(&a_plasticStrain[0]);
343 auto t_voight_internal_tensor =
344 getFTensor1FromPtr<6>(&a_internalVariables[1]);
345
346 // Convert variables to tensor notation
347 tTotalStrain(i, j) = t_voight_strain_op(i, j, Z) * t_voight_total_strain(Z);
348 tPlasticStrain(i, j) =
349 t_voight_strain_op(i, j, Z) * t_voight_plastic_strain(Z);
350 tInternalTensor(i, j) =
351 t_voight_strain_op(i, j, Z) * t_voight_internal_tensor(Z);
352
353 // Evaluate elastic strain
354 tElasticStrain(i, j) = tTotalStrain(i, j) - tPlasticStrain(i, j);
355 tR = tElasticStrain(i, i);
356
357 // Strain energy
358 a_w = 0.5 * p_lambda * tR * tR +
359 p_mu * (tElasticStrain(i, j) * tElasticStrain(i, j));
360 // Isotropic strain energy
361 a_w +=
362 a_internalVariables[0] * p_sigma_y +
363 0.5 * p_phi * p_H * (a_internalVariables[0] * a_internalVariables[0]);
364 // Kinematic strain energy
365 a_w += (0.5 * (1 - p_phi) * p_K) *
366 (tInternalTensor(i, j) * tInternalTensor(i, j));
367
369 }
370 //! [Free energy J2]
371
373
374 //! [Yield function J2]
375 MoFEMErrorCode evalF() {
377 auto t_voight_stress_op = voight_to_stress_op();
378 auto t_vioght_stress = getFTensor1FromPtr<6>(&a_sTress[0]);
379 auto t_back_stress = getFTensor1FromPtr<6>(&a_internalFluxes[1]);
380 tStress(i, j) = t_voight_stress_op(i, j, Z) * t_vioght_stress(Z);
381 tBackStress(i, j) = t_voight_stress_op(i, j, Z) * t_back_stress(Z);
382
384 tR = tStress(i, i) / 3.;
385 tDeviator(i, j) = tStress(i, j) - tR * t_kd(i, j) - tBackStress(i, j);
386
387 // Fix the constant to mach uniaxial test
388 constexpr double c = 3. / 2.;
389 f = c * tDeviator(i, j) * tDeviator(i, j);
390
392 }
393
394 MoFEMErrorCode yieldFunction() {
396 CHKERR evalF();
397 a_y = sqrt(f) - a_internalFluxes[0];
399 }
400 //! [Yield function J2]
401
402 MoFEMErrorCode flowPotential() {
404 CHKERR evalF();
405 a_h = sqrt(f) - a_internalFluxes[0];
407 }
408
409 MoFEMErrorCode codedHessianW(vector<double *> hessian) {
411 lambda = (*paramsArrayPtr)[0];
412 mu = (*paramsArrayPtr)[1];
413 H = (*paramsArrayPtr)[5];
414
415 double lambda_plus_2mu = lambda + 2 * mu;
416 // first 6x6 is \frac{\partial^2 \psi}{\partial \varepsilon^p^2}
417 // lower symmetric part
418 // Diagonal elements
419 hessian[0][0] = lambda_plus_2mu;
420 hessian[1][1] = lambda_plus_2mu;
421 hessian[2][2] = lambda_plus_2mu;
422
423 // Off-diagonal elements
424 hessian[1][0] = lambda;
425 hessian[2][0] = lambda;
426 hessian[2][1] = lambda;
427
428 // Shear components
429 for (int i = 3; i <= 5; ++i) {
430 hessian[i][i] = mu;
431 }
432
433 // next 6x6 is \frac{\partial^2 \psi}{\partial \varepsilon \partial
434 // \varepsilon^p}
435 double neg_lambda_plus_2mu = -(lambda + 2 * mu);
436 double neg_lambda = -lambda;
437 double neg_mu = -mu;
438
439 for (int i = 6; i <= 8; ++i) {
440 for (int j = 0; j <= 2; ++j) {
441 hessian[i][j] = (i - 6 == j) ? neg_lambda_plus_2mu : neg_lambda;
442 }
443 }
444
445 hessian[9][3] = neg_mu;
446 hessian[10][4] = neg_mu;
447 hessian[11][5] = neg_mu;
448
449 // next 6x6 is \frac{\partial^2 \psi}{\partial \varepsilon \partial
450 // \varepsilon}
451 hessian[6][6] = lambda_plus_2mu;
452 hessian[7][6] = lambda;
453 hessian[7][7] = lambda_plus_2mu;
454 hessian[8][6] = lambda;
455 hessian[8][7] = lambda;
456 hessian[8][8] = lambda_plus_2mu;
457 hessian[9][9] = mu;
458 hessian[10][10] = mu;
459 hessian[11][11] = mu;
460
461 // internalVariables is \frac{\partial^2 \psi}{\partial \alpha^2}
462 hessian[12][12] = H;
463
465 }
466};
467
468//! [J2 2D]
469template <> struct J2Plasticity<2> : public J2Plasticity<3> {
470 using J2Plasticity<3>::J2Plasticity;
471
472 MoFEMErrorCode freeHemholtzEnergy() {
474
475 auto p_lambda = mkparam(lambda); // 0
476 auto p_mu = mkparam(mu); // 1
477 auto p_H = mkparam(H); // 2
478 auto p_K = mkparam(K); // 3
479 auto p_phi = mkparam(phi); // 4
480 auto p_sigma_y = mkparam(sigmaY); // 5
481
482 auto t_voight_strain_op = voight_to_strain_op();
483 auto t_voight_total_strain = getFTensor1FromPtr<6>(&a_sTrain[0]);
484 auto t_voight_plastic_strain = getFTensor1FromPtr<6>(&a_plasticStrain[0]);
485 auto t_voight_internal_tensor =
486 getFTensor1FromPtr<6>(&a_internalVariables[1]);
487
488 tTotalStrain(i, j) = t_voight_strain_op(i, j, Z) * t_voight_total_strain(Z);
489 tPlasticStrain(i, j) =
490 t_voight_strain_op(i, j, Z) * t_voight_plastic_strain(Z);
491 tInternalTensor(i, j) =
492 t_voight_strain_op(i, j, Z) * t_voight_internal_tensor(Z);
493
494 tElasticStrain(i, j) = tTotalStrain(i, j) - tPlasticStrain(i, j);
495
496 //! [Plane stress]
497 // Calculate st rain at ezz enforcing plane strain case
498 tElasticStrain(2, 2) =
499 (-tElasticStrain(0, 0) * p_lambda - tElasticStrain(1, 1) * p_lambda) /
500 (p_lambda + 2 * p_mu);
501 //! [Plane stress]
502
503 tR = tElasticStrain(i, i);
504
505 a_w = 0.5 * p_lambda * tR * tR +
506 p_mu * (tElasticStrain(i, j) * tElasticStrain(i, j));
507
508 // plastic part
509 // isotropic
510 a_w +=
511 a_internalVariables[0] * p_sigma_y +
512 0.5 * p_phi * p_H * (a_internalVariables[0] * a_internalVariables[0]);
513 // kinematic
514 a_w += (0.5 * (1 - p_phi) * p_K) *
515 (tInternalTensor(i, j) * tInternalTensor(i, j));
516
518 }
519
520 MoFEMErrorCode codedHessianW(vector<double *> hessian) {
522 // Not implemented yet
523 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
524 "2D Energy Hessian not yet implemented");
526 }
527};
528//! [J2 2D]
529
530/** \brief Paraboloidal yield criterion
531 *
532 * See paper for reference \cite ullah2017three and \cite stier2015comparing
533 *
534 * Linear hardening
535 * \f[
536 * \psi =
537 * \frac{1}{2} \lambda \textrm{tr}[\varepsilon]^2 + \mu \varepsilon :
538 * \varepsilon
539 * +
540 * \sigma_{yt}\alpha_0
541 * +
542 * \frac{1}{2} H_t \alpha_0^2
543 * +
544 * \sigma_{yc}\alpha_1
545 * +
546 * \frac{1}{2} H_c \alpha_1^2
547 * \f]
548 *
549 * Exponential hardening
550 * \f[
551 * \psi =
552 * \frac{1}{2} \lambda \textrm{tr}[\varepsilon]^2 + \mu \varepsilon :
553 * \varepsilon\\
554 * +
555 * (\sigma_{yt}+H_t)\alpha_0
556 * +
557 * \frac{H_t}{n_t} \exp{(-n_t \alpha_0)}\\
558 * +
559 * (\sigma_{yc}+H_c)\alpha_0
560 * +
561 * \frac{H_c}{n_c} \exp{(-n_c \alpha_1)}
562 * \f]
563 *
564 * \f[
565 * I_1 = \textrm{tr} (\boldsymbol{\sigma})
566 * \f]
567 *
568 * \f[
569 * \eta=\textrm{dev}[\boldsymbol{\sigma}]
570 * \f]
571 *
572 * \f[
573 * J_2 = \frac{1}{2} \eta:\eta
574 * \f]
575 *
576 * \f[
577 * y = 6J_2 + 2I_1\left(\overline{\alpha_1}-\overline{\alpha_0}\right) -
578 * 2\overline{\alpha_0} \,\overline{\alpha_1} \f]
579 * where
580 * \f[
581 * \overline{\alpha_0}=\frac{\partial \psi}{\partial \alpha_0}=\sigma_{yt} + H_t
582 * \alpha_0
583 * \f]
584 *
585 * \f[
586 * \overline{\alpha_1}=\frac{\partial \psi}{\partial \alpha_1}=\sigma_{yc} + H_c
587 * \alpha_1
588 * \f]
589 *
590 * \f[
591 * \Psi = 6J_2 + 2\alpha I_1
592 * \left(\overline{\alpha_1}-\overline{\alpha_0}\right)
593 * - 2\overline{\alpha_0} \,\overline{\alpha_1} \f] \f[ \alpha=
594 * \frac{1-2\nu_p}{1+\nu_p}
595 * \f]
596 *
597 * \ingroup adoc_plasticity
598 */
600
605
609
615
617
618 double lambda; //< Lamé parameters
619 double mu; //< Lamé parameter
620 double nup; //< Plastic Poisson’s ratio
621 double Ht, Hc; //< Isotropic hardening for tension and compression
622 double sigmaYt, sigmaYc; //< Yield stress in tension and compression
623 double nt, nc; //< Hardening parameters for tension and compression
624
637
638 using ParamsArray = std::array<double, LAST_PARAM>;
639 boost::shared_ptr<ParamsArray> defaultParamsArrayPtr = nullptr;
640 boost::shared_ptr<ParamsArray> paramsArrayPtr = nullptr;
641 boost::shared_ptr<ParamsArray> oldParamsArrayPtr = nullptr;
642
645
646 double young_modulus = 1;
647 double poisson_ratio = 0.25;
648
649 sigmaYt = 1;
650 sigmaYc = 1;
651 Ht = 0.1;
652 Hc = 0.1;
653 nc = 1.;
654 nt = 1.;
655 nup = 0.;
656
657 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-young_modulus",
658 &young_modulus, PETSC_NULLPTR);
659 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-poisson_ratio",
660 &poisson_ratio, 0);
661 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-sigma_yt", &sigmaYt,
662 PETSC_NULLPTR);
663 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-sigma_yc", &sigmaYc,
664 PETSC_NULLPTR);
665 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-Ht", &Ht, PETSC_NULLPTR);
666 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-Hc", &Hc, PETSC_NULLPTR);
667 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-nt", &nt, PETSC_NULLPTR);
668 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-nc", &nc, PETSC_NULLPTR);
669 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-nup", &nup, PETSC_NULLPTR);
670
671 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
672 << "Young modulus: " << young_modulus;
673 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
674 << "Poisson ratio: " << poisson_ratio;
675
678
679 defaultParamsArrayPtr = boost::make_shared<ParamsArray>();
680 (*defaultParamsArrayPtr)[LAMBDA] = lambda;
681 (*defaultParamsArrayPtr)[MU] = mu;
682 (*defaultParamsArrayPtr)[NUP] = nup;
683 (*defaultParamsArrayPtr)[SIGMA_YT] = sigmaYt;
684 (*defaultParamsArrayPtr)[SIGMA_YC] = sigmaYc;
685 (*defaultParamsArrayPtr)[HT] = Ht;
686 (*defaultParamsArrayPtr)[HC] = Hc;
687 (*defaultParamsArrayPtr)[NT] = nt;
688 (*defaultParamsArrayPtr)[NC] = nc;
689
690 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
691 << "LAMBDA: " << (*defaultParamsArrayPtr)[LAMBDA];
692 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
693 << "MU: " << (*defaultParamsArrayPtr)[MU];
694 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
695 << "NUP: " << (*defaultParamsArrayPtr)[NUP];
696 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
697 << "SIGMA_YT: " << (*defaultParamsArrayPtr)[SIGMA_YT];
698 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
699 << "SIGMA_YC: " << (*defaultParamsArrayPtr)[SIGMA_YC];
700 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
701 << "HT: " << (*defaultParamsArrayPtr)[HT];
702 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
703 << "HC: " << (*defaultParamsArrayPtr)[HC];
704 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
705 << "NT: " << (*defaultParamsArrayPtr)[NT];
706 MOFEM_LOG("ADOLCPlasticityWold", Sev::inform)
707 << "NC: " << (*defaultParamsArrayPtr)[NC];
708
709 paramsArrayPtr = boost::make_shared<ParamsArray>();
710 std::copy(defaultParamsArrayPtr->begin(), defaultParamsArrayPtr->end(),
711 paramsArrayPtr->begin());
712 oldParamsArrayPtr = boost::make_shared<ParamsArray>();
713 std::fill(oldParamsArrayPtr->begin(), oldParamsArrayPtr->end(), 0);
714
716 };
717
718 MoFEMErrorCode
720 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
721 std::string block_name, Sev sev) {
723
724 struct OpMatBlocks : public ForcesAndSourcesCore::UserDataOperator {
725
726 using OP = ForcesAndSourcesCore::UserDataOperator;
727
728 OpMatBlocks(boost::shared_ptr<ParamsArray> params_array_ptr,
729 boost::shared_ptr<ParamsArray> def_params_array_ptr,
730 MoFEM::Interface &m_field, Sev sev,
731 std::vector<const CubitMeshSets *> meshset_vec_ptr)
732 : OP(NOSPACE, OP::OPSPACE), paramsArrayPtr(params_array_ptr),
733 defParamsArray(def_params_array_ptr) {
734 CHK_THROW_MESSAGE(extractBlockData(m_field, meshset_vec_ptr, sev),
735 "Can not get data from block");
736 }
737
738 MoFEMErrorCode doWork(int side, EntityType type,
739 EntitiesFieldData::EntData &data) {
741
742 for (auto &b : blockData) {
743
744 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
745 std::copy(b.paramsArray.begin(), b.paramsArray.end(),
746 paramsArrayPtr->begin());
748 }
749 }
750
751 std::copy(defParamsArray->begin(), defParamsArray->end(),
752 paramsArrayPtr->begin());
753
755 }
756
757 private:
758 boost::shared_ptr<ParamsArray> paramsArrayPtr;
759 boost::shared_ptr<ParamsArray> defParamsArray;
760
761 struct BlockData {
762 ParamsArray paramsArray;
763 Range blockEnts;
764 };
765
766 std::vector<BlockData> blockData;
767
768 MoFEMErrorCode
769 extractBlockData(MoFEM::Interface &m_field,
770 std::vector<const CubitMeshSets *> meshset_vec_ptr,
771 Sev sev) {
773
774 for (auto m : meshset_vec_ptr) {
775 MOFEM_TAG_AND_LOG("ADOLCPlasticityWold", sev, "Paraboloidal") << *m;
776 std::vector<double> block_data;
777 CHKERR m->getAttributes(block_data);
778 if (block_data.size() != 9) {
779 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
780 "Expected that block has nine attributes");
781 }
782 auto get_block_ents = [&]() {
783 Range ents;
784 CHKERR
785 m_field.get_moab().get_entities_by_handle(m->meshset, ents, true);
786 return ents;
787 };
788
789 blockData.push_back({*defParamsArray, get_block_ents()});
790 std::copy(block_data.begin(), block_data.end(),
791 blockData.back().paramsArray.begin());
792
793 const auto young_modulus = blockData.back().paramsArray[LAMBDA];
794 const auto poisson_ratio = blockData.back().paramsArray[MU];
795
796 // It is assumed that user provide young_modulus and poisson_ratio in
797 // first two arguments of the block
798
799 MOFEM_LOG("ADOLCPlasticityWold", sev)
800 << "Young modulus: " << (blockData.back().paramsArray)[LAMBDA];
801 MOFEM_LOG("ADOLCPlasticityWold", sev)
802 << "Poisson ratio: " << (blockData.back().paramsArray)[MU];
803
804 blockData.back().paramsArray[LAMBDA] =
806 blockData.back().paramsArray[MU] = MU(young_modulus, poisson_ratio);
807
808 MOFEM_LOG("ADOLCPlasticityWold", sev)
809 << "LAMBDA: " << (blockData.back().paramsArray)[LAMBDA];
810 MOFEM_LOG("ADOLCPlasticityWold", sev)
811 << "MU: " << (blockData.back().paramsArray)[MU];
812 MOFEM_LOG("ADOLCPlasticityWold", sev)
813 << "NUP: " << (blockData.back().paramsArray)[NUP];
814 MOFEM_LOG("ADOLCPlasticityWold", sev)
815 << "SIGMA_YT: " << (blockData.back().paramsArray)[SIGMA_YT];
816 MOFEM_LOG("ADOLCPlasticityWold", sev)
817 << "SIGMA_YC: " << (blockData.back().paramsArray)[SIGMA_YC];
818 MOFEM_LOG("ADOLCPlasticityWold", sev)
819 << "HT: " << (blockData.back().paramsArray)[HT];
820 MOFEM_LOG("ADOLCPlasticityWold", sev)
821 << "HC: " << (blockData.back().paramsArray)[HC];
822 MOFEM_LOG("ADOLCPlasticityWold", sev)
823 << "NT: " << (blockData.back().paramsArray)[NT];
824 MOFEM_LOG("ADOLCPlasticityWold", sev)
825 << "NC: " << (blockData.back().paramsArray)[NC];
826 }
828 }
829 };
830
831 auto cubit_meshsets_vec_ptr =
832 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
833 std::regex((boost::format("%s(.*)") % block_name).str()));
834
835 pip.push_back(new OpMatBlocks(paramsArrayPtr, defaultParamsArrayPtr,
836 m_field, sev, cubit_meshsets_vec_ptr));
837
839 }
840
841 MoFEMErrorCode setParams(short tag, bool &recalculate_elastic_tangent) {
843 switch (tag) {
844 case TypesTags::W: {
845 set_param_vec(tapesTags[tag], paramsArrayPtr->size(),
846 paramsArrayPtr->data());
847 for (auto p = 0; p != LAST_PARAM; p++) {
848 if ((*paramsArrayPtr)[p] != (*oldParamsArrayPtr)[p]) {
849 recalculate_elastic_tangent = true;
850 std::copy(paramsArrayPtr->begin(), paramsArrayPtr->end(),
851 oldParamsArrayPtr->begin());
852 break;
853 }
854 }
855
856 } break;
857 case TypesTags::Y:
858 case TypesTags::H:
859 break;
860 default:
861 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
862 "Unknown tag for setParams");
863 }
865 return 0;
866 }
867
868 //! [Paraboloidal free energy]
869 MoFEMErrorCode freeHemholtzEnergy() {
871
872 auto p_lambda = mkparam(lambda); // 0
873 auto p_mu = mkparam(mu); // 1
874 auto p_nup = mkparam(nup); // 2
875 auto p_sigma_yt = mkparam(sigmaYt); // 3
876 auto p_sigma_yc = mkparam(sigmaYc); // 4
877 auto p_Ht = mkparam(Ht); // 5
878 auto p_Hc = mkparam(Hc); // 6
879 auto p_nt = mkparam(nt); // 7
880 auto p_nc = mkparam(nc); // 8
881
882 auto t_voight_strain_op = voight_to_strain_op();
883 auto t_voight_total_strain = getFTensor1FromPtr<6>(&a_sTrain[0]);
884 auto t_voight_plastic_strain = getFTensor1FromPtr<6>(&a_plasticStrain[0]);
885
886 tTotalStrain(i, j) = t_voight_strain_op(i, j, Z) * t_voight_total_strain(Z);
887 tPlasticStrain(i, j) =
888 t_voight_strain_op(i, j, Z) * t_voight_plastic_strain(Z);
890 tR = tElasticStrain(i, i);
891
892 a_w = 0.5 * p_lambda * tR * tR +
893 p_mu * (tElasticStrain(i, j) * tElasticStrain(i, j));
894
895 a_w += p_sigma_yt * a_internalVariables[0] +
896 0.5 * p_Ht * a_internalVariables[0] * a_internalVariables[0];
897 a_w += p_sigma_yc * a_internalVariables[1] +
898 0.5 * p_Hc * a_internalVariables[1] * a_internalVariables[1];
899
901 }
902 //! [Paraboloidal free energy]
903
904 MoFEMErrorCode codedHessianW(vector<double *> hessian) {
906 // first 6x6 is \frac{\partial^2 \psi}{\partial \varepsilon^p^2}
907 // lower symmetric part
908
909 lambda = (*paramsArrayPtr)[0];
910 mu = (*paramsArrayPtr)[1];
911
912 Ht = (*paramsArrayPtr)[5];
913 Hc = (*paramsArrayPtr)[6];
914
915 double lambda_plus_2mu = lambda + 2 * mu;
916
917 // Diagonal elements
918 hessian[0][0] = lambda_plus_2mu;
919 hessian[1][1] = lambda_plus_2mu;
920 hessian[2][2] = lambda_plus_2mu;
921
922 // Off-diagonal elements
923 hessian[1][0] = lambda;
924 hessian[2][0] = lambda;
925 hessian[2][1] = lambda;
926
927 // Shear components
928 for (int i = 3; i <= 5; ++i) {
929 hessian[i][i] = mu;
930 }
931
932 // next 6x6 is \frac{\partial^2 \psi}{\partial \varepsilon \partial
933 // \varepsilon^p}
934 double neg_lambda_plus_2mu = -(lambda + 2 * mu);
935 double neg_lambda = -lambda;
936 double neg_mu = -mu;
937
938 for (int i = 6; i <= 8; ++i) {
939 for (int j = 0; j <= 2; ++j) {
940 hessian[i][j] = (i - 6 == j) ? neg_lambda_plus_2mu : neg_lambda;
941 }
942 }
943
944 hessian[9][3] = neg_mu;
945 hessian[10][4] = neg_mu;
946 hessian[11][5] = neg_mu;
947
948 // next 6x6 is \frac{\partial^2 \psi}{\partial \varepsilon \partial
949 // \varepsilon}
950 hessian[6][6] = lambda_plus_2mu;
951 hessian[7][6] = lambda;
952 hessian[7][7] = lambda_plus_2mu;
953 hessian[8][6] = lambda;
954 hessian[8][7] = lambda;
955 hessian[8][8] = lambda_plus_2mu;
956 hessian[9][9] = mu;
957 hessian[10][10] = mu;
958 hessian[11][11] = mu;
959
960 // internalVariables is \frac{\partial^2 \psi}{\partial \alpha^2}
961 hessian[12][12] = Ht;
962 hessian[13][13] = Hc;
963
965 }
966
968
969 //! [Paraboloidal yield function]
970 MoFEMErrorCode evalF() {
972 auto t_voight_stress_op = voight_to_stress_op();
973 auto t_vioght_stress = getFTensor1FromPtr<6>(&a_sTress[0]);
974 tStress(i, j) = t_voight_stress_op(i, j, Z) * t_vioght_stress(Z);
975 tR = tStress(i, i);
976 I1 = tR;
978 tR /= 3.;
979 tDeviator(i, j) = tStress(i, j) - tR * t_kd(i, j);
980 J2 = 0.5 * (tDeviator(i, j) * tDeviator(i, j));
982 }
983
984 MoFEMErrorCode yieldFunction() {
986 CHKERR evalF();
987 a_y = 6 * J2 + 2 * I1 * (a_internalFluxes[1] - a_internalFluxes[0]) -
990 }
991 //! [Paraboloidal yield function]
992
993 //! [Paraboloidal flow potential]
994 MoFEMErrorCode flowPotential() {
996 CHKERR evalF();
997 double alpha =
998 (1 - 2 * nup) /
999 (1 + nup); // relation between alpha and plastic poisson's ratio
1000 a_h = 6 * J2 +
1001 2 * alpha * I1 * (a_internalFluxes[1] - a_internalFluxes[0]) -
1004 }
1005 //! [Paraboloidal flow potential]
1006};
1007
1009
1011
1012 MoFEMErrorCode
1014 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
1015 std::string block_name, Sev sev) override {
1017
1018 struct OpMatBlocks : public ForcesAndSourcesCore::UserDataOperator {
1019
1020 using OP = ForcesAndSourcesCore::UserDataOperator;
1021
1022 double poissonRatio = 0.25;
1023 Tag thYoungModulus;
1024 Tag thCompressiveYieldStress;
1025 Tag thTensionYieldStress;
1026 double youngsModulus;
1027 double yieldStrengthC;
1028 double yieldStrengthT;
1029
1030 OpMatBlocks(boost::shared_ptr<ParamsArray> params_array_ptr,
1031 boost::shared_ptr<ParamsArray> def_params_array_ptr,
1032 MoFEM::Interface &m_field, Sev sev,
1033 std::vector<const CubitMeshSets *> meshset_vec_ptr)
1034 : OP(NOSPACE, OP::OPSPACE), paramsArrayPtr(params_array_ptr),
1035 defParamsArray(def_params_array_ptr), mField(m_field) {
1036 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-poisson_ratio",
1037 &poissonRatio, 0);
1038 rval = mField.get_moab().tag_get_handle(
1039 "YOUNGS_MODULUS", 1, MB_TYPE_DOUBLE, thYoungModulus, MB_TAG_SPARSE);
1040 if (rval != MB_SUCCESS) {
1041 MOFEM_LOG("ADOLCPlasticityWold", Sev::warning)
1042 << "YOUNGS_MODULUS tag does not exist using default value";
1043 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-young_modulus",
1044 &youngsModulus, 0);
1045 }
1046
1047 rval = mField.get_moab().tag_get_handle(
1048 "Yield_Strength_C", 1, MB_TYPE_DOUBLE, thCompressiveYieldStress,
1049 MB_TAG_SPARSE);
1050
1051 if (rval != MB_SUCCESS) {
1052 MOFEM_LOG("ADOLCPlasticityWold", Sev::warning)
1053 << "Yield_Strength_C tag does not exist using default value";
1054 yieldStrengthC = defParamsArray->at(SIGMA_YC);
1055 }
1056
1057 rval = mField.get_moab().tag_get_handle(
1058 "Yield_Strength_T", 1, MB_TYPE_DOUBLE, thTensionYieldStress,
1059 MB_TAG_SPARSE);
1060
1061 if (rval != MB_SUCCESS) {
1062 MOFEM_LOG("ADOLCPlasticityWold", Sev::warning)
1063 << "Yield_Strength_T tag does not exist using default value";
1064 yieldStrengthT = defParamsArray->at(SIGMA_YT);
1065 }
1066
1067 CHK_THROW_MESSAGE(extractBlockData(m_field, meshset_vec_ptr, sev),
1068 "Can not get data from block");
1069 }
1070
1071 MoFEMErrorCode doWork(int side, EntityType type,
1072 EntitiesFieldData::EntData &data) {
1074
1075 for (auto &b : blockData) {
1076
1077 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
1078 EntityHandle fe_ent = getFEEntityHandle();
1079
1080 if (thYoungModulus != 0)
1081 CHKERR mField.get_moab().tag_get_data(thYoungModulus, &fe_ent, 1,
1082 &youngsModulus);
1083
1084 if (thCompressiveYieldStress != 0)
1085 CHKERR mField.get_moab().tag_get_data(
1086 thCompressiveYieldStress, &fe_ent, 1, &yieldStrengthC);
1087
1088 if (thTensionYieldStress != 0)
1089 CHKERR mField.get_moab().tag_get_data(
1090 thTensionYieldStress, &fe_ent, 1, &yieldStrengthT);
1091
1092 std::copy(b.paramsArray.begin(), b.paramsArray.end(),
1093 paramsArrayPtr->begin());
1094
1095 (*paramsArrayPtr)[LAMBDA] = LAMBDA(youngsModulus, poissonRatio);
1096 (*paramsArrayPtr)[MU] = MU(youngsModulus, poissonRatio);
1097 (*paramsArrayPtr)[SIGMA_YC] = yieldStrengthC;
1098 (*paramsArrayPtr)[SIGMA_YT] = yieldStrengthT;
1099
1101 }
1102 }
1103
1104 std::copy(defParamsArray->begin(), defParamsArray->end(),
1105 paramsArrayPtr->begin());
1106
1108 }
1109
1110 private:
1111 boost::shared_ptr<ParamsArray> paramsArrayPtr;
1112 boost::shared_ptr<ParamsArray> defParamsArray;
1114
1115 struct BlockData {
1116 ParamsArray paramsArray;
1117 Range blockEnts;
1118 };
1119
1120 std::vector<BlockData> blockData;
1121
1122 MoFEMErrorCode
1123 extractBlockData(MoFEM::Interface &m_field,
1124 std::vector<const CubitMeshSets *> meshset_vec_ptr,
1125 Sev sev) {
1127
1128 for (auto m : meshset_vec_ptr) {
1129 MOFEM_TAG_AND_LOG("ADOLCPlasticityWold", sev,
1130 "Heterogeneous Paraboloidal")
1131 << *m;
1132 std::vector<double> block_data;
1133 CHKERR m->getAttributes(block_data);
1134 if (block_data.size() != 0) {
1135 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1136 "Expected that block has zero attributes");
1137 }
1138 auto get_block_ents = [&]() {
1139 Range ents;
1140 CHKERR
1141 m_field.get_moab().get_entities_by_handle(m->meshset, ents, true);
1142 return ents;
1143 };
1144
1145 blockData.push_back({*defParamsArray, get_block_ents()});
1146 std::copy(block_data.begin(), block_data.end(),
1147 blockData.back().paramsArray.begin());
1148 const auto young_modulus = blockData.back().paramsArray[LAMBDA];
1149 const auto poisson_ratio = blockData.back().paramsArray[MU];
1150
1151 // It is assumed that user provide young_modulus and poisson_ratio in
1152 // first two arguments of the block
1153
1154 MOFEM_LOG("ADOLCPlasticityWold", sev)
1155 << "Young modulus: " << (blockData.back().paramsArray)[LAMBDA];
1156 MOFEM_LOG("ADOLCPlasticityWold", sev)
1157 << "Poisson ratio: " << (blockData.back().paramsArray)[MU];
1158
1159 blockData.back().paramsArray[LAMBDA] =
1161 blockData.back().paramsArray[MU] = MU(young_modulus, poisson_ratio);
1162
1163 MOFEM_LOG("ADOLCPlasticityWold", sev)
1164 << "LAMBDA: " << (blockData.back().paramsArray)[LAMBDA];
1165 MOFEM_LOG("ADOLCPlasticityWold", sev)
1166 << "MU: " << (blockData.back().paramsArray)[MU];
1167 MOFEM_LOG("ADOLCPlasticityWold", sev)
1168 << "NUP: " << (blockData.back().paramsArray)[NUP];
1169 MOFEM_LOG("ADOLCPlasticityWold", sev)
1170 << "SIGMA_YT: " << (blockData.back().paramsArray)[SIGMA_YT];
1171 MOFEM_LOG("ADOLCPlasticityWold", sev)
1172 << "SIGMA_YC: " << (blockData.back().paramsArray)[SIGMA_YC];
1173 MOFEM_LOG("ADOLCPlasticityWold", sev)
1174 << "HT: " << (blockData.back().paramsArray)[HT];
1175 MOFEM_LOG("ADOLCPlasticityWold", sev)
1176 << "HC: " << (blockData.back().paramsArray)[HC];
1177 MOFEM_LOG("ADOLCPlasticityWold", sev)
1178 << "NT: " << (blockData.back().paramsArray)[NT];
1179 MOFEM_LOG("ADOLCPlasticityWold", sev)
1180 << "NC: " << (blockData.back().paramsArray)[NC];
1181 }
1183 }
1184 };
1185
1186 auto cubit_meshsets_vec_ptr =
1187 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
1188 std::regex((boost::format("%s(.*)") % block_name).str()));
1189
1190 pip.push_back(new OpMatBlocks(paramsArrayPtr, defaultParamsArrayPtr,
1191 m_field, sev, cubit_meshsets_vec_ptr));
1192
1194 }
1195};
1196
1197template <typename MODEL>
1198inline auto createMaterial(
1199 std::array<int, ClosestPointProjection::LAST_TAPE> tapes_tags = {0, 1, 2}) {
1200 auto cp_ptr = boost::make_shared<MODEL>();
1201 cp_ptr->getDefaultMaterialParameters();
1202 cp_ptr->createMatAVecR();
1203 cp_ptr->snesCreate();
1204 cp_ptr->recordTapes();
1205 cp_ptr->tapesTags = tapes_tags;
1206 return cp_ptr;
1207}
1208
1209} // namespace ADOLCPlasticity
1210
1211#endif //__ADOLC_MATERIAL_MODELS_HPP
MoFEM::Interface & mField
Tag tag
std::string type
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
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
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MU(E, NU)
Definition fem_tools.h:23
#define LAMBDA(E, NU)
Definition fem_tools.h:22
constexpr auto t_kd
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
static double lambda
const double c
speed of light (cm/ns)
FTensor::Index< 'j', 3 > j
FTensor::Dg< double, 3, 6 > voight_to_stress_op()
Op convert Vight stress vector to stress tensor.
auto createMaterial(std::array< int, ClosestPointProjection::LAST_TAPE > tapes_tags={0, 1, 2})
FTensor::Dg< double, 3, 6 > voight_to_strain_op()
Op convert Vight strain vector to strain tensor.
double young_modulus
Young modulus.
Definition plastic.cpp:126
double poisson_ratio
Poisson ratio.
Definition plastic.cpp:127
double H
Hardening.
Definition plastic.cpp:129
double sigmaY
Yield stress.
Definition plastic.cpp:128
static double phi
FTensor::Index< 'm', 3 > m
Closest point projection algorithm.
std::array< int, LAST_TAPE > tapesTags
MoFEMErrorCode addMatBlockOps(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string block_name, Sev sev) override
Get model parameters from blocks.
MoFEMErrorCode codedHessianW(vector< double * > hessian)
MoFEMErrorCode freeHemholtzEnergy()
Set Hemholtz energy.
MoFEMErrorCode flowPotential()
[Yield function J2]
MoFEMErrorCode codedHessianW(vector< double * > hessian)
MoFEMErrorCode evalF()
[Yield function J2]
MoFEMErrorCode addMatBlockOps(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string block_name, Sev sev)
Get material parameters from block.
FTensor::Tensor2_symmetric< adouble, 3 > tInternalTensor
MoFEMErrorCode yieldFunction()
Set yield function.
FTensor::Tensor2_symmetric< adouble, 3 > tPlasticStrain
FTensor::Tensor2_symmetric< adouble, 3 > tTotalStrain
FTensor::Tensor2_symmetric< adouble, 3 > tDeviator
FTensor::Tensor2_symmetric< adouble, 3 > tElasticStrain
MoFEMErrorCode freeHemholtzEnergy()
[Free energy J2]
FTensor::Tensor2_symmetric< adouble, 3 > tStress
MoFEMErrorCode setParams(short tag, bool &recalculate_elastic_tangent)
Set material parameters at integration point.
FTensor::Tensor2_symmetric< adouble, 3 > tBackStress
J2 plasticity (Kinematic Isotropic (Linear) Hardening)
MoFEMErrorCode addMatBlockOps(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string block_name, Sev sev)
Get model parameters from blocks.
MoFEMErrorCode codedHessianW(vector< double * > hessian)
[Paraboloidal free energy]
FTensor::Tensor2_symmetric< adouble, 3 > tDeviator
MoFEMErrorCode evalF()
[Paraboloidal yield function]
FTensor::Tensor2_symmetric< adouble, 3 > tPlasticStrain
FTensor::Tensor2_symmetric< adouble, 3 > tTotalStrain
FTensor::Tensor2_symmetric< adouble, 3 > tElasticStrain
MoFEMErrorCode setParams(short tag, bool &recalculate_elastic_tangent)
Set parameters for ADOL-C of constitutive relations.
MoFEMErrorCode freeHemholtzEnergy()
[Paraboloidal free energy]
FTensor::Tensor2_symmetric< adouble, 3 > tStress
MoFEMErrorCode flowPotential()
[Paraboloidal yield function]
virtual moab::Interface & get_moab()=0
Deprecated interface functions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.