]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix border case where some processors have zero vector sizes.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 30 Mar 2011 13:30:30 +0000 (13:30 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 30 Mar 2011 13:30:30 +0000 (13:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@23544 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/trilinos_vector_base.h
deal.II/source/lac/constraint_matrix.cc

index 0bff5bc6955c9142017cd99270f3d0a025983175..888abd11e62ac48a45dd1bf88a5324e447ddf9b8 100644 (file)
@@ -1142,7 +1142,8 @@ namespace TrilinosWrappers
     Assert (vector.get() != 0,
            ExcMessage("Vector has not been constructed properly."));
 
-    if (fast == false || local_range() != v.local_range())
+    if (fast == false ||
+       vector_partitioner().SameAs(v.vector_partitioner())==false)
       vector.reset (new Epetra_FEVector(*v.vector));
   }
 
index b2fd66c089cba563339a6f6ba8523a8c23e7449a..1252620a4c02f092275fb9707bc8ba309dfbb15b 100644 (file)
@@ -1848,7 +1848,6 @@ ConstraintMatrix::distribute (TrilinosWrappers::MPI::Vector &vec) const
   AssertThrow (vec.vector_partitioner().IsOneToOne(),
               ExcMessage ("Distribute does not work on vectors with overlapping parallel partitioning."));
 
-
   typedef std::vector<ConstraintLine>::const_iterator constraint_iterator;
   ConstraintLine index_comparison;
   index_comparison.line = vec.local_range().first;
@@ -2008,12 +2007,8 @@ ConstraintMatrix::distribute (TrilinosWrappers::MPI::BlockVector &vec) const
                          it->entries[i].second);
          vec(it->line) = new_value;
        }
+      vec.block(block).compress(Insert);
     }
-
-                                  // force every processor to write something
-  unsigned int idx = vec.block(0).local_range().first;
-  vec(idx) = vec(idx);
-  vec.compress ();
 }
 
 #endif

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.