Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "MOR_SnapshotBlockingUtils.hpp"
00008
00009 #include "MOR_EpetraUtils.hpp"
00010
00011 namespace MOR {
00012
00013 Teuchos::RCP<Epetra_Vector> isolateUniformBlock(
00014 const Teuchos::ArrayView<const int> &myBlockLIDs,
00015 Epetra_MultiVector &snapshots)
00016 {
00017 typedef Teuchos::ArrayView<const int>::const_iterator LIDIter;
00018
00019
00020 const Teuchos::RCP<Epetra_Vector> result(new Epetra_Vector(snapshots.Map(), true));
00021 for (LIDIter it = myBlockLIDs.begin(); it != myBlockLIDs.end(); ++it) {
00022 result->ReplaceMyValue(*it, 0, 1.0);
00023 }
00024 normalize(*result);
00025
00026
00027 const int vectorCount = snapshots.NumVectors();
00028 for (int iVec = 0; iVec < vectorCount; ++iVec) {
00029 for (LIDIter it = myBlockLIDs.begin(); it != myBlockLIDs.end(); ++it) {
00030 snapshots.ReplaceMyValue(*it, iVec, 0.0);
00031 }
00032 }
00033
00034 return result;
00035 }
00036
00037 }