1036 {
1038
1039 const size_t nb_row_dofs = row_data.
getIndices().size();
1040 const size_t nb_col_dofs = col_data.
getIndices().size();
1041 if (nb_row_dofs && nb_col_dofs) {
1042
1043 auto get_dt = [&]() {
1045 CHKERR TSGetTimeStep(getFEMethod()->ts, &
dt);
1048 };
1049 const auto dt = get_dt();
1050
1051 const size_t nb_integration_pts = row_data.
getN().size1();
1052 const size_t nb_row_base_functions = row_data.
getN().size2();
1053 auto t_w = getFTensor0IntegrationWeight();
1057
1058 auto t_omega = getFTensor1FromMat<3>(*
commonDataPtr->guidingVelocityPtr);
1059 bool is_rotating =
commonDataPtr->guidingVelocityPtr->size2() > 1;
1060
1061 auto &
cn = (*cache).cn_pl;
1062
1063 auto get_row_base = [&]() {
1065 double *base_ptr = &*
commonDataPtr->dualBaseMat.data().begin();
1067 } else {
1069 }
1070 };
1071 auto t_row_base = get_row_base();
1072
1073 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
1074 const double alpha =
dt * getMeasure() * t_w * (*cache).scale_constraint;
1075 const double t_a = getTSa();
1076 const double c0 =
1079 const double c1 =
1082
1083 auto mat_ptr = locMat.data().begin();
1084
1085 size_t rr = 0;
1086 for (; rr != nb_row_dofs; ++rr) {
1087
1090 for (size_t cc = 0; cc != nb_col_dofs; ++cc) {
1091 if (!is_rotating) {
1092 *mat_ptr += (c0 * t_a + c1) * t_row_base * t_col_base;
1093
1094 } else {
1095 const double c0_p =
1096 c0 * (t_col_base * t_a + (t_col_diff_base(
i) * t_omega(
i)));
1097 *mat_ptr += (c0_p + c1 * t_col_base) * t_row_base;
1098 }
1099
1100 ++mat_ptr;
1101 ++t_col_base;
1102 ++t_col_diff_base;
1103 }
1104 ++t_row_base;
1105 }
1106 for (; rr < nb_row_base_functions; ++rr)
1107 ++t_row_base;
1108
1109 if (is_rotating)
1110 ++t_omega;
1111
1112 ++t_w;
1113 ++t_f;
1114 ++t_tau;
1115 ++t_tau_dot;
1116 }
1117 }
1118
1120}
#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
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.