]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Change logic to positive 15274/head
authorMaximilian Bergbauer <maximilian.bergbauer@tum.de>
Wed, 31 May 2023 12:38:57 +0000 (14:38 +0200)
committerMaximilian Bergbauer <maximilian.bergbauer@tum.de>
Wed, 31 May 2023 12:38:57 +0000 (14:38 +0200)
include/deal.II/matrix_free/fe_point_evaluation.h
include/deal.II/matrix_free/tensor_product_kernels.h

index b96ace8a0905519229894ed881a2cf331e62d99e..b2e5f20b294e8b0e7d7ccead8096a678beee064a 100644 (file)
@@ -1767,9 +1767,9 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::compute_evaluate_fast(
             scalar_value_type,
             VectorizedArrayType,
             2,
-            true>(shapes_faces.data() + qb * n_shapes,
-                  n_shapes,
-                  solution_renumbered.data());
+            false>(shapes_faces.data() + qb * n_shapes,
+                   n_shapes,
+                   solution_renumbered.data());
 
       value = interpolated_value[dim - 1];
       // reorder derivative from tangential/normal derivatives into tensor in
@@ -1821,9 +1821,9 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::compute_evaluate_fast(
             scalar_value_type,
             VectorizedArrayType,
             1,
-            true>(shapes.data() + qb * n_shapes,
-                  n_shapes,
-                  solution_renumbered.data());
+            false>(shapes.data() + qb * n_shapes,
+                   n_shapes,
+                   solution_renumbered.data());
       gradient[0] = result[0];
       if (dim > 1)
         gradient[1] = result[1];
index 07d32da2fecae8b98fcac7a8d5abdf7f599d76ca..9f40b3c100ba4c2d43d4c0ef876376ad83817338 100644 (file)
@@ -3043,7 +3043,7 @@ namespace internal
             typename Number2,
             typename Number,
             int  n_values    = 1,
-            bool no_renumber = false>
+            bool do_renumber = true>
   inline
 #ifndef DEBUG
     DEAL_II_ALWAYS_INLINE
@@ -3079,25 +3079,25 @@ namespace internal
 
         // Distinguish the inner loop based on whether we have a
         // renumbering or not
-        if (no_renumber || renumber.empty())
+        if (do_renumber && !renumber.empty())
           for (int i0 = 0; i0 < n_shapes; ++i0, ++i)
             {
               // gradient
-              inner_result[0] += shapes[i0][1][0] * values[i];
+              inner_result[0] += shapes[i0][1][0] * values[renumber[i]];
               // values
-              inner_result[1] += shapes[i0][0][0] * values[i];
+              inner_result[1] += shapes[i0][0][0] * values[renumber[i]];
               if (n_values > 1)
-                inner_result[2] += shapes[i0][0][0] * values_2[i];
+                inner_result[2] += shapes[i0][0][0] * values_2[renumber[i]];
             }
         else
           for (int i0 = 0; i0 < n_shapes; ++i0, ++i)
             {
               // gradient
-              inner_result[0] += shapes[i0][1][0] * values[renumber[i]];
+              inner_result[0] += shapes[i0][1][0] * values[i];
               // values
-              inner_result[1] += shapes[i0][0][0] * values[renumber[i]];
+              inner_result[1] += shapes[i0][0][0] * values[i];
               if (n_values > 1)
-                inner_result[2] += shapes[i0][0][0] * values_2[renumber[i]];
+                inner_result[2] += shapes[i0][0][0] * values_2[i];
             }
 
         if (dim > 1)
@@ -3134,7 +3134,7 @@ namespace internal
             typename Number,
             typename Number2,
             int  n_values    = 1,
-            bool no_renumber = false>
+            bool do_renumber = true>
   inline std::array<typename ProductTypeNoPoint<Number, Number2>::type,
                     dim + n_values>
   evaluate_tensor_product_value_and_gradient_shapes(
@@ -3170,27 +3170,27 @@ namespace internal
         // cases
         if (n_shapes == 2)
           inner_result =
-            do_interpolate_xy<dim, 2, Number2, Number, n_values, no_renumber>(
+            do_interpolate_xy<dim, 2, Number2, Number, n_values, do_renumber>(
               values, renumber, shapes, n_shapes, i);
         else if (n_shapes == 3)
           inner_result =
-            do_interpolate_xy<dim, 3, Number2, Number, n_values, no_renumber>(
+            do_interpolate_xy<dim, 3, Number2, Number, n_values, do_renumber>(
               values, renumber, shapes, n_shapes, i);
         else if (n_shapes == 4)
           inner_result =
-            do_interpolate_xy<dim, 4, Number2, Number, n_values, no_renumber>(
+            do_interpolate_xy<dim, 4, Number2, Number, n_values, do_renumber>(
               values, renumber, shapes, n_shapes, i);
         else if (n_shapes == 5)
           inner_result =
-            do_interpolate_xy<dim, 5, Number2, Number, n_values, no_renumber>(
+            do_interpolate_xy<dim, 5, Number2, Number, n_values, do_renumber>(
               values, renumber, shapes, n_shapes, i);
         else if (n_shapes == 6)
           inner_result =
-            do_interpolate_xy<dim, 6, Number2, Number, n_values, no_renumber>(
+            do_interpolate_xy<dim, 6, Number2, Number, n_values, do_renumber>(
               values, renumber, shapes, n_shapes, i);
         else
           inner_result =
-            do_interpolate_xy<dim, -1, Number2, Number, n_values, no_renumber>(
+            do_interpolate_xy<dim, -1, Number2, Number, n_values, do_renumber>(
               values, renumber, shapes, n_shapes, i);
         if (dim == 3)
           {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.