810 {
812
813
815 const auto in_the_loop =
817
818 auto not_side = [](auto s) {
820 };
821
824 &*base_mat.data().begin());
825 };
826
827 if (in_the_loop > 0) {
828
829
830 auto t_normal = getFTensor1Normal();
831 const auto nb_gauss_pts = getGaussPts().size2();
832
834
835
836 const auto nb_rows =
sideDataPtr->indicesRowSideMap[s0].size();
837
838 if (nb_rows) {
839
840
841 const auto opposite_s0 = not_side(s0);
843
844
845 const auto nb_row_base_functions =
847
849
850
851 const auto nb_cols =
sideDataPtr->indicesColSideMap[s1].size();
853
854
857
858 auto t_w = getFTensor0IntegrationWeight();
862
863 auto next = [&]() {
864 for (auto &t_vel : arr_t_vel)
865 ++t_vel;
866 };
867
869 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
873 const auto dot = sense_row * (t_normal(
i) * t_vel(
i));
874 const auto l_upwind_side = (dot > 0) ? s0 : opposite_s0;
875 const auto sense_upwind =
sideDataPtr->senseMap[l_upwind_side];
877 t_res(
I,
J) = t_w * dot;
878 next();
879 ++t_w;
880 auto rr = 0;
881 if (s1 == l_upwind_side) {
882 for (; rr != nb_rows; ++rr) {
883 auto get_ntensor = [](
auto &base_mat,
auto gg,
auto bb) {
884 double *ptr = &base_mat(gg, bb);
886 };
887 auto t_col_base =
889
890 auto t_mat_skeleton =
893 t_res_row(
I,
J) = t_res(
I,
J) * t_row_base;
894 ++t_row_base;
895
896 for (size_t cc = 0; cc != nb_cols; ++cc) {
897 t_mat_skeleton(
I,
J) += t_res_row(
I,
J) * t_col_base;
898 ++t_col_base;
899 ++t_mat_skeleton;
900 }
901 }
902 }
903 for (; rr < nb_row_base_functions; ++rr) {
904 ++t_row_base;
905 }
906 }
907
908 CHKERR ::MatSetValues(getTSB(),
914 }
915 }
916 }
917 }
919}
#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', DIM1 > I
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
auto getFTensor2FromPtr(double *ptr)
Make Tensor2 from pointer.
FTensor::Tensor1< FTensor::PackPtr< T *, S >, Tensor_Dim > getFTensor1FromMat(ublas::matrix< T, L, A > &data)
Get tensor rank 1 (vector) form data matrix.
constexpr auto make_array(Arg &&...arg)
Create Array.
auto get_ntensor(T &base_mat)