From: Wolfgang Bangerth Date: Wed, 2 Sep 2009 18:05:22 +0000 (+0000) Subject: When doing reinit() on a distributed vector, it is not enough to ensure that the... X-Git-Tag: v8.0.0~7198 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58bde20a4b2d788e5547c66a0dfe10d2344271e4;p=dealii.git When doing reinit() on a distributed vector, it is not enough to ensure that the local range is the same, but we'd need to make sure that *all* local ranges are the same. We can do so by comparing the Trilinos maps. git-svn-id: https://svn.dealii.org/trunk@19370 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/trilinos_vector.cc b/deal.II/lac/source/trilinos_vector.cc index 5197e98cb4..b53d8bed25 100755 --- a/deal.II/lac/source/trilinos_vector.cc +++ b/deal.II/lac/source/trilinos_vector.cc @@ -133,7 +133,7 @@ namespace TrilinosWrappers // generate the vector. if (allow_different_maps == false) { - if (local_range() != v.local_range()) + if (vector->Map().SameAs(v.vector->Map()) == false) { vector.reset(); communicator.reset (Utilities::Trilinos:: @@ -147,11 +147,12 @@ namespace TrilinosWrappers } else if (fast == false) { + // old and new vectors + // have exactly the + // same map, i.e. size + // and parallel + // distribution int ierr; - Assert (vector->Map().SameAs(v.vector->Map()) == true, - ExcMessage ("The Epetra maps in the assignment operator =" - " do not match, even though the local_range " - " seems to be the same. Check vector setup!")); ierr = vector->GlobalAssemble (last_action); AssertThrow (ierr == 0, ExcTrilinosError(ierr));