493 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
494 auto t_w = DomainEleOp::getFTensor0IntegrationWeight();
498 auto t_flow = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticFlow);
499 auto t_plastic_strain =
500 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticStrain);
501 auto t_plastic_strain_dot =
502 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticStrainDot);
504 getFTensor2SymmetricFromMat<DIM>(*(
commonDataPtr->mStressPtr));
506 auto t_D = getFTensor4DdgFromMat<DIM, DIM, 0>(*
commonDataPtr->mDPtr);
507 auto t_D_Op = getFTensor4DdgFromMat<DIM, DIM, 0>(*
mDPtr);
514 t_flow_dir_dstress(
i,
j,
k,
l) =
515 1.5 * (t_diff_deviator(
M,
N,
i,
j) * t_diff_deviator(
M,
N,
k,
l));
516 t_flow_dir_dstrain(
i,
j,
k,
l) =
517 t_flow_dir_dstress(
i,
j,
m,
n) * t_D_Op(
m,
n,
k,
l);
545 auto t_res_c_dstrain =
546 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resCdStrain);
547 auto t_res_c_plastic_strain =
548 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resCdPlasticStrain);
549 auto t_res_flow = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resFlow);
550 auto t_res_flow_dtau =
551 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resFlowDtau);
552 auto t_res_flow_dstrain =
553 getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->resFlowDstrain);
554 auto t_res_flow_dplastic_strain =
555 getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->resFlowDstrainDot);
563 ++t_plastic_strain_dot;
568 ++t_res_c_plastic_strain;
571 ++t_res_flow_dstrain;
572 ++t_res_flow_dplastic_strain;
576 auto get_avtive_pts = [&]() {
577 int nb_points_avtive_on_elem = 0;
578 int nb_points_on_elem = 0;
583 auto t_plastic_strain_dot =
584 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->plasticStrainDot);
589 eqiv, t_tau_dot, t_f,
597 ++nb_points_avtive_on_elem;
603 ++t_plastic_strain_dot;
613 nb_points += nb_points_on_elem;
614 if (nb_points_avtive_on_elem > 0) {
616 active_points += nb_points_avtive_on_elem;
617 if (nb_points_avtive_on_elem == nb_points_on_elem) {
622 if (nb_points_avtive_on_elem != nb_points_on_elem)
628 if (DomainEleOp::getTSCtx() == TSMethod::TSContext::CTX_TSSETIJACOBIAN) {
636 t_diff_plastic_strain,
642 const auto d_sigma_y =
650 auto c =
constraint(eqiv, t_tau_dot, t_f, sigma_y, abs_ww,
662 t_stress,
trace(t_stress),
669 t_flow_dir(
k,
l) = 1.5 * (t_dev_stress(
I,
J) * t_diff_deviator(
I,
J,
k,
l));
671 t_flow_dstrain(
i,
j) = t_flow(
k,
l) * t_D_Op(
k,
l,
i,
j);
673 auto get_res_c = [&]() {
return c; };
675 auto get_res_c_dstrain = [&](
auto &t_diff_res) {
676 t_diff_res(
i,
j) = c_f * t_flow_dstrain(
i,
j);
679 auto get_res_c_dplastic_strain = [&](
auto &t_diff_res) {
680 t_diff_res(
i,
j) = (this->getTSa() * c_equiv) * t_diff_eqiv(
i,
j);
681 t_diff_res(
k,
l) -= c_f * t_flow(
i,
j) * t_alpha_dir(
i,
j,
k,
l);
684 auto get_res_c_dtau = [&]() {
685 return this->getTSa() * c_dot_tau + c_sigma_y * d_sigma_y;
688 auto get_res_c_plastic_strain = [&](
auto &t_diff_res) {
689 t_diff_res(
k,
l) = -c_f * t_flow(
i,
j) * t_alpha_dir(
i,
j,
k,
l);
692 auto get_res_flow = [&](
auto &t_res_flow) {
693 const auto a = sigma_y;
694 const auto b = t_tau_dot;
695 t_res_flow(
k,
l) =
a * t_plastic_strain_dot(
k,
l) - b * t_flow_dir(
k,
l);
698 auto get_res_flow_dtau = [&](
auto &t_res_flow_dtau) {
699 const auto da = d_sigma_y;
700 const auto db = this->getTSa();
701 t_res_flow_dtau(
k,
l) =
702 da * t_plastic_strain_dot(
k,
l) - db * t_flow_dir(
k,
l);
705 auto get_res_flow_dstrain = [&](
auto &t_res_flow_dstrain) {
706 const auto b = t_tau_dot;
707 t_res_flow_dstrain(
m,
n,
k,
l) = -t_flow_dir_dstrain(
m,
n,
k,
l) * b;
710 auto get_res_flow_dplastic_strain = [&](
auto &t_res_flow_dplastic_strain) {
711 const auto a = sigma_y;
712 t_res_flow_dplastic_strain(
m,
n,
k,
l) =
713 (
a * this->getTSa()) * t_diff_plastic_strain(
m,
n,
k,
l);
714 const auto b = t_tau_dot;
715 t_res_flow_dplastic_strain(
m,
n,
i,
j) +=
716 (t_flow_dir_dstrain(
m,
n,
k,
l) * t_alpha_dir(
k,
l,
i,
j)) * b;
719 t_res_c = get_res_c();
720 get_res_flow(t_res_flow);
722 if (this->getTSCtx() == TSMethod::TSContext::CTX_TSSETIJACOBIAN) {
723 t_res_c_dtau = get_res_c_dtau();
724 get_res_c_dstrain(t_res_c_dstrain);
725 get_res_c_dplastic_strain(t_res_c_plastic_strain);
726 get_res_flow_dtau(t_res_flow_dtau);
727 get_res_flow_dstrain(t_res_flow_dstrain);
728 get_res_flow_dplastic_strain(t_res_flow_dplastic_strain);