Teko Version of the Day
Loading...
Searching...
No Matches
Teko_BlockingTpetra.hpp
1// @HEADER
2// *****************************************************************************
3// Teko: A package for block and physics based preconditioning
4//
5// Copyright 2010 NTESS and the Teko contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef __Teko_BlockingTpetra_hpp__
11#define __Teko_BlockingTpetra_hpp__
12
13#include "Teuchos_RCP.hpp"
14
15// include basic Tpetra information
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"
22
23#include "Teko_ConfigDefs.hpp"
24
25#include <vector>
26
27namespace Teko {
28namespace TpetraHelpers {
29namespace Blocking {
30
31typedef std::pair<Teuchos::RCP<Tpetra::Map<LO, GO, NT> >, Teuchos::RCP<Tpetra::Map<LO, GO, NT> > >
32 MapPair;
33typedef std::pair<Teuchos::RCP<Tpetra::Import<LO, GO, NT> >,
34 Teuchos::RCP<Tpetra::Export<LO, GO, NT> > >
35 ImExPair;
36
50const MapPair buildSubMap(const std::vector<GO>& gid, const Teuchos::Comm<int>& comm);
51
61const ImExPair buildExportImport(const Tpetra::Map<LO, GO, NT>& baseMap, const MapPair& maps);
62
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);
76
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);
87
95void buildSubVectors(const std::vector<MapPair>& maps,
96 std::vector<Teuchos::RCP<Tpetra::MultiVector<ST, LO, GO, NT> > >& vectors,
97 int count);
98
104Teuchos::RCP<Tpetra::Vector<GO, LO, GO, NT> > getSubBlockColumnGIDs(
105 const Tpetra::CrsMatrix<ST, LO, GO, NT>& A, const MapPair& mapPair);
106
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 = {});
124
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 = {});
141
142} // namespace Blocking
143} // namespace TpetraHelpers
144} // namespace Teko
145
146#endif