]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add an assertion that is necessary to make sure all processes do the
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 5 May 2005 19:04:38 +0000 (19:04 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 5 May 2005 19:04:38 +0000 (19:04 +0000)
same thing.

git-svn-id: https://svn.dealii.org/trunk@10650 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/matrices.all_dimensions.cc

index 749d09f25e077e3cd1bf92b52cc563337c0ffc05..71b0b21937ec793b5b2ae88078921133d750a5b2 100644 (file)
@@ -553,14 +553,29 @@ namespace PETScWrappers
 
     const std::pair<unsigned int, unsigned int> local_range
       = matrix.local_range();
+
+                                    // make sure that there is at
+                                    // least one boundary node on
+                                    // each processor, or we get into
+                                    // trouble with synchronisation
+    {
+      bool found = false;
+      for (unsigned int i=local_range.first; i<local_range.second; ++i)
+       if (boundary_values.find (i) != boundary_values.end())
+         {
+           found = true;
+           break;
+         }
+      Assert (found == true, ExcNotImplemented());
+    }
+    
     
                                      // determine the first nonzero diagonal
                                      // entry from within the part of the matrix
                                      // that we can see. if we can't find such
                                      // an entry, take one
     PetscScalar average_nonzero_diagonal_entry = 1;
-    for (unsigned int i=local_range.first;
-         i<local_range.second; ++i)
+    for (unsigned int i=local_range.first; i<local_range.second; ++i)
       if (matrix.diag_element(i) != 0)
         {
           average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));

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.