831 {
833
834 const size_t nb_row_dofs = row_data.
getIndices().size();
835 const size_t nb_col_dofs = col_data.
getIndices().size();
836 if (nb_row_dofs && nb_col_dofs) {
837
838 auto get_dt = [&]() {
840 CHKERR TSGetTimeStep(getFEMethod()->ts, &
dt);
843 };
844 const auto dt = get_dt();
845
846 const size_t nb_integration_pts = row_data.
getN().size1();
847 const size_t nb_row_base_functions = row_data.
getN().size2();
848 auto t_w = getFTensor0IntegrationWeight();
849
850 auto get_row_base = [&]() {
852 double *base_ptr = &*
commonDataPtr->dualBaseMat.data().begin();
854 } else {
856 }
857 };
858 auto t_row_base = get_row_base();
859
863 auto t_flow =
864 getFTensor2SymmetricFromMat<3>(*(
commonDataPtr->plasticFlowPtr));
865 auto t_stress =
866 getFTensor2SymmetricFromMat<3>(*(
commonDataPtr->mStressPtr));
867 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(*
commonDataPtr->mtD);
868 auto t_D_Deviator =
869 getFTensor4DdgFromMat<3, 3, 0>(*
commonDataPtr->mtD_Deviator);
871
873 auto t_dE_dF = getFTensor4FromMat<3, 3, 3, 3>(dE_dF);
874
875 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
876 double alpha =
dt * getMeasure() * t_w * (*cache).scale_constraint;
877
879 t_D_Deviator,
882
884 if (!LOGSTRAIN) {
885
886 t_diff_constrain_dgrad(
k,
l) =
887 t_diff_constrain_dstrain(
i,
j) * t_diff_symmetrize(
i,
j,
k,
l);
888 } else {
889
891 t_diff_constrain_dgrad(
k,
l) =
892 t_diff_constrain_dstrain(
i,
j) * t_dE_dF(
i,
j,
k,
l);
893 }
894
896 &locMat(0, 2)};
897
898 size_t rr = 0;
899 for (; rr != nb_row_dofs; ++rr) {
900
902 for (size_t cc = 0; cc != nb_col_dofs / 3; cc++) {
903
904 t_mat(
i) +=
alpha * t_row_base * t_diff_constrain_dgrad(
i,
j) *
906
907 ++t_mat;
908 ++t_col_diff_base;
909 }
910
911 ++t_row_base;
912 }
913 for (; rr != nb_row_base_functions; ++rr)
914 ++t_row_base;
915
916 if (LOGSTRAIN)
917 ++t_dE_dF;
918
919 ++t_f;
920 ++t_tau;
921 ++t_tau_dot;
922 ++t_flow;
923 ++t_stress;
924 ++t_w;
925 }
926 }
927
929}
#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()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.