Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "Epetra_ImportWithAlternateMap.hpp"
00008
00009 #include "Epetra_Import.h"
00010 #include "Epetra_MultiVector.h"
00011
00012 #include "Teuchos_Assert.hpp"
00013
00014 namespace Epetra {
00015
00016 void
00017 ImportWithAlternateMap(
00018 const Epetra_Import &importer,
00019 const Epetra_MultiVector &source,
00020 Epetra_MultiVector &target,
00021 Epetra_CombineMode mode)
00022 {
00023 const Epetra_BlockMap savedMap = target.Map();
00024 {
00025 const int ierr = target.ReplaceMap(importer.TargetMap());
00026 TEUCHOS_ASSERT(ierr == 0);
00027 }
00028 {
00029 const int ierr = target.Import(source, importer, mode);
00030 TEUCHOS_ASSERT(ierr == 0);
00031 }
00032 {
00033 const int ierr = target.ReplaceMap(savedMap);
00034 TEUCHOS_ASSERT(ierr == 0);
00035 }
00036 }
00037
00038 }