10#ifndef __Teko_BlockingTpetra_hpp__
11#define __Teko_BlockingTpetra_hpp__
13#include "Teuchos_RCP.hpp"
16#include "Tpetra_Map.hpp"
17#include "Tpetra_CrsMatrix.hpp"
18#include "Tpetra_Vector.hpp"
19#include "Tpetra_MultiVector.hpp"
20#include "Tpetra_Export.hpp"
21#include "Tpetra_Import.hpp"
23#include "Teko_ConfigDefs.hpp"
28namespace TpetraHelpers {
31typedef std::pair<Teuchos::RCP<Tpetra::Map<LO, GO, NT> >, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > >
33typedef std::pair<Teuchos::RCP<Tpetra::Import<LO, GO, NT> >,
34 Teuchos::RCP<Tpetra::Export<LO, GO, NT> > >
50const MapPair buildSubMap(
const std::vector<GO>& gid,
const Teuchos::Comm<int>& comm);
61const ImExPair buildExportImport(
const Tpetra::Map<LO, GO, NT>& baseMap,
const MapPair& maps);
73void many2one(Tpetra::MultiVector<ST, LO, GO, NT>& one,
74 const std::vector<Teuchos::RCP<
const Tpetra::MultiVector<ST, LO, GO, NT> > >& many,
75 const std::vector<Teuchos::RCP<Tpetra::Export<LO, GO, NT> > >& subExport);
84void one2many(std::vector<Teuchos::RCP<Tpetra::MultiVector<ST, LO, GO, NT> > >& many,
85 const Tpetra::MultiVector<ST, LO, GO, NT>& single,
86 const std::vector<Teuchos::RCP<Tpetra::Import<LO, GO, NT> > >& subImport);
95void buildSubVectors(
const std::vector<MapPair>& maps,
96 std::vector<Teuchos::RCP<Tpetra::MultiVector<ST, LO, GO, NT> > >& vectors,
104Teuchos::RCP<Tpetra::Vector<GO, LO, GO, NT> > getSubBlockColumnGIDs(
105 const Tpetra::CrsMatrix<ST, LO, GO, NT>& A,
const MapPair& mapPair);
120Teuchos::RCP<Tpetra::CrsMatrix<ST, LO, GO, NT> > buildSubBlock(
121 int i,
int j,
const Teuchos::RCP<
const Tpetra::CrsMatrix<ST, LO, GO, NT> >& A,
122 const std::vector<MapPair>& subMaps,
123 Teuchos::RCP<Tpetra::Vector<GO, LO, GO, NT> > plocal2ContigGIDs = {});
138void rebuildSubBlock(
int i,
int j,
const Teuchos::RCP<
const Tpetra::CrsMatrix<ST, LO, GO, NT> >& A,
139 const std::vector<MapPair>& subMaps, Tpetra::CrsMatrix<ST, LO, GO, NT>& mat,
140 Teuchos::RCP<Tpetra::Vector<GO, LO, GO, NT> > plocal2ContigGIDs = {});