492 {
494
501
503
504 auto nb_gauss_pts = DomainEleOp::getGaussPts().size2();
505 auto t_w = DomainEleOp::getFTensor0IntegrationWeight();
507 auto t_tau_dot = getFTensor0FromVec(
commonDataPtr->plasticTauDot);
508 auto t_f = getFTensor0FromVec(
commonDataPtr->plasticSurface);
509 auto t_flow = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticFlow);
510 auto t_plastic_strain =
511 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticStrain);
512 auto t_plastic_strain_dot =
513 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticStrainDot);
514 auto t_stress = getFTensor2SymmetricFromMat<DIM>(*(
commonDataPtr->mStressPtr));
515
516 auto t_D_Op = getFTensor4DdgFromMat<DIM, DIM, 0>(*
mDPtr);
517
520
523 t_flow_dir_dstress(
i,
j,
k,
l) =
524 1.5 * (t_diff_deviator(
M,
N,
i,
j) * t_diff_deviator(
M,
N,
k,
l));
525 t_flow_dir_dstrain(
i,
j,
k,
l) =
526 t_flow_dir_dstress(
i,
j,
m,
n) * t_D_Op(
m,
n,
k,
l);
527
528
529 auto t_alpha_dir =
531
539 false);
541 false);
542
551
553 auto t_res_c_dtau = getFTensor0FromVec(
commonDataPtr->resCdTau);
554 auto t_res_c_dstrain =
555 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resCdStrain);
556 auto t_res_c_plastic_strain =
557 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resCdPlasticStrain);
558 auto t_res_flow = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resFlow);
559 auto t_res_flow_dtau =
560 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resFlowDtau);
561 auto t_res_flow_dstrain =
562 getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->resFlowDstrain);
563 auto t_res_flow_dplastic_strain =
564 getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->resFlowDstrainDot);
565
566 auto next = [&]() {
567 ++t_tau;
568 ++t_tau_dot;
569 ++t_f;
570 ++t_flow;
571 ++t_plastic_strain;
572 ++t_plastic_strain_dot;
573 ++t_stress;
574 ++t_res_c;
575 ++t_res_c_dtau;
576 ++t_res_c_dstrain;
577 ++t_res_c_plastic_strain;
578 ++t_res_flow;
579 ++t_res_flow_dtau;
580 ++t_res_flow_dstrain;
581 ++t_res_flow_dplastic_strain;
582 ++t_w;
583 };
584
585 auto get_avtive_pts = [&]() {
586 int nb_points_avtive_on_elem = 0;
587 int nb_points_on_elem = 0;
588
590 auto t_tau_dot = getFTensor0FromVec(
commonDataPtr->plasticTauDot);
591 auto t_f = getFTensor0FromVec(
commonDataPtr->plasticSurface);
592 auto t_plastic_strain_dot =
593 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->plasticStrainDot);
594
595 auto dt = this->getTStimeStep();
596
597 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
600 eqiv, t_tau_dot, t_f,
605
606 ++nb_points_on_elem;
607 if (sign_ww > 0) {
608 ++nb_points_avtive_on_elem;
609 }
610
611 ++t_tau;
612 ++t_tau_dot;
613 ++t_f;
614 ++t_plastic_strain_dot;
615 }
616
622
623 ++nb_elements;
624 nb_points += nb_points_on_elem;
625 if (nb_points_avtive_on_elem > 0) {
626 ++avtive_elems;
627 active_points += nb_points_avtive_on_elem;
628 if (nb_points_avtive_on_elem == nb_points_on_elem) {
629 ++avtive_full_elems;
630 }
631 }
632
633 if (nb_points_avtive_on_elem != nb_points_on_elem)
634 return 1;
635 else
636 return 0;
637 };
638
639 if (DomainEleOp::getTSCtx() == TSMethod::TSContext::CTX_TSSETIJACOBIAN) {
640 get_avtive_pts();
641 }
642
643 auto dt = this->getTStimeStep();
644 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
645
648 t_diff_plastic_strain,
650
651 const auto sigma_y =
654 const auto d_sigma_y =
657
661
662 auto c =
constraint(eqiv, t_tau_dot, t_f, sigma_y, abs_ww,
671
673
674 t_stress,
trace(t_stress),
675
677
678 );
679
681 t_flow_dir(
k,
l) = 1.5 * (t_dev_stress(
I,
J) * t_diff_deviator(
I,
J,
k,
l));
683 t_flow_dstrain(
i,
j) = t_flow(
k,
l) * t_D_Op(
k,
l,
i,
j);
684
685 auto get_res_c = [&]() {
return c; };
686
687 auto get_res_c_dstrain = [&](auto &t_diff_res) {
688 t_diff_res(
i,
j) = c_f * t_flow_dstrain(
i,
j);
689 };
690
691 auto get_res_c_dplastic_strain = [&](auto &t_diff_res) {
692 t_diff_res(
i,
j) = (this->getTSa() * c_equiv) * t_diff_eqiv(
i,
j);
693 t_diff_res(
k,
l) -= c_f * t_flow(
i,
j) * t_alpha_dir(
i,
j,
k,
l);
694 };
695
696 auto get_res_c_dtau = [&]() {
697 return this->getTSa() * c_dot_tau + c_sigma_y * d_sigma_y;
698 };
699
700 [[maybe_unused]] auto get_res_c_plastic_strain = [&](auto &t_diff_res) {
701 t_diff_res(
k,
l) = -c_f * t_flow(
i,
j) * t_alpha_dir(
i,
j,
k,
l);
702 };
703
704 auto get_res_flow = [&](auto &t_res_flow) {
705 const auto a = sigma_y;
706 const auto b = t_tau_dot;
707 t_res_flow(
k,
l) =
a * t_plastic_strain_dot(
k,
l) - b * t_flow_dir(
k,
l);
708 };
709
710 auto get_res_flow_dtau = [&](auto &t_res_flow_dtau) {
711 const auto da = d_sigma_y;
712 const auto db = this->getTSa();
713 t_res_flow_dtau(
k,
l) =
714 da * t_plastic_strain_dot(
k,
l) - db * t_flow_dir(
k,
l);
715 };
716
717 auto get_res_flow_dstrain = [&](auto &t_res_flow_dstrain) {
718 const auto b = t_tau_dot;
719 t_res_flow_dstrain(
m,
n,
k,
l) = -t_flow_dir_dstrain(
m,
n,
k,
l) * b;
720 };
721
722 auto get_res_flow_dplastic_strain = [&](auto &t_res_flow_dplastic_strain) {
723 const auto a = sigma_y;
724 t_res_flow_dplastic_strain(
m,
n,
k,
l) =
725 (
a * this->getTSa()) * t_diff_plastic_strain(
m,
n,
k,
l);
726 const auto b = t_tau_dot;
727 t_res_flow_dplastic_strain(
m,
n,
i,
j) +=
728 (t_flow_dir_dstrain(
m,
n,
k,
l) * t_alpha_dir(
k,
l,
i,
j)) * b;
729 };
730
731 t_res_c = get_res_c();
732 get_res_flow(t_res_flow);
733
734 if (this->getTSCtx() == TSMethod::TSContext::CTX_TSSETIJACOBIAN) {
735 t_res_c_dtau = get_res_c_dtau();
736 get_res_c_dstrain(t_res_c_dstrain);
737 get_res_c_dplastic_strain(t_res_c_plastic_strain);
738 get_res_flow_dtau(t_res_flow_dtau);
739 get_res_flow_dstrain(t_res_flow_dstrain);
740 get_res_flow_dplastic_strain(t_res_flow_dplastic_strain);
741 }
742
743 next();
744 }
745
747}
#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)
auto diff_tensor(FTensor::Number< DIM >)
[Lambda functions]
FTensor::Index< 'I', 3 > I
[Common data]
auto diff_deviator(FTensor::Ddg< double, DIM, DIM > &&t_diff_stress, FTensor::Number< DIM >)
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)