]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix MatrixFree::get_face_category() 13986/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 16 Jun 2022 08:15:19 +0000 (10:15 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 16 Jun 2022 10:55:31 +0000 (12:55 +0200)
include/deal.II/matrix_free/matrix_free.h

index 903d551b0407bc4aeaa841387eef4715a6da2a9b..68fb429be846a485bc6721e2b925d8cd4865a295 100644 (file)
@@ -2857,7 +2857,7 @@ MatrixFree<dim, Number, VectorizedArrayType>::get_face_category(
   if (dof_info[0].cell_active_fe_index.empty())
     return std::make_pair(0U, 0U);
 
-  std::pair<unsigned int, unsigned int> result;
+  std::pair<unsigned int, unsigned int> result = std::make_pair(0U, 0U);
   for (unsigned int v = 0;
        v < VectorizedArrayType::size() &&
        face_info.faces[face_batch_index].cells_interior[v] !=
@@ -2866,7 +2866,8 @@ MatrixFree<dim, Number, VectorizedArrayType>::get_face_category(
     result.first = std::max(
       result.first,
       dof_info[0].cell_active_fe_index[face_info.faces[face_batch_index]
-                                         .cells_interior[v]]);
+                                         .cells_interior[v] /
+                                       VectorizedArrayType::size()]);
   if (face_info.faces[face_batch_index].cells_exterior[0] !=
       numbers::invalid_unsigned_int)
     for (unsigned int v = 0;
@@ -2875,9 +2876,10 @@ MatrixFree<dim, Number, VectorizedArrayType>::get_face_category(
            numbers::invalid_unsigned_int;
          ++v)
       result.second = std::max(
-        result.first,
+        result.second,
         dof_info[0].cell_active_fe_index[face_info.faces[face_batch_index]
-                                           .cells_exterior[v]]);
+                                           .cells_exterior[v] /
+                                         VectorizedArrayType::size()]);
   else
     result.second = numbers::invalid_unsigned_int;
   return result;

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.