47 #ifndef __Teko_InterlacedTpetra_hpp__
48 #define __Teko_InterlacedTpetra_hpp__
51 #include "Teuchos_RCP.hpp"
54 #include "Tpetra_Map.hpp"
55 #include "Tpetra_CrsMatrix.hpp"
56 #include "Tpetra_MultiVector.hpp"
57 #include "Tpetra_Vector.hpp"
58 #include "Tpetra_Export.hpp"
59 #include "Tpetra_Import.hpp"
61 #include "Teko_ConfigDefs.hpp"
66 namespace TpetraHelpers {
88 void buildSubMaps(GO numGlobals,
int numVars,
const Teuchos::Comm<int> & comm,
89 std::vector<std::pair<
int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > & subMaps);
110 void buildSubMaps(GO numGlobals,
const std::vector<int> & vars,
const Teuchos::Comm<int> & comm,
111 std::vector<std::pair<
int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > & subMaps);
134 void buildSubMaps(GO numGlobals,LO numMyElements,GO minMyGID,
const std::vector<int> & vars,
const Teuchos::Comm<int> & comm,
135 std::vector<std::pair<
int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > & subMaps);
157 void buildSubMaps(
const Tpetra::Map<LO,GO,NT> & globalMap,
const std::vector<int> & vars,
const Teuchos::Comm<int> & comm,
158 std::vector<std::pair<
int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > & subMaps);
161 void buildExportImport(
const Tpetra::Map<LO,GO,NT> & baseMap,
162 const std::vector<std::pair<
int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > & subMaps,
163 std::vector<Teuchos::RCP<Tpetra::Export<LO,GO,NT> > > & subExport,
164 std::vector<Teuchos::RCP<Tpetra::Import<LO,GO,NT> > > & subImport);
167 void buildSubVectors(
const std::vector<std::pair<
int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > & subMaps,
168 std::vector<Teuchos::RCP<Tpetra::MultiVector<ST,LO,GO,NT> > > & subVectors,LO count);
173 void associateSubVectors(
const std::vector<std::pair<
int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > & subMaps,
174 std::vector<Teuchos::RCP<
const Tpetra::MultiVector<ST,LO,GO,NT> > > & subVectors);
177 Teuchos::RCP<Tpetra::CrsMatrix<ST,LO,GO,NT> > buildSubBlock(
int i,
int j,
const Teuchos::RCP<
const Tpetra::CrsMatrix<ST,LO,GO,NT> >& A,
178 const std::vector<std::pair<
int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > & subMaps);
181 void rebuildSubBlock(
int i,
int j,
const Teuchos::RCP<
const Tpetra::CrsMatrix<ST,LO,GO,NT> >& A,
182 const std::vector<std::pair<
int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > & subMaps,Tpetra::CrsMatrix<ST,LO,GO,NT> & mat);
185 void many2one(Tpetra::MultiVector<ST,LO,GO,NT> & one,
const std::vector<Teuchos::RCP<
const Tpetra::MultiVector<ST,LO,GO,NT> > > & many,
186 const std::vector<Teuchos::RCP<Tpetra::Export<LO,GO,NT> > > & subExport);
189 void one2many(std::vector<Teuchos::RCP<Tpetra::MultiVector<ST,LO,GO,NT> > > & many,
const Tpetra::MultiVector<ST,LO,GO,NT> & single,
190 const std::vector<Teuchos::RCP<Tpetra::Import<LO,GO,NT> > > & subImport);