10 #ifndef __Teko_TpetraBlockedMappingStrategy_hpp__
11 #define __Teko_TpetraBlockedMappingStrategy_hpp__
17 #include "Teuchos_RCP.hpp"
20 #include "Thyra_MultiVectorBase.hpp"
21 #include "Thyra_LinearOpBase.hpp"
22 #include "Thyra_BlockedLinearOpBase.hpp"
25 #include "Tpetra_Map.hpp"
26 #include "Tpetra_MultiVector.hpp"
27 #include "Tpetra_Import.hpp"
28 #include "Tpetra_Export.hpp"
29 #include "Tpetra_CrsMatrix.hpp"
32 #include "Teko_TpetraOperatorWrapper.hpp"
33 #include "Teko_BlockingTpetra.hpp"
34 #include "Teko_ConfigDefs.hpp"
37 namespace TpetraHelpers {
39 class TpetraBlockedMappingStrategy :
public MappingStrategy {
53 TpetraBlockedMappingStrategy(
const std::vector<std::vector<GO> >& vars,
54 const Teuchos::RCP<
const Tpetra::Map<LO, GO, NT> >& baseMap,
55 const Teuchos::Comm<int>& comm);
68 virtual void copyTpetraIntoThyra(
const Tpetra::MultiVector<ST, LO, GO, NT>& tpetra_X,
69 const Teuchos::Ptr<Thyra::MultiVectorBase<ST> >& thyra_X)
const;
78 virtual void copyThyraIntoTpetra(
const Teuchos::RCP<
const Thyra::MultiVectorBase<ST> >& thyra_Y,
79 Tpetra::MultiVector<ST, LO, GO, NT>& tpetra_Y)
const;
88 virtual const Teuchos::RCP<const Tpetra::Map<LO, GO, NT> > domainMap()
const {
99 virtual const Teuchos::RCP<const Tpetra::Map<LO, GO, NT> > rangeMap()
const {
return rangeMap_; }
105 virtual std::string toString()
const {
return std::string(
"TpetraBlockedMappingStrategy"); }
126 void buildBlockTransferData(
const std::vector<std::vector<GO> >& vars,
127 const Teuchos::RCP<
const Tpetra::Map<LO, GO, NT> >& baseMap,
128 const Teuchos::Comm<int>& comm);
141 const std::vector<Blocking::MapPair>& getMaps()
const {
return blockMaps_; }
154 const Teuchos::RCP<Thyra::BlockedLinearOpBase<ST> > buildBlockedThyraOp(
155 const Teuchos::RCP<
const Tpetra::CrsMatrix<ST, LO, GO, NT> >& mat,
156 const std::string& label =
"<ANYM>")
const;
167 void rebuildBlockedThyraOp(
const RCP<
const Tpetra::CrsMatrix<ST, LO, GO, NT> >& mat,
168 const RCP<Thyra::BlockedLinearOpBase<ST> >& A)
const;
177 Teuchos::RCP<const Tpetra::Map<LO, GO, NT> > domainMap_;
178 Teuchos::RCP<const Tpetra::Map<LO, GO, NT> > rangeMap_;
183 std::vector<Blocking::MapPair> blockMaps_;
184 std::vector<Teuchos::RCP<Tpetra::Import<LO, GO, NT> > > blockImport_;
185 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.