47 #ifndef __Teko_BlockingTpetra_hpp__
48 #define __Teko_BlockingTpetra_hpp__
50 #include "Teuchos_RCP.hpp"
53 #include "Tpetra_Map.hpp"
54 #include "Tpetra_CrsMatrix.hpp"
55 #include "Tpetra_Vector.hpp"
56 #include "Tpetra_MultiVector.hpp"
57 #include "Tpetra_Export.hpp"
58 #include "Tpetra_Import.hpp"
60 #include "Teko_ConfigDefs.hpp"
65 namespace TpetraHelpers {
68 typedef std::pair<Teuchos::RCP<Tpetra::Map<LO,GO,NT> >,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > MapPair;
69 typedef std::pair<Teuchos::RCP<Tpetra::Import<LO,GO,NT> >,Teuchos::RCP<Tpetra::Export<LO,GO,NT> > > ImExPair;
84 const MapPair buildSubMap(
const std::vector< GO > & gid,
const Teuchos::Comm<int> &comm);
95 const ImExPair buildExportImport(
const Tpetra::Map<LO,GO,NT> & baseMap,
const MapPair & maps);
106 void many2one(Tpetra::MultiVector<ST,LO,GO,NT> & one,
const std::vector<Teuchos::RCP<
const Tpetra::MultiVector<ST,LO,GO,NT> > > & many,
107 const std::vector<Teuchos::RCP<Tpetra::Export<LO,GO,NT> > > & subExport);
115 void one2many(std::vector<Teuchos::RCP<Tpetra::MultiVector<ST,LO,GO,NT> > > & many,
const Tpetra::MultiVector<ST,LO,GO,NT> & single,
116 const std::vector<Teuchos::RCP<Tpetra::Import<LO,GO,NT> > > & subImport);
125 void buildSubVectors(
const std::vector<MapPair> & maps,
126 std::vector<Teuchos::RCP<Tpetra::MultiVector<ST,LO,GO,NT> > > & vectors,
int count);
133 Teuchos::RCP<Tpetra::Vector<GO,LO,GO,NT> > getSubBlockColumnGIDs(
const Tpetra::CrsMatrix<ST,LO,GO,NT> & A,
const MapPair & mapPair);
148 Teuchos::RCP<Tpetra::CrsMatrix<ST,LO,GO,NT> > buildSubBlock(
int i,
int j,
const Teuchos::RCP<
const Tpetra::CrsMatrix<ST,LO,GO,NT> >& A,
const std::vector<MapPair> & subMaps);
163 void rebuildSubBlock(
int i,
int j,
const Teuchos::RCP<
const Tpetra::CrsMatrix<ST,LO,GO,NT> >& A,
const std::vector<MapPair> & subMaps,Tpetra::CrsMatrix<ST,LO,GO,NT> & mat);