Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_TpetraReorderedMappingStrategy.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_TpetraReorderedMappingStrategy_hpp__
11 #define __Teko_TpetraReorderedMappingStrategy_hpp__
12 
13 // stl includes
14 #include <vector>
15 
16 // Teuchos includes
17 #include "Teuchos_RCP.hpp"
18 
19 // Thyra includes
20 #include "Thyra_MultiVectorBase.hpp"
21 #include "Thyra_LinearOpBase.hpp"
22 
23 // Tpetra includes
24 #include "Tpetra_Map.hpp"
25 #include "Tpetra_MultiVector.hpp"
26 #include "Tpetra_Import.hpp"
27 #include "Tpetra_Export.hpp"
28 #include "Tpetra_CrsMatrix.hpp"
29 
30 // Teko includes
31 #include "Teko_BlockedReordering.hpp"
32 #include "Teko_TpetraOperatorWrapper.hpp"
33 #include "Teko_ConfigDefs.hpp"
34 
35 namespace Teko {
36 namespace TpetraHelpers {
37 
38 class TpetraReorderedMappingStrategy : public MappingStrategy {
39  public:
41 
42 
50  TpetraReorderedMappingStrategy(const BlockReorderManager& brm,
51  const Teuchos::RCP<const MappingStrategy>& map);
53 
55 
56 
64  virtual void copyTpetraIntoThyra(const Tpetra::MultiVector<ST, LO, GO, NT>& tpetra_X,
65  const Teuchos::Ptr<Thyra::MultiVectorBase<ST> >& thyra_X) const;
66 
74  virtual void copyThyraIntoTpetra(const Teuchos::RCP<const Thyra::MultiVectorBase<ST> >& thyra_Y,
75  Tpetra::MultiVector<ST, LO, GO, NT>& tpetra_Y) const;
76 
84  virtual const Teuchos::RCP<const Tpetra::Map<LO, GO, NT> > domainMap() const {
85  return domainMap_;
86  }
87 
95  virtual const Teuchos::RCP<const Tpetra::Map<LO, GO, NT> > rangeMap() const { return rangeMap_; }
96 
101  virtual std::string toString() const { return std::string("TpetraReorderedMappingStrategy"); }
102 
104 
106  virtual RCP<const MappingStrategy> GetPrimaryMapStrategy() const { return mapStrategy_; }
107 
108  protected:
109  // member variables
110 
112 
113  Teuchos::RCP<const Tpetra::Map<LO, GO, NT> > domainMap_;
114  Teuchos::RCP<const Tpetra::Map<LO, GO, NT> > rangeMap_;
116 
118 
119  const BlockReorderManager reorderManager_;
120  RCP<const MappingStrategy> mapStrategy_;
122 };
123 
124 } // end namespace TpetraHelpers
125 } // end namespace Teko
126 
127 #endif
virtual void copyThyraIntoTpetra(const RCP< const Thyra::MultiVectorBase< ST > > &thyraX, Tpetra::MultiVector< ST, LO, GO, NT > &tpetraX) const =0
Copy an Thyra::MultiVectorBase into a Epetra_MultiVector.