844 {
846
853
855
856 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
857 auto t_w = DomainEleOp::getFTensor0IntegrationWeight();
859 auto t_tau_dot = getFTensor0FromVec(
commonDataPtr->plasticTauDot);
860 auto t_f = getFTensor0FromVec(
commonDataPtr->plasticSurface);
861 auto t_flow = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticFlow);
862 auto t_plastic_strain =
863 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->plasticStrain);
864 auto t_stress =
865 getFTensor2SymmetricFromMat<DIM>(*(
commonDataPtr->mStressPtr));
866
867 auto t_D = getFTensor4DdgFromMat<DIM, DIM, 0>(*
commonDataPtr->mDPtr);
868 auto t_D_Op = getFTensor4DdgFromMat<DIM, DIM, 0>(*
mDPtr);
869
871
874
877 t_flow_dir_dstress(
i,
j,
k,
l) =
878 1.5 * (t_diff_deviator(
M,
N,
i,
j) * t_diff_deviator(
M,
N,
k,
l));
879 t_flow_dir_dstrain(
i,
j,
k,
l) =
880 t_flow_dir_dstress(
i,
j,
m,
n) * t_D_Op(
m,
n,
k,
l);
881
882 auto t_alpha_dir =
884
893 false);
895 false);
897
908
910 auto t_res_c_dtau = getFTensor0FromVec(
commonDataPtr->resCdTau);
911 auto t_res_c_dstrain =
912 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resCdStrain);
913 auto t_res_c_plastic_strain =
914 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resCdPlasticStrain);
915 auto t_res_c_temperature =
917 auto t_res_flow = getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resFlow);
918 auto t_res_flow_dtau =
919 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resFlowDtau);
920 auto t_res_flow_dstrain =
921 getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->resFlowDstrain);
922 auto t_res_flow_dplastic_strain =
923 getFTensor4DdgFromMat<DIM, DIM>(
commonDataPtr->resFlowDstrainDot);
924 auto t_res_flow_dtemp =
926
927 auto next = [&]() {
928 ++t_tau;
929 ++t_tau_dot;
930 ++t_f;
931 ++t_flow;
932 ++t_plastic_strain;
933 ++t_stress;
934 ++t_res_c;
935 ++t_res_c_dtau;
936 ++t_res_c_dstrain;
937 ++t_res_c_plastic_strain;
938 ++t_res_c_temperature;
939 ++t_res_flow;
940 ++t_res_flow_dtau;
941 ++t_res_flow_dstrain;
942 ++t_res_flow_dplastic_strain;
943 ++t_res_flow_dtemp;
944 ++t_w;
945 ++t_temp;
946 };
947
948 auto get_avtive_pts = [&]() {
949 int nb_points_avtive_on_elem = 0;
950 int nb_points_on_elem = 0;
951
953 auto t_tau_dot = getFTensor0FromVec(
commonDataPtr->plasticTauDot);
954 auto t_f = getFTensor0FromVec(
commonDataPtr->plasticSurface);
955 auto t_plastic_strain_dot =
956 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->plasticStrainDot);
958
959 auto dt = this->getTStimeStep();
960
961 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
963 const auto ww =
964 w(eqiv, t_tau_dot, t_f,
971
972 ++nb_points_on_elem;
973 if (sign_ww > 0) {
974 ++nb_points_avtive_on_elem;
975 }
976
977 ++t_tau;
978 ++t_tau_dot;
979 ++t_f;
980 ++t_plastic_strain_dot;
981 ++t_temp;
982 }
983
989
990 ++nb_elements;
991 nb_points += nb_points_on_elem;
992 if (nb_points_avtive_on_elem > 0) {
993 ++avtive_elems;
994 active_points += nb_points_avtive_on_elem;
995 if (nb_points_avtive_on_elem == nb_points_on_elem) {
996 ++avtive_full_elems;
997 }
998 }
999
1000 if (nb_points_avtive_on_elem != nb_points_on_elem)
1001 return 1;
1002 else
1003 return 0;
1004 };
1005
1006 if (DomainEleOp::getTSCtx() == TSMethod::TSContext::CTX_TSSETIJACOBIAN) {
1007 get_avtive_pts();
1008 }
1009
1010 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
1011
1012 double eqiv;
1014
1015 double c_dot_tau, c_sigma_y,
c, c_f, c_equiv;
1016
1017 eqiv = 0.0;
1018 t_diff_eqiv(
i,
j) = 0.0;
1020 c_dot_tau = 0.0;
1021 c_equiv = 0.0;
1022 c_sigma_y = 0.0;
1023 c_f = 0.0;
1024
1026
1027 t_stress,
trace(t_stress),
1028
1030
1031 );
1032
1033 next();
1034 }
1035
1037}
#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 constrian_sign(double x, double dt)
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)
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(double tau, double H, double Qinf, double b_iso, double sigmaY)