47 #include "Epetra/Teko_ReorderedMappingStrategy.hpp"
49 #include "Teko_BlockedReordering.hpp"
53 using Teuchos::rcp_dynamic_cast;
54 using Teuchos::rcpFromRef;
59 ReorderedMappingStrategy::ReorderedMappingStrategy(
const BlockReorderManager & brm,
const Teuchos::RCP<const MappingStrategy> & map)
60 : reorderManager_(brm), mapStrategy_(map)
62 rangeMap_ = mapStrategy_->rangeMap();
63 domainMap_ = mapStrategy_->domainMap();
66 void ReorderedMappingStrategy::copyEpetraIntoThyra(
const Epetra_MultiVector& X,
67 const Teuchos::Ptr<Thyra::MultiVectorBase<double> > & thyra_X)
const
69 using Teuchos::ptr_const_cast;
70 using Teuchos::rcp_const_cast;
73 RCP<Thyra::ProductMultiVectorBase<double> > prod_X = rcp_dynamic_cast<Thyra::ProductMultiVectorBase<double> >(rcpFromRef(*thyra_X));
74 RCP<Thyra::MultiVectorBase<double> > flat_X = buildFlatMultiVector(reorderManager_,prod_X);
77 mapStrategy_->copyEpetraIntoThyra(X,flat_X.ptr());
80 void ReorderedMappingStrategy::copyThyraIntoEpetra(
const RCP<
const Thyra::MultiVectorBase<double> > & thyra_Y,
81 Epetra_MultiVector& Y)
const
84 RCP<const Thyra::ProductMultiVectorBase<double> > prod_Y = rcp_dynamic_cast<
const Thyra::ProductMultiVectorBase<double> >(rcpFromRef(*thyra_Y));
85 RCP<const Thyra::MultiVectorBase<double> > flat_Y = buildFlatMultiVector(reorderManager_,prod_Y);
88 mapStrategy_->copyThyraIntoEpetra(flat_Y,Y);