47 #include "Teko_TpetraReorderedMappingStrategy.hpp"
49 #include "Teko_BlockedReordering.hpp"
53 using Teuchos::rcp_dynamic_cast;
54 using Teuchos::rcpFromRef;
57 namespace TpetraHelpers {
59 TpetraReorderedMappingStrategy::TpetraReorderedMappingStrategy(
const BlockReorderManager & brm,
const Teuchos::RCP<const MappingStrategy> & map)
60 : reorderManager_(brm), mapStrategy_(map)
62 rangeMap_ = mapStrategy_->rangeMap();
63 domainMap_ = mapStrategy_->domainMap();
66 void TpetraReorderedMappingStrategy::copyTpetraIntoThyra(
const Tpetra::MultiVector<ST,LO,GO,NT> & X,
67 const Teuchos::Ptr<Thyra::MultiVectorBase<ST> > & thyra_X)
const
69 using Teuchos::ptr_const_cast;
70 using Teuchos::rcp_const_cast;
73 RCP<Thyra::ProductMultiVectorBase<ST> > prod_X = rcp_dynamic_cast<Thyra::ProductMultiVectorBase<ST> >(rcpFromRef(*thyra_X));
74 RCP<Thyra::MultiVectorBase<ST> > flat_X = buildFlatMultiVector(reorderManager_,prod_X);
77 mapStrategy_->copyTpetraIntoThyra(X,flat_X.ptr());
80 void TpetraReorderedMappingStrategy::copyThyraIntoTpetra(
const RCP<
const Thyra::MultiVectorBase<ST> > & thyra_Y,
81 Tpetra::MultiVector<ST,LO,GO,NT> & Y)
const
84 RCP<const Thyra::ProductMultiVectorBase<ST> > prod_Y = rcp_dynamic_cast<
const Thyra::ProductMultiVectorBase<ST> >(rcpFromRef(*thyra_Y));
85 RCP<const Thyra::MultiVectorBase<ST> > flat_Y = buildFlatMultiVector(reorderManager_,prod_Y);
88 mapStrategy_->copyThyraIntoTpetra(flat_Y,Y);