381 {
383
390
392
393 auto nb_gauss_pts = DomainEleOp::getGaussPts().size2();
394 auto t_w = DomainEleOp::getFTensor0IntegrationWeight();
396 auto t_tau_dot = getFTensor0FromVec(
commonDataPtr->plasticTauDot);
397 auto t_f = getFTensor0FromVec(
commonDataPtr->plasticSurface);
398 auto t_flow = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticFlow);
399 auto t_plastic_strain =
400 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticStrain);
401 auto t_plastic_strain_dot =
402 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticStrainDot);
403 auto t_stress = getFTensor2SymmetricFromMat<DIM>(*(
commonDataPtr->mStressPtr));
404
405 auto t_D_Op = getFTensor4DdgFromMat<DIM, DIM, 0>(*
mDPtr);
406
407 auto t_diff_plastic_strain = FTensor::diff_tensor<double>();
408 auto t_diff_deviator = FTensor::diff_deviator<double, DIM>();
409
412 t_flow_dir_dstress(
i,
j,
k,
l) =
413 1.5 * (t_diff_deviator(
M,
N,
i,
j) * t_diff_deviator(
M,
N,
k,
l));
414 t_flow_dir_dstrain(
i,
j,
k,
l) =
415 t_flow_dir_dstress(
i,
j,
m,
n) * t_D_Op(
m,
n,
k,
l);
416
417
418 auto t_alpha_dir =
420
428 false);
430 false);
431
440
442 auto t_res_c_dtau = getFTensor0FromVec(
commonDataPtr->resCdTau);
443 auto t_res_c_dstrain =
444 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resCdStrain);
445 auto t_res_c_plastic_strain =
446 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resCdPlasticStrain);
447 auto t_res_flow = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resFlow);
448 auto t_res_flow_dtau =
449 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resFlowDtau);
450 auto t_res_flow_dstrain =
451 getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->resFlowDstrain);
452 auto t_res_flow_dplastic_strain =
453 getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->resFlowDstrainDot);
454
455 auto next = [&]() {
456 ++t_tau;
457 ++t_tau_dot;
458 ++t_f;
459 ++t_flow;
460 ++t_plastic_strain;
461 ++t_plastic_strain_dot;
462 ++t_stress;
463 ++t_res_c;
464 ++t_res_c_dtau;
465 ++t_res_c_dstrain;
466 ++t_res_c_plastic_strain;
467 ++t_res_flow;
468 ++t_res_flow_dtau;
469 ++t_res_flow_dstrain;
470 ++t_res_flow_dplastic_strain;
471 ++t_w;
472 };
473
474 auto get_avtive_pts = [&]() {
475 int nb_points_avtive_on_elem = 0;
476 int nb_points_on_elem = 0;
477
479 auto t_tau_dot = getFTensor0FromVec(
commonDataPtr->plasticTauDot);
480 auto t_f = getFTensor0FromVec(
commonDataPtr->plasticSurface);
481 auto t_plastic_strain_dot =
482 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->plasticStrainDot);
483
484 auto dt = this->getTStimeStep();
485
486 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
489 eqiv, t_tau_dot, t_f,
494
495 ++nb_points_on_elem;
496 if (sign_ww > 0) {
497 ++nb_points_avtive_on_elem;
498 }
499
500 ++t_tau;
501 ++t_tau_dot;
502 ++t_f;
503 ++t_plastic_strain_dot;
504 }
505
511
512 ++nb_elements;
513 nb_points += nb_points_on_elem;
514 if (nb_points_avtive_on_elem > 0) {
515 ++avtive_elems;
516 active_points += nb_points_avtive_on_elem;
517 if (nb_points_avtive_on_elem == nb_points_on_elem) {
518 ++avtive_full_elems;
519 }
520 }
521
522 if (nb_points_avtive_on_elem != nb_points_on_elem)
523 return 1;
524 else
525 return 0;
526 };
527
528 if (DomainEleOp::getTSCtx() == TSMethod::TSContext::CTX_TSSETIJACOBIAN) {
529 get_avtive_pts();
530 }
531
532 auto dt = this->getTStimeStep();
533 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
534
537 t_diff_plastic_strain,
539
540 const auto sigma_y =
543 const auto d_sigma_y =
546
550
551 auto c =
constraint(eqiv, t_tau_dot, t_f, sigma_y, abs_ww,
560
562
563 t_stress,
trace(t_stress),
564
566
567 );
568
570 t_flow_dir(
k,
l) = 1.5 * (t_dev_stress(
I,
J) * t_diff_deviator(
I,
J,
k,
l));
572 t_flow_dstrain(
i,
j) = t_flow(
k,
l) * t_D_Op(
k,
l,
i,
j);
573
574 auto get_res_c = [&]() {
return c; };
575
576 auto get_res_c_dstrain = [&](auto &t_diff_res) {
577 t_diff_res(
i,
j) = c_f * t_flow_dstrain(
i,
j);
578 };
579
580 auto get_res_c_dplastic_strain = [&](auto &t_diff_res) {
581 t_diff_res(
i,
j) = (this->getTSa() * c_equiv) * t_diff_eqiv(
i,
j);
582 t_diff_res(
k,
l) -= c_f * t_flow(
i,
j) * t_alpha_dir(
i,
j,
k,
l);
583 };
584
585 auto get_res_c_dtau = [&]() {
586 return this->getTSa() * c_dot_tau + c_sigma_y * d_sigma_y;
587 };
588
589 [[maybe_unused]] auto get_res_c_plastic_strain = [&](auto &t_diff_res) {
590 t_diff_res(
k,
l) = -c_f * t_flow(
i,
j) * t_alpha_dir(
i,
j,
k,
l);
591 };
592
593 auto get_res_flow = [&](auto &t_res_flow) {
594 const auto a = sigma_y;
595 const auto b = t_tau_dot;
596 t_res_flow(
k,
l) =
a * t_plastic_strain_dot(
k,
l) - b * t_flow_dir(
k,
l);
597 };
598
599 auto get_res_flow_dtau = [&](auto &t_res_flow_dtau) {
600 const auto da = d_sigma_y;
601 const auto db = this->getTSa();
602 t_res_flow_dtau(
k,
l) =
603 da * t_plastic_strain_dot(
k,
l) - db * t_flow_dir(
k,
l);
604 };
605
606 auto get_res_flow_dstrain = [&](auto &t_res_flow_dstrain) {
607 const auto b = t_tau_dot;
608 t_res_flow_dstrain(
m,
n,
k,
l) = -t_flow_dir_dstrain(
m,
n,
k,
l) * b;
609 };
610
611 auto get_res_flow_dplastic_strain = [&](auto &t_res_flow_dplastic_strain) {
612 const auto a = sigma_y;
613 t_res_flow_dplastic_strain(
m,
n,
k,
l) =
614 (
a * this->getTSa()) * t_diff_plastic_strain(
m,
n,
k,
l);
615 const auto b = t_tau_dot;
616 t_res_flow_dplastic_strain(
m,
n,
i,
j) +=
617 (t_flow_dir_dstrain(
m,
n,
k,
l) * t_alpha_dir(
k,
l,
i,
j)) * b;
618 };
619
620 t_res_c = get_res_c();
621 get_res_flow(t_res_flow);
622
623 if (this->getTSCtx() == TSMethod::TSContext::CTX_TSSETIJACOBIAN) {
624 t_res_c_dtau = get_res_c_dtau();
625 get_res_c_dstrain(t_res_c_dstrain);
626 get_res_c_dplastic_strain(t_res_c_plastic_strain);
627 get_res_flow_dtau(t_res_flow_dtau);
628 get_res_flow_dstrain(t_res_flow_dstrain);
629 get_res_flow_dplastic_strain(t_res_flow_dplastic_strain);
630 }
631
632 next();
633 }
634
636}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
FTensor::Index< 'N', 3 > N
double diff_constrain_ddot_tau(double sign, double eqiv, double dot_tau, double vis_H, double sigma_Y)
double constrian_sign(double x, double dt)
FTensor::Index< 'J', 3 > J
double diff_constrain_deqiv(double sign, double eqiv, double dot_tau, double sigma_Y)
auto diff_equivalent_strain_dot(const T1 eqiv, T2 &t_plastic_strain_dot, T3 &t_diff_plastic_strain, FTensor::Number< DIM >)
double constraint(double eqiv, double dot_tau, double f, double sigma_y, double abs_w, double vis_H, double sigma_Y)
auto diff_constrain_df(double sign)
auto diff_constrain_dsigma_y(double sign)
FTensor::Index< 'I', 3 > I
[Common data]
double trace(FTensor::Tensor2_symmetric< T, 2 > &t_stress)
auto deviator(FTensor::Tensor2_symmetric< T, DIM > &t_stress, double trace, FTensor::Tensor2_symmetric< double, DIM > &t_alpha, FTensor::Number< DIM >)
double w(double eqiv, double dot_tau, double f, double sigma_y, double sigma_Y)
auto equivalent_strain_dot(FTensor::Tensor2_symmetric< T, DIM > &t_plastic_strain_dot)
double constrain_abs(double x, double dt)
FTensor::Index< 'm', 3 > m
static std::array< int, 5 > activityData
auto kinematic_hardening(FTensor::Tensor2_symmetric< T, DIM > &t_plastic_strain, double C1_k)
double iso_hardening_dtau(double tau, double H, double Qinf, double b_iso)
double iso_hardening(double tau, double H, double Qinf, double b_iso, double sigmaY)