]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Apply patch by Peter Munch to clean up partitioner identification 11063/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 20 Oct 2020 14:04:29 +0000 (16:04 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 20 Oct 2020 14:04:29 +0000 (16:04 +0200)
include/deal.II/matrix_free/matrix_free.h

index 66bcbd908297a03d27b967a69ebc81191ddf4e04..ccee8dbd8a20d6f8cf8102c2fca2de2e5287c613 100644 (file)
@@ -3137,7 +3137,6 @@ namespace internal
     find_vector_in_mf(const VectorType &vec,
                       const bool        check_global_compatibility = true) const
     {
-      unsigned int mf_component = numbers::invalid_unsigned_int;
       (void)check_global_compatibility;
       for (unsigned int c = 0; c < matrix_free.n_components(); ++c)
         if (
@@ -3148,11 +3147,12 @@ namespace internal
 #  endif
             vec.get_partitioner()->is_compatible(
               *matrix_free.get_dof_info(c).vector_partitioner))
-          {
-            mf_component = c;
-            break;
-          }
-      return mf_component;
+          return c;
+
+      Assert(false,
+             ExcNotImplemented("Could not find partitioner that fits vector"));
+
+      return numbers::invalid_unsigned_int;
     }
 
 
@@ -3285,9 +3285,6 @@ namespace internal
 #  ifdef DEAL_II_WITH_MPI
           const unsigned int mf_component = find_vector_in_mf(vec);
 
-          Assert(mf_component != numbers::invalid_unsigned_int,
-                 ExcNotImplemented());
-
           const auto &part = get_partitioner(mf_component);
 
           if (part.n_ghost_indices() == 0 && part.n_import_indices() == 0)
@@ -3378,9 +3375,6 @@ namespace internal
 
           const unsigned int mf_component = find_vector_in_mf(vec);
 
-          Assert(mf_component != numbers::invalid_unsigned_int,
-                 ExcNotImplemented());
-
           const auto &part = get_partitioner(mf_component);
 
           if (part.n_ghost_indices() != 0 || part.n_import_indices() != 0)
@@ -3483,8 +3477,6 @@ namespace internal
         {
 #  ifdef DEAL_II_WITH_MPI
           const unsigned int mf_component = find_vector_in_mf(vec);
-          Assert(mf_component != numbers::invalid_unsigned_int,
-                 ExcNotImplemented());
 
           const auto &part = get_partitioner(mf_component);
 
@@ -3574,9 +3566,6 @@ namespace internal
 
           const unsigned int mf_component = find_vector_in_mf(vec);
 
-          Assert(mf_component != numbers::invalid_unsigned_int,
-                 ExcNotImplemented());
-
           const auto &part = get_partitioner(mf_component);
 
           if (part.n_ghost_indices() == 0 && part.n_import_indices() == 0)

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.