10 #include "Teko_TpetraBasicMappingStrategy.hpp"
11 #include "Teko_TpetraHelpers.hpp"
13 #include "Thyra_TpetraThyraWrappers.hpp"
14 #include "Thyra_DefaultSpmdMultiVector.hpp"
18 using Teuchos::rcp_dynamic_cast;
21 namespace TpetraHelpers {
33 BasicMappingStrategy::BasicMappingStrategy(
const Teuchos::RCP<
const Tpetra::Map<LO, GO, NT> >& rMap,
34 const Teuchos::RCP<
const Tpetra::Map<LO, GO, NT> >& dMap,
35 const Teuchos::Comm<Thyra::Ordinal>& ) {
48 void BasicMappingStrategy::copyTpetraIntoThyra(
49 const Tpetra::MultiVector<ST, LO, GO, NT>& X,
50 const Teuchos::Ptr<Thyra::MultiVectorBase<ST> >& thyra_X)
const {
54 RCP<Thyra::TpetraMultiVector<ST, LO, GO, NT> > vec =
55 rcp_dynamic_cast<Thyra::TpetraMultiVector<ST, LO, GO, NT> >(Teuchos::rcpFromRef(*thyra_X));
56 Teuchos::RCP<Tpetra::MultiVector<ST, LO, GO, NT> > ptrX =
57 Teuchos::rcp_const_cast<Tpetra::MultiVector<ST, LO, GO, NT> >(Teuchos::rcpFromRef(X));
58 fillDefaultSpmdMultiVector(vec, ptrX);
69 void BasicMappingStrategy::copyThyraIntoTpetra(
70 const RCP<
const Thyra::MultiVectorBase<ST> >& thyra_Y,
71 Tpetra::MultiVector<ST, LO, GO, NT>& Y)
const {
72 RCP<const Tpetra::MultiVector<ST, LO, GO, NT> > tSrc =
73 Thyra::TpetraOperatorVectorExtraction<ST, LO, GO, NT>::getConstTpetraMultiVector(thyra_Y);