Teko Version of the Day
Teko_ReorderedLinearOp.cpp
00001 #include "Teko_ReorderedLinearOp.hpp"
00002 
00003 namespace Teko {
00004 
00005 ReorderedLinearOp::ReorderedLinearOp(const Teuchos::RCP<const BlockReorderManager> & mgr,
00006                                      const Teuchos::RCP<Thyra::LinearOpBase<double> > & blockedOp)
00007    : mgr_(mgr), blockedOp_(blockedOp)
00008 {
00009    
00010    range_ = buildFlatVectorSpace(*mgr_,blockedOp_->range());
00011    domain_ = buildFlatVectorSpace(*mgr_,blockedOp_->domain());
00012 }
00013 
00014 VectorSpace ReorderedLinearOp::range() const
00015 {
00016    return range_;
00017 }
00018 
00019 VectorSpace ReorderedLinearOp::domain() const
00020 {
00021    return domain_;
00022 }
00023 
00024 void ReorderedLinearOp::implicitApply(const MultiVector & x, MultiVector & y,
00025                                       const double alpha, const double beta) const
00026 {
00027    using Teuchos::rcp_dynamic_cast;
00028 
00029    Teuchos::RCP<const Thyra::MultiVectorBase<double> > reorderX 
00030       = Teko::buildReorderedMultiVector(*mgr_,rcp_dynamic_cast<const Thyra::ProductMultiVectorBase<double> >(x));
00031    MultiVector reorderY = Teko::buildReorderedMultiVector(*mgr_,rcp_dynamic_cast<Thyra::ProductMultiVectorBase<double> >(y));
00032 
00033    // this will automatically fill the right data
00034    Thyra::apply(*blockedOp_,Thyra::NOTRANS,*reorderX,reorderY.ptr(),alpha,beta);
00035 }
00036 
00037 } // end namespace Teko
 All Classes Files Functions Variables