24 constexpr
auto size_symm = (DIM * (DIM + 1)) / 2;
28 if constexpr (DIM == 2) {
52 t_diff(
i,
j,
k,
l) = 0;
53 t_diff(0, 0, 0, 0) = 1;
54 t_diff(1, 1, 1, 1) = 1;
56 t_diff(1, 0, 1, 0) = 0.5;
57 t_diff(1, 0, 0, 1) = 0.5;
59 t_diff(0, 1, 0, 1) = 0.5;
60 t_diff(0, 1, 1, 0) = 0.5;
62 if constexpr (DIM == 3) {
63 t_diff(2, 2, 2, 2) = 1;
65 t_diff(2, 0, 2, 0) = 0.5;
66 t_diff(2, 0, 0, 2) = 0.5;
67 t_diff(0, 2, 0, 2) = 0.5;
68 t_diff(0, 2, 2, 0) = 0.5;
70 t_diff(2, 1, 2, 1) = 0.5;
71 t_diff(2, 1, 1, 2) = 0.5;
72 t_diff(1, 2, 1, 2) = 0.5;
73 t_diff(1, 2, 2, 1) = 0.5;
81 constexpr
double third = boost::math::constants::third<double>();
82 return (t_stress(0, 0) + t_stress(1, 1)) *
third;
87 constexpr
double third = boost::math::constants::third<double>();
88 return (t_stress(0, 0) + t_stress(1, 1) + t_stress(2, 2)) *
third;
91 template <
typename T,
int DIM>
100 for (
int ii = 0; ii != DIM; ++ii)
101 for (
int jj = ii; jj != DIM; ++jj)
102 t_dev(ii, jj) = t_stress(ii, jj);
103 t_dev(0, 0) -=
trace;
104 t_dev(1, 1) -=
trace;
105 t_dev(2, 2) -=
trace;
106 for (
int ii = 0; ii != DIM; ++ii)
107 for (
int jj = ii; jj != DIM; ++jj)
108 t_dev(ii, jj) -= t_alpha(ii, jj);
112 template <
typename T>
118 template <
typename T>
130 t_diff_deviator(
I,
J,
k,
l) = 0;
131 for (
int ii = 0; ii != DIM; ++ii)
132 for (
int jj = ii; jj != DIM; ++jj)
133 for (
int kk = 0; kk != DIM; ++kk)
134 for (
int ll = kk; ll != DIM; ++ll)
135 t_diff_deviator(ii, jj, kk, ll) = t_diff_stress(ii, jj, kk, ll);
137 constexpr
double third = boost::math::constants::third<double>();
139 t_diff_deviator(0, 0, 0, 0) -=
third;
140 t_diff_deviator(0, 0, 1, 1) -=
third;
142 t_diff_deviator(1, 1, 0, 0) -=
third;
143 t_diff_deviator(1, 1, 1, 1) -=
third;
145 t_diff_deviator(2, 2, 0, 0) -=
third;
146 t_diff_deviator(2, 2, 1, 1) -=
third;
148 if constexpr (DIM == 3) {
149 t_diff_deviator(0, 0, 2, 2) -=
third;
150 t_diff_deviator(1, 1, 2, 2) -=
third;
151 t_diff_deviator(2, 2, 2, 2) -=
third;
154 return t_diff_deviator;
190 return std::sqrt(1.5 * t_stress_deviator(
I,
J) * t_stress_deviator(
I,
J)) +
191 std::numeric_limits<double>::epsilon();
202 (1.5 * (t_dev_stress(
I,
J) * t_diff_deviator(
I,
J,
k,
l))) /
f;
206 template <
typename T,
int DIM>
216 t_diff_flow(
i,
j,
k,
l) =
217 (1.5 * (t_diff_deviator(
M,
N,
i,
j) * t_diff_deviator(
M,
N,
k,
l) -
218 (2. / 3.) * t_flow(
i,
j) * t_flow(
k,
l))) /
223 template <
typename T,
int DIM>
234 t_diff_flow(
i,
j,
k,
l) =
235 t_diff_plastic_flow_dstress(
i,
j,
m,
n) * t_D(
m,
n,
k,
l);
252 const auto y = x /
zeta;
253 if (y > std::numeric_limits<float>::max_exponent10 ||
254 y < std::numeric_limits<float>::min_exponent10) {
260 const auto e = std::exp(y);
261 return (e - 1) / (1 + e);
266 const auto y = -x /
zeta;
267 if (y > std::numeric_limits<float>::max_exponent10 ||
268 y < std::numeric_limits<float>::min_exponent10) {
271 const double e = std::exp(y);
272 return x + 2 *
zeta * std::log1p(e);
276 inline double w(
double eqiv,
double dot_tau,
double f,
double sigma_y,
278 return (
f - sigma_y) / sigma_Y +
cn1 * (dot_tau);
292 inline double constraint(
double eqiv,
double dot_tau,
double f,
double sigma_y,
293 double abs_w,
double vis_H,
double sigma_Y) {
294 return vis_H * dot_tau +
295 (sigma_Y / 2) * ((
cn0 * (dot_tau - eqiv) +
cn1 * (dot_tau) -
296 (
f - sigma_y) / sigma_Y) -
301 double vis_H,
double sigma_Y) {
302 return vis_H + (sigma_Y / 2) * (
cn0 +
cn1 * (1 -
sign));
307 return (sigma_Y / 2) * (-
cn0);
314 template <
typename T,
int DIM>
322 return t_diff_constrain_dstress;
325 template <
typename T1,
typename T2,
int DIM>
332 t_diff_constrain_dstrain(
k,
l) =
333 t_diff_constrain_dstress(
i,
j) * t_D(
i,
j,
k,
l);
334 return t_diff_constrain_dstrain;
337 template <
typename T,
int DIM>
342 constexpr
double A = 2. / 3;
343 return std::sqrt(
A * t_plastic_strain_dot(
i,
j) *
344 t_plastic_strain_dot(
i,
j)) +
345 std::numeric_limits<double>::epsilon();
348 template <
typename T1,
typename T2,
typename T3,
int DIM>
350 T3 &t_diff_plastic_strain,
356 constexpr
double A = 2. / 3;
358 t_diff_eqiv(
i,
j) =
A * (t_plastic_strain_dot(
k,
l) / eqiv) *
359 t_diff_plastic_strain(
k,
l,
i,
j);
369 &mat(3 * rr + 0, 0), &mat(3 * rr + 0, 1), &mat(3 * rr + 1, 0),
370 &mat(3 * rr + 1, 1), &mat(3 * rr + 2, 0), &mat(3 * rr + 2, 1)};
376 &mat(6 * rr + 0, 0), &mat(6 * rr + 0, 1), &mat(6 * rr + 0, 2),
377 &mat(6 * rr + 1, 0), &mat(6 * rr + 1, 1), &mat(6 * rr + 1, 2),
378 &mat(6 * rr + 2, 0), &mat(6 * rr + 2, 1), &mat(6 * rr + 2, 2),
379 &mat(6 * rr + 3, 0), &mat(6 * rr + 3, 1), &mat(6 * rr + 3, 2),
380 &mat(6 * rr + 4, 0), &mat(6 * rr + 4, 1), &mat(6 * rr + 4, 2),
381 &mat(6 * rr + 5, 0), &mat(6 * rr + 5, 1), &mat(6 * rr + 5, 2)};
386 template <
int DIM,
typename DomainEleOp>
390 boost::shared_ptr<CommonData> common_data_ptr);
397 template <
int DIM,
typename DomainEleOp>
400 boost::shared_ptr<CommonData> common_data_ptr)
402 commonDataPtr(common_data_ptr) {
404 std::fill(&DomainEleOp::doEntities[MBEDGE],
405 &DomainEleOp::doEntities[MBMAXTYPE],
false);
408 template <
int DIM,
typename DomainEleOp>
416 const size_t nb_gauss_pts = commonDataPtr->mStressPtr->size2();
418 getFTensor2SymmetricFromMat<DIM>(*(commonDataPtr->mStressPtr));
419 auto t_plastic_strain =
420 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->plasticStrain);
422 commonDataPtr->plasticSurface.resize(nb_gauss_pts,
false);
423 commonDataPtr->plasticFlow.resize(
size_symm, nb_gauss_pts,
false);
424 auto t_flow = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->plasticFlow);
426 auto ¶ms = commonDataPtr->blockParams;
428 for (
auto &
f : commonDataPtr->plasticSurface) {
433 t_stress,
trace(t_stress),
446 t_flow(
i,
j) = t_flow_tmp(
i,
j);
456 template <
int DIM,
typename DomainEleOp>
459 boost::shared_ptr<CommonData> common_data_ptr,
460 boost::shared_ptr<MatrixDouble> m_D_ptr);
465 boost::shared_ptr<MatrixDouble>
mDPtr;
468 template <
int DIM,
typename DomainEleOp>
470 const std::string
field_name, boost::shared_ptr<CommonData> common_data_ptr,
471 boost::shared_ptr<MatrixDouble> m_D_ptr)
473 commonDataPtr(common_data_ptr), mDPtr(m_D_ptr) {
475 std::fill(&DomainEleOp::doEntities[MBEDGE],
476 &DomainEleOp::doEntities[MBMAXTYPE],
false);
479 template <
int DIM,
typename DomainEleOp>
491 auto ¶ms = commonDataPtr->blockParams;
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);
523 commonDataPtr->resC.resize(nb_gauss_pts,
false);
524 commonDataPtr->resCdTau.resize(nb_gauss_pts,
false);
525 commonDataPtr->resCdStrain.resize(
size_symm, nb_gauss_pts,
false);
526 commonDataPtr->resCdPlasticStrain.resize(
size_symm, nb_gauss_pts,
false);
527 commonDataPtr->resFlow.resize(
size_symm, nb_gauss_pts,
false);
528 commonDataPtr->resFlowDtau.resize(
size_symm, nb_gauss_pts,
false);
534 commonDataPtr->resC.clear();
535 commonDataPtr->resCdTau.clear();
536 commonDataPtr->resCdStrain.clear();
537 commonDataPtr->resCdPlasticStrain.clear();
538 commonDataPtr->resFlow.clear();
539 commonDataPtr->resFlowDtau.clear();
540 commonDataPtr->resFlowDstrain.clear();
541 commonDataPtr->resFlowDstrainDot.clear();
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);
586 for (
auto &
f : commonDataPtr->plasticSurface) {
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) {
632 for (
auto &
f : commonDataPtr->plasticSurface) {
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);
737 template <
int DIM,
typename DomainEleOp>
744 boost::shared_ptr<CommonData> common_data_ptr,
745 boost::shared_ptr<MatrixDouble> mDPtr);
747 boost::shared_ptr<MatrixDouble> mDPtr);
752 boost::shared_ptr<MatrixDouble>
mDPtr;
756 template <
int DIM,
typename DomainEleOp>
758 const std::string
field_name, boost::shared_ptr<CommonData> common_data_ptr,
759 boost::shared_ptr<MatrixDouble> m_D_ptr)
761 commonDataPtr(common_data_ptr), mDPtr(m_D_ptr) {
763 std::fill(&DomainEleOp::doEntities[MBEDGE],
764 &DomainEleOp::doEntities[MBMAXTYPE],
false);
767 template <
int DIM,
typename DomainEleOp>
769 boost::shared_ptr<CommonData> common_data_ptr,
770 boost::shared_ptr<MatrixDouble> m_D_ptr)
772 commonDataPtr(common_data_ptr), mDPtr(m_D_ptr) {}
775 template <
int DIM,
typename DomainEleOp>
786 const size_t nb_gauss_pts = commonDataPtr->mStrainPtr->size2();
787 commonDataPtr->mStressPtr->resize((DIM * (DIM + 1)) / 2, nb_gauss_pts);
788 auto t_D = getFTensor4DdgFromMat<DIM, DIM, 0>(*mDPtr);
790 getFTensor2SymmetricFromMat<DIM>(*(commonDataPtr->mStrainPtr));
791 auto t_plastic_strain =
792 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->plasticStrain);
794 getFTensor2SymmetricFromMat<DIM>(*(commonDataPtr->mStressPtr));
796 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
798 t_D(
i,
j,
k,
l) * (t_strain(
k,
l) - t_plastic_strain(
k,
l));
808 template <
int DIM,
typename AssemblyDomainEleOp>
812 boost::shared_ptr<CommonData> common_data_ptr,
813 boost::shared_ptr<MatrixDouble> m_D_ptr);
818 boost::shared_ptr<MatrixDouble>
mDPtr;
821 template <
int DIM,
typename AssemblyDomainEleOp>
824 boost::shared_ptr<CommonData> common_data_ptr,
825 boost::shared_ptr<MatrixDouble> m_D_ptr)
827 commonDataPtr(common_data_ptr), mDPtr(m_D_ptr) {}
829 template <
int DIM,
typename AssemblyDomainEleOp>
839 constexpr
auto size_symm = (DIM * (DIM + 1)) / 2;
842 const auto nb_integration_pts = AssemblyDomainEleOp::getGaussPts().size2();
843 const auto nb_base_functions = data.getN().size2();
845 auto t_res_flow = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->resFlow);
849 auto next = [&]() { ++t_res_flow; };
851 auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
852 auto t_base = data.getFTensor0N();
854 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
855 double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
859 t_rhs(
L) = alpha * (t_res_flow(
i,
j) * t_L(
i,
j,
L));
862 auto t_nf = getFTensor1FromArray<size_symm, size_symm>(nf);
865 t_nf(
L) += t_base * t_rhs(
L);
869 for (; bb < nb_base_functions; ++bb)
876 template <
typename AssemblyDomainEleOp>
880 boost::shared_ptr<CommonData> common_data_ptr,
881 boost::shared_ptr<MatrixDouble> m_D_ptr);
886 boost::shared_ptr<MatrixDouble>
mDPtr;
889 template <
typename AssemblyDomainEleOp>
892 boost::shared_ptr<CommonData> common_data_ptr,
893 boost::shared_ptr<MatrixDouble> m_D_ptr)
895 commonDataPtr(common_data_ptr), mDPtr(m_D_ptr) {}
897 template <
typename AssemblyDomainEleOp>
903 const size_t nb_integration_pts = AssemblyDomainEleOp::getGaussPts().size2();
904 const size_t nb_base_functions = data.getN().size2();
908 auto next = [&]() { ++t_res_c; };
910 auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
912 auto t_base = data.getFTensor0N();
913 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
914 const double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
916 const auto res = alpha * t_res_c;
921 nf[bb] += t_base * res;
924 for (; bb < nb_base_functions; ++bb)
931 template <
int DIM,
typename AssemblyDomainEleOp>
935 const std::string row_field_name,
const std::string col_field_name,
936 boost::shared_ptr<CommonData> common_data_ptr,
937 boost::shared_ptr<MatrixDouble> m_D_ptr);
943 boost::shared_ptr<MatrixDouble>
mDPtr;
946 template <
int DIM,
typename AssemblyDomainEleOp>
949 const std::string row_field_name,
const std::string col_field_name,
950 boost::shared_ptr<CommonData> common_data_ptr,
951 boost::shared_ptr<MatrixDouble> m_D_ptr)
954 commonDataPtr(common_data_ptr), mDPtr(m_D_ptr) {
955 AssemblyDomainEleOp::sYmm =
false;
961 &mat(3 * rr + 0, 0), &mat(3 * rr + 0, 1), &mat(3 * rr + 0, 2),
962 &mat(3 * rr + 1, 0), &mat(3 * rr + 1, 1), &mat(3 * rr + 1, 2),
963 &mat(3 * rr + 2, 0), &mat(3 * rr + 2, 1), &mat(3 * rr + 2, 2)};
969 &mat(6 * rr + 0, 0), &mat(6 * rr + 0, 1), &mat(6 * rr + 0, 2),
970 &mat(6 * rr + 0, 3), &mat(6 * rr + 0, 4), &mat(6 * rr + 0, 5),
971 &mat(6 * rr + 1, 0), &mat(6 * rr + 1, 1), &mat(6 * rr + 1, 2),
972 &mat(6 * rr + 1, 3), &mat(6 * rr + 1, 4), &mat(6 * rr + 1, 5),
973 &mat(6 * rr + 2, 0), &mat(6 * rr + 2, 1), &mat(6 * rr + 2, 2),
974 &mat(6 * rr + 2, 3), &mat(6 * rr + 2, 4), &mat(6 * rr + 2, 5),
975 &mat(6 * rr + 3, 0), &mat(6 * rr + 3, 1), &mat(6 * rr + 3, 2),
976 &mat(6 * rr + 3, 3), &mat(6 * rr + 3, 4), &mat(6 * rr + 3, 5),
977 &mat(6 * rr + 4, 0), &mat(6 * rr + 4, 1), &mat(6 * rr + 4, 2),
978 &mat(6 * rr + 4, 3), &mat(6 * rr + 4, 4), &mat(6 * rr + 4, 5),
979 &mat(6 * rr + 5, 0), &mat(6 * rr + 5, 1), &mat(6 * rr + 5, 2),
980 &mat(6 * rr + 5, 3), &mat(6 * rr + 5, 4), &mat(6 * rr + 5, 5)};
983 template <
int DIM,
typename AssemblyDomainEleOp>
994 constexpr
auto size_symm = (DIM * (DIM + 1)) / 2;
1000 const auto nb_integration_pts = AssemblyDomainEleOp::getGaussPts().size2();
1001 const auto nb_row_base_functions = row_data.getN().size2();
1003 auto t_res_flow_dstrain =
1004 getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->resFlowDstrain);
1005 auto t_res_flow_dplastic_strain =
1006 getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->resFlowDstrainDot);
1010 ++t_res_flow_dstrain;
1011 ++t_res_flow_dplastic_strain;
1014 auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
1015 auto t_row_base = row_data.getFTensor0N();
1016 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
1017 double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
1022 alpha * (t_L(
i,
j, O) * ((t_res_flow_dplastic_strain(
i,
j,
k,
l) -
1023 t_res_flow_dstrain(
i,
j,
k,
l)) *
1031 auto t_col_base = col_data.getFTensor0N(gg, 0);
1033 t_mat(O,
L) += ((t_row_base * t_col_base) * t_res_mat(O,
L));
1041 for (; rr < nb_row_base_functions; ++rr)
1048 template <
int DIM,
typename AssemblyDomainEleOp>
1052 const std::string row_field_name,
const std::string col_field_name,
1053 boost::shared_ptr<CommonData> common_data_ptr,
1054 boost::shared_ptr<MatrixDouble> m_D_ptr);
1063 template <
int DIM,
typename AssemblyDomainEleOp>
1067 const std::string row_field_name,
const std::string col_field_name,
1068 boost::shared_ptr<CommonData> common_data_ptr,
1069 boost::shared_ptr<MatrixDouble> m_D_ptr);
1078 template <
int DIM,
typename AssemblyDomainEleOp>
1081 const std::string row_field_name,
const std::string col_field_name,
1082 boost::shared_ptr<CommonData> common_data_ptr,
1083 boost::shared_ptr<MatrixDouble> m_D_ptr)
1086 commonDataPtr(common_data_ptr), mDPtr(m_D_ptr) {
1087 AssemblyDomainEleOp::sYmm =
false;
1093 &mat(3 * rr + 0, 0), &mat(3 * rr + 1, 0), &mat(3 * rr + 2, 0)};
1099 &mat(6 * rr + 0, 0), &mat(6 * rr + 1, 0), &mat(6 * rr + 2, 0),
1100 &mat(6 * rr + 3, 0), &mat(6 * rr + 4, 0), &mat(6 * rr + 5, 0)};
1103 template <
int DIM,
typename AssemblyDomainEleOp>
1112 constexpr
auto size_symm = (DIM * (DIM + 1)) / 2;
1115 const auto nb_integration_pts = AssemblyDomainEleOp::getGaussPts().size2();
1116 const size_t nb_row_base_functions = row_data.getN().size2();
1119 const auto type = AssemblyDomainEleOp::getFEType();
1120 const auto nb_nodes = moab::CN::VerticesPerEntity(
type);
1122 auto t_res_flow_dtau =
1123 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->resFlowDtau);
1127 auto next = [&]() { ++t_res_flow_dtau; };
1129 auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
1130 auto t_row_base = row_data.getFTensor0N();
1131 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
1132 double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
1135 t_res_vec(
L) = alpha * (t_res_flow_dtau(
i,
j) * t_L(
i,
j,
L));
1142 auto t_col_base = col_data.getFTensor0N(gg, 0);
1144 t_mat(
L) += t_row_base * t_col_base * t_res_vec(
L);
1150 for (; rr != nb_row_base_functions; ++rr)
1157 template <
int DIM,
typename AssemblyDomainEleOp>
1161 const std::string row_field_name,
const std::string col_field_name,
1162 boost::shared_ptr<CommonData> common_data_ptr,
1163 boost::shared_ptr<MatrixDouble> mat_D_ptr);
1172 template <
int DIM,
typename AssemblyDomainEleOp>
1175 const std::string row_field_name,
const std::string col_field_name,
1176 boost::shared_ptr<CommonData> common_data_ptr,
1177 boost::shared_ptr<MatrixDouble> m_D_ptr)
1180 commonDataPtr(common_data_ptr), mDPtr(m_D_ptr) {
1181 AssemblyDomainEleOp::sYmm =
false;
1186 &mat(0, 0), &mat(0, 1), &mat(0, 2)};
1191 &mat(0, 0), &mat(0, 1), &mat(0, 2), &mat(0, 3), &mat(0, 4), &mat(0, 5)};
1194 template <
int DIM,
typename AssemblyDomainEleOp>
1203 constexpr
auto size_symm = (DIM * (DIM + 1)) / 2;
1206 const auto nb_integration_pts = AssemblyDomainEleOp::getGaussPts().size2();
1207 const auto nb_row_base_functions = row_data.getN().size2();
1210 getFTensor2SymmetricFromMat<SPACE_DIM>(commonDataPtr->resCdStrain);
1211 auto t_c_dplastic_strain =
1212 getFTensor2SymmetricFromMat<SPACE_DIM>(commonDataPtr->resCdPlasticStrain);
1216 ++t_c_dplastic_strain;
1221 auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
1222 auto t_row_base = row_data.getFTensor0N();
1223 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
1224 const double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
1229 t_L(
i,
j,
L) * (t_c_dplastic_strain(
i,
j) - t_c_dstrain(
i,
j));
1236 const auto row_base = alpha * t_row_base;
1237 auto t_col_base = col_data.getFTensor0N(gg, 0);
1239 t_mat(
L) += (row_base * t_col_base) * t_res_vec(
L);
1245 for (; rr != nb_row_base_functions; ++rr)
1252 template <
typename AssemblyDomainEleOp>
1256 const std::string row_field_name,
const std::string col_field_name,
1257 boost::shared_ptr<CommonData> common_data_ptr);
1265 template <
typename AssemblyDomainEleOp>
1268 const std::string row_field_name,
const std::string col_field_name,
1269 boost::shared_ptr<CommonData> common_data_ptr)
1272 commonDataPtr(common_data_ptr) {
1273 AssemblyDomainEleOp::sYmm =
false;
1276 template <
typename AssemblyDomainEleOp>
1283 const auto nb_integration_pts = AssemblyDomainEleOp::getGaussPts().size2();
1284 const auto nb_row_base_functions = row_data.getN().size2();
1287 auto next = [&]() { ++t_res_c_dtau; };
1289 auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
1290 auto t_row_base = row_data.getFTensor0N();
1291 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
1292 const double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
1295 const auto res = alpha * (t_res_c_dtau);
1301 auto t_col_base = col_data.getFTensor0N(gg, 0);
1303 *mat_ptr += t_row_base * t_col_base * res;
1309 for (; rr < nb_row_base_functions; ++rr)