47 #ifndef __Teko_TpetraStridedMappingStrategy_hpp__
48 #define __Teko_TpetraStridedMappingStrategy_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_ConfigDefs.hpp"
73 namespace TpetraHelpers {
75 class TpetraStridedMappingStrategy :
public MappingStrategy {
89 TpetraStridedMappingStrategy(
const std::vector<int> & vars,
const Teuchos::RCP<
const Tpetra::Map<LO,GO,NT> > & map,
const Teuchos::Comm<int> & comm);
102 virtual void copyTpetraIntoThyra(
const Tpetra::MultiVector<ST,LO,GO,NT>& tpetra_X,
103 const Teuchos::Ptr<Thyra::MultiVectorBase<ST> > & thyra_X)
const;
112 virtual void copyThyraIntoTpetra(
const Teuchos::RCP<
const Thyra::MultiVectorBase<ST> > & thyra_Y,
113 Tpetra::MultiVector<ST,LO,GO,NT>& tpetra_Y)
const;
122 virtual const Teuchos::RCP<const Tpetra::Map<LO,GO,NT> > domainMap()
const
123 {
return domainMap_; }
132 virtual const Teuchos::RCP<const Tpetra::Map<LO,GO,NT> > rangeMap()
const
133 {
return rangeMap_; }
139 virtual std::string toString()
const
140 {
return std::string(
"TpetraStridedMappingStrategy"); }
161 void buildBlockTransferData(
const std::vector<int> & vars,
const Teuchos::RCP<
const Tpetra::Map<LO,GO,NT> > & baseMap,
162 const Teuchos::Comm<int> & comm);
175 const std::vector<std::pair<int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > & getMaps()
const
176 {
return blockMaps_; }
189 const Teuchos::RCP<Thyra::BlockedLinearOpBase<ST> >
190 buildBlockedThyraOp(
const Teuchos::RCP<
const Tpetra::CrsMatrix<ST,LO,GO,NT> > & mat,
const std::string & label=
"<ANYM>")
const;
201 void rebuildBlockedThyraOp(
const RCP<
const Tpetra::CrsMatrix<ST,LO,GO,NT> > & mat,
202 const RCP<Thyra::BlockedLinearOpBase<ST> > & A)
const;
211 Teuchos::RCP<const Tpetra::Map<LO,GO,NT> > domainMap_;
212 Teuchos::RCP<const Tpetra::Map<LO,GO,NT> > rangeMap_;
217 std::vector<std::pair<int,Teuchos::RCP<Tpetra::Map<LO,GO,NT> > > > blockMaps_;
218 std::vector<Teuchos::RCP<Tpetra::Export<LO,GO,NT> > > blockExport_;
219 std::vector<Teuchos::RCP<Tpetra::Import<LO,GO,NT> > > blockImport_;
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.