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();
852
853
856
857 auto t_w = getFTensor0IntegrationWeight();
861
862 auto next = [&]() {
863 for (auto &t_vel : arr_t_vel)
864 ++t_vel;
865 };
866
868 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
872 const auto dot = sense_row * (t_normal(
i) * t_vel(
i));
873 const auto l_upwind_side = (dot > 0) ? s0 : opposite_s0;
875 t_res(
I,
J) = t_w * dot;
876 next();
877 ++t_w;
878 auto rr = 0;
879 if (s1 == l_upwind_side) {
880 for (; rr != nb_rows; ++rr) {
881 auto get_ntensor = [](
auto &base_mat,
auto gg,
auto bb) {
882 double *ptr = &base_mat(gg, bb);
884 };
885 auto t_col_base =
887
888 auto t_mat_skeleton =
891 t_res_row(
I,
J) = t_res(
I,
J) * t_row_base;
892 ++t_row_base;
893
894 for (size_t cc = 0; cc != nb_cols; ++cc) {
895 t_mat_skeleton(
I,
J) += t_res_row(
I,
J) * t_col_base;
896 ++t_col_base;
897 ++t_mat_skeleton;
898 }
899 }
900 }
901 for (; rr < nb_row_base_functions; ++rr) {
902 ++t_row_base;
903 }
904 }
905
906 CHKERR ::MatSetValues(getTSB(),
912 }
913 }
914 }
915 }
917}
#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
constexpr auto make_array(Arg &&...arg)
Create Array.
auto get_ntensor(T &base_mat)