From dad983e6c65e16eeca0780e1763eaa6efa1dcd0b Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 2 Sep 2009 22:35:03 +0000 Subject: [PATCH] Take over fix 19370 from mainline. git-svn-id: https://svn.dealii.org/branches/releases/Branch-6-2@19372 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/6.2.1-vs-6.2.2.h | 11 +++++++- deal.II/lac/source/trilinos_vector.cc | 36 ++++++++++++--------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/deal.II/doc/news/6.2.1-vs-6.2.2.h b/deal.II/doc/news/6.2.1-vs-6.2.2.h index a618e6ae65..b710347b07 100644 --- a/deal.II/doc/news/6.2.1-vs-6.2.2.h +++ b/deal.II/doc/news/6.2.1-vs-6.2.2.h @@ -2,7 +2,7 @@ * @page changes_between_6.2.1_and_6.2.2 Changes between Version 6.2.1 and 6.2.2

-This is the list of changes made between the release of +This is the list of changes made between the release of deal.II version 6.2.0 and version 6.2.1:

@@ -31,6 +31,15 @@ deal.II version 6.2.0 and version 6.2.1: any more and were consequently able to compile deal.II.

+ +
  • +

    + Fixed: When using the TrilinosWrappers::MPI::Vector::reinit() function with a parallel + vector, and if the vector initialized and the vector given had a local range on one of + the processors that exactly matched, the program would freeze if the local ranges on + the other processors did not also match exactly. This is now fixed. +

    +
  • diff --git a/deal.II/lac/source/trilinos_vector.cc b/deal.II/lac/source/trilinos_vector.cc index ebeed0896f..89b71e0ef0 100755 --- a/deal.II/lac/source/trilinos_vector.cc +++ b/deal.II/lac/source/trilinos_vector.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2008 by the deal.II authors +// Copyright (C) 2008, 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -42,7 +42,7 @@ namespace TrilinosWrappers } - + Vector::Vector (const Epetra_Map &InputMap) : map (InputMap) @@ -50,9 +50,9 @@ namespace TrilinosWrappers last_action = Zero; vector = std::auto_ptr (new Epetra_FEVector(map)); } - - + + Vector::Vector (const Vector &v) : VectorBase(), @@ -75,7 +75,7 @@ namespace TrilinosWrappers v.vector->Map().NumGlobalElements())); last_action = Zero; - + if (map.SameAs(v.vector->Map()) == true) vector = std::auto_ptr (new Epetra_FEVector(*v.vector)); else @@ -96,7 +96,7 @@ namespace TrilinosWrappers { vector.reset(); map = input_map; - + vector = std::auto_ptr (new Epetra_FEVector(map)); } else if (fast == false) @@ -104,7 +104,7 @@ namespace TrilinosWrappers const int ierr = vector->PutScalar(0.); AssertThrow (ierr == 0, ExcTrilinosError(ierr)); } - + last_action = Zero; } @@ -124,7 +124,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(); map = Epetra_Map(v.vector->Map().NumGlobalElements(), @@ -138,11 +138,7 @@ namespace TrilinosWrappers else if (fast == false) { 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); + ierr = vector->GlobalAssemble (last_action); AssertThrow (ierr == 0, ExcTrilinosError(ierr)); ierr = vector->PutScalar(0.0); @@ -204,7 +200,7 @@ namespace TrilinosWrappers v.vector->Map().NumMyElements(), v.vector->Map().IndexBase(), v.vector->Map().Comm()); - vector = std::auto_ptr + vector = std::auto_ptr (new Epetra_FEVector(*v.vector)); last_action = Zero; } @@ -291,7 +287,7 @@ namespace TrilinosWrappers Vector::Vector (const Epetra_Map &InputMap) : - map (InputMap.NumGlobalElements(), InputMap.IndexBase(), + map (InputMap.NumGlobalElements(), InputMap.IndexBase(), InputMap.Comm()) { last_action = Zero; @@ -344,7 +340,7 @@ namespace TrilinosWrappers ierr = vector->PutScalar(0.0); AssertThrow (ierr == 0, ExcTrilinosError(ierr)); } - + last_action = Zero; } @@ -450,7 +446,7 @@ namespace TrilinosWrappers if (size() != v.size()) { vector.reset(); - map = Epetra_LocalMap (v.vector->Map().NumGlobalElements(), + map = Epetra_LocalMap (v.vector->Map().NumGlobalElements(), v.vector->Map().IndexBase(), v.vector->Comm()); vector = std::auto_ptr (new Epetra_FEVector(map)); @@ -467,18 +463,18 @@ namespace TrilinosWrappers { if (size() != v.size()) { - map = Epetra_LocalMap (v.vector->Map().NumGlobalElements(), + map = Epetra_LocalMap (v.vector->Map().NumGlobalElements(), v.vector->Map().IndexBase(), v.vector->Comm()); vector = std::auto_ptr (new Epetra_FEVector(map)); } const int ierr = vector->Update(1.0, *v.vector, 0.0); - AssertThrow (ierr == 0, ExcTrilinosError(ierr)); + AssertThrow (ierr == 0, ExcTrilinosError(ierr)); return *this; } - + } DEAL_II_NAMESPACE_CLOSE -- 2.39.5