10 #ifndef __Teko_InterlacedTpetra_hpp__
11 #define __Teko_InterlacedTpetra_hpp__
14 #include "Teuchos_RCP.hpp"
17 #include "Tpetra_Map.hpp"
18 #include "Tpetra_CrsMatrix.hpp"
19 #include "Tpetra_MultiVector.hpp"
20 #include "Tpetra_Vector.hpp"
21 #include "Tpetra_Export.hpp"
22 #include "Tpetra_Import.hpp"
24 #include "Teko_ConfigDefs.hpp"
29 namespace TpetraHelpers {
51 void buildSubMaps(GO numGlobals,
int numVars,
const Teuchos::Comm<int>& comm,
52 std::vector<std::pair<
int, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > > >& subMaps);
73 void buildSubMaps(GO numGlobals,
const std::vector<int>& vars,
const Teuchos::Comm<int>& comm,
74 std::vector<std::pair<
int, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > > >& subMaps);
97 void buildSubMaps(GO numGlobals, LO numMyElements, GO minMyGID,
const std::vector<int>& vars,
98 const Teuchos::Comm<int>& comm,
99 std::vector<std::pair<
int, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > > >& subMaps);
121 void buildSubMaps(
const Tpetra::Map<LO, GO, NT>& globalMap,
const std::vector<int>& vars,
122 const Teuchos::Comm<int>& comm,
123 std::vector<std::pair<
int, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > > >& subMaps);
126 void buildExportImport(
127 const Tpetra::Map<LO, GO, NT>& baseMap,
128 const std::vector<std::pair<
int, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > > >& subMaps,
129 std::vector<Teuchos::RCP<Tpetra::Export<LO, GO, NT> > >& subExport,
130 std::vector<Teuchos::RCP<Tpetra::Import<LO, GO, NT> > >& subImport);
133 void buildSubVectors(
134 const std::vector<std::pair<
int, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > > >& subMaps,
135 std::vector<Teuchos::RCP<Tpetra::MultiVector<ST, LO, GO, NT> > >& subVectors, LO count);
140 void associateSubVectors(
141 const std::vector<std::pair<
int, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > > >& subMaps,
142 std::vector<Teuchos::RCP<
const Tpetra::MultiVector<ST, LO, GO, NT> > >& subVectors);
145 Teuchos::RCP<Tpetra::CrsMatrix<ST, LO, GO, NT> > buildSubBlock(
146 int i,
int j,
const Teuchos::RCP<
const Tpetra::CrsMatrix<ST, LO, GO, NT> >& A,
147 const std::vector<std::pair<
int, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > > >& subMaps);
150 void rebuildSubBlock(
151 int i,
int j,
const Teuchos::RCP<
const Tpetra::CrsMatrix<ST, LO, GO, NT> >& A,
152 const std::vector<std::pair<
int, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > > >& subMaps,
153 Tpetra::CrsMatrix<ST, LO, GO, NT>& mat);
156 void many2one(Tpetra::MultiVector<ST, LO, GO, NT>& one,
157 const std::vector<Teuchos::RCP<
const Tpetra::MultiVector<ST, LO, GO, NT> > >& many,
158 const std::vector<Teuchos::RCP<Tpetra::Export<LO, GO, NT> > >& subExport);
161 void one2many(std::vector<Teuchos::RCP<Tpetra::MultiVector<ST, LO, GO, NT> > >& many,
162 const Tpetra::MultiVector<ST, LO, GO, NT>& single,
163 const std::vector<Teuchos::RCP<Tpetra::Import<LO, GO, NT> > >& subImport);