Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_BlockingEpetra.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_BlockingEpetra_hpp__
11 #define __Teko_BlockingEpetra_hpp__
12 
13 #include "Teuchos_RCP.hpp"
14 
15 // include basic Epetra information
16 #include "Epetra_Map.h"
17 #include "Epetra_Comm.h"
18 #include "Epetra_CrsMatrix.h"
19 #include "Epetra_Vector.h"
20 #include "Epetra_MultiVector.h"
21 #include "Epetra_Export.h"
22 #include "Epetra_Import.h"
23 #include "Epetra_IntVector.h"
24 
25 #include <vector>
26 
27 namespace Teko {
28 namespace Epetra {
29 namespace Blocking {
30 
31 typedef std::pair<Teuchos::RCP<Epetra_Map>, Teuchos::RCP<Epetra_Map> > MapPair;
32 typedef std::pair<Teuchos::RCP<Epetra_Import>, Teuchos::RCP<Epetra_Export> > ImExPair;
33 
47 const MapPair buildSubMap(const std::vector<int> &gid, const Epetra_Comm &comm);
48 
58 const ImExPair buildExportImport(const Epetra_Map &baseMap, const MapPair &maps);
59 
70 void many2one(Epetra_MultiVector &one,
71  const std::vector<Teuchos::RCP<const Epetra_MultiVector> > &many,
72  const std::vector<Teuchos::RCP<Epetra_Export> > &subExport);
73 
81 void one2many(std::vector<Teuchos::RCP<Epetra_MultiVector> > &many,
82  const Epetra_MultiVector &single,
83  const std::vector<Teuchos::RCP<Epetra_Import> > &subImport);
84 
92 void buildSubVectors(const std::vector<MapPair> &maps,
93  std::vector<Teuchos::RCP<Epetra_MultiVector> > &vectors, int count);
94 
100 Teuchos::RCP<Epetra_IntVector> getSubBlockColumnGIDs(const Epetra_CrsMatrix &A,
101  const MapPair &mapPair);
102 
116 Teuchos::RCP<Epetra_CrsMatrix> buildSubBlock(int i, int j, const Epetra_CrsMatrix &A,
117  const std::vector<MapPair> &subMaps);
118 
132 void rebuildSubBlock(int i, int j, const Epetra_CrsMatrix &A, const std::vector<MapPair> &subMaps,
133  Epetra_CrsMatrix &mat);
134 
135 } // namespace Blocking
136 } // namespace Epetra
137 } // namespace Teko
138 
139 #endif