10 #include "Epetra/Teko_ReorderedMappingStrategy.hpp"
12 #include "Teko_BlockedReordering.hpp"
16 using Teuchos::rcp_dynamic_cast;
17 using Teuchos::rcpFromRef;
22 ReorderedMappingStrategy::ReorderedMappingStrategy(
const BlockReorderManager& brm,
23 const Teuchos::RCP<const MappingStrategy>& map)
24 : reorderManager_(brm), mapStrategy_(map) {
25 rangeMap_ = mapStrategy_->rangeMap();
26 domainMap_ = mapStrategy_->domainMap();
29 void ReorderedMappingStrategy::copyEpetraIntoThyra(
30 const Epetra_MultiVector& X,
31 const Teuchos::Ptr<Thyra::MultiVectorBase<double> >& thyra_X)
const {
32 using Teuchos::ptr_const_cast;
33 using Teuchos::rcp_const_cast;
36 RCP<Thyra::ProductMultiVectorBase<double> > prod_X =
37 rcp_dynamic_cast<Thyra::ProductMultiVectorBase<double> >(rcpFromRef(*thyra_X));
38 RCP<Thyra::MultiVectorBase<double> > flat_X = buildFlatMultiVector(reorderManager_, prod_X);
41 mapStrategy_->copyEpetraIntoThyra(X, flat_X.ptr());
44 void ReorderedMappingStrategy::copyThyraIntoEpetra(
45 const RCP<
const Thyra::MultiVectorBase<double> >& thyra_Y, Epetra_MultiVector& Y)
const {
47 RCP<const Thyra::ProductMultiVectorBase<double> > prod_Y =
48 rcp_dynamic_cast<
const Thyra::ProductMultiVectorBase<double> >(rcpFromRef(*thyra_Y));
49 RCP<const Thyra::MultiVectorBase<double> > flat_Y = buildFlatMultiVector(reorderManager_, prod_Y);
52 mapStrategy_->copyThyraIntoEpetra(flat_Y, Y);