]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix IndexSet::is_ascending_and_one_to_one for empty objects
authorDaniel Arndt <arndtd@ornl.gov>
Fri, 5 Jun 2020 16:32:06 +0000 (12:32 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Fri, 5 Jun 2020 18:35:45 +0000 (14:35 -0400)
source/base/index_set.cc

index 9b833fcb7c9c37a4357bb3ee18b637388d7e0127..8815d6919b5c9f30d246da8cadc98da5c82ffe4d 100644 (file)
@@ -672,6 +672,9 @@ IndexSet::is_ascending_and_one_to_one(const MPI_Comm &communicator) const
   if (n_global_elements != size())
     return false;
 
+  if (n_global_elements == 0)
+    return true;
+
 #ifdef DEAL_II_WITH_MPI
   // Non-contiguous IndexSets can't be linear.
   const bool all_contiguous =

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.