47 #ifndef __Teko_TpetraBlockedMappingStrategy_hpp__
48 #define __Teko_TpetraBlockedMappingStrategy_hpp__
54 #include "Teuchos_RCP.hpp"
57 #include "Thyra_MultiVectorBase.hpp"
58 #include "Thyra_LinearOpBase.hpp"
59 #include "Thyra_BlockedLinearOpBase.hpp"
62 #include "Tpetra_Map.hpp"
63 #include "Tpetra_MultiVector.hpp"
64 #include "Tpetra_Import.hpp"
65 #include "Tpetra_Export.hpp"
66 #include "Tpetra_CrsMatrix.hpp"
69 #include "Teko_TpetraOperatorWrapper.hpp"
70 #include "Teko_BlockingTpetra.hpp"
71 #include "Teko_ConfigDefs.hpp"
74 namespace TpetraHelpers {
76 class TpetraBlockedMappingStrategy :
public MappingStrategy {
90 TpetraBlockedMappingStrategy(
const std::vector<std::vector<GO> > & vars,
91 const Teuchos::RCP<
const Tpetra::Map<LO,GO,NT> > & baseMap,
const Teuchos::Comm<int> & comm);
104 virtual void copyTpetraIntoThyra(
const Tpetra::MultiVector<ST,LO,GO,NT>& tpetra_X,
105 const Teuchos::Ptr<Thyra::MultiVectorBase<ST> > & thyra_X)
const;
114 virtual void copyThyraIntoTpetra(
const Teuchos::RCP<
const Thyra::MultiVectorBase<ST> > & thyra_Y,
115 Tpetra::MultiVector<ST,LO,GO,NT>& tpetra_Y)
const;
124 virtual const Teuchos::RCP<const Tpetra::Map<LO,GO,NT> > domainMap()
const
125 {
return domainMap_; }
134 virtual const Teuchos::RCP<const Tpetra::Map<LO,GO,NT> > rangeMap()
const
135 {
return rangeMap_; }
141 virtual std::string toString()
const
142 {
return std::string(
"TpetraBlockedMappingStrategy"); }
163 void buildBlockTransferData(
const std::vector<std::vector<GO> > & vars,
164 const Teuchos::RCP<
const Tpetra::Map<LO,GO,NT> > & baseMap,
const Teuchos::Comm<int> & comm);
177 const std::vector<Blocking::MapPair> & getMaps()
const
178 {
return blockMaps_; }
191 const Teuchos::RCP<Thyra::BlockedLinearOpBase<ST> >
192 buildBlockedThyraOp(
const Teuchos::RCP<
const Tpetra::CrsMatrix<ST,LO,GO,NT> > & mat,
const std::string & label=
"<ANYM>")
const;
203 void rebuildBlockedThyraOp(
const RCP<
const Tpetra::CrsMatrix<ST,LO,GO,NT> > & mat,
204 const RCP<Thyra::BlockedLinearOpBase<ST> > & A)
const;
213 Teuchos::RCP<const Tpetra::Map<LO,GO,NT> > domainMap_;
214 Teuchos::RCP<const Tpetra::Map<LO,GO,NT> > rangeMap_;
219 std::vector<Blocking::MapPair> blockMaps_;
220 std::vector<Teuchos::RCP<Tpetra::Import<LO,GO,NT> > > blockImport_;
221 std::vector<Teuchos::RCP<Tpetra::Export<LO,GO,NT> > > blockExport_;
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.