Thyra_DefaultClusteredSpmdProductVectorDecl.hpp

00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //    Thyra: Interfaces and Support for Abstract Numerical Algorithms
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef THYRA_DEFAULT_CLUSTERED_SPMD_PRODUCT_VECTOR_DECL_HPP
00030 #define THYRA_DEFAULT_CLUSTERED_SPMD_PRODUCT_VECTOR_DECL_HPP
00031 
00032 #include "Thyra_ProductVectorBase.hpp"
00033 #include "Thyra_VectorDefaultBase.hpp"
00034 
00035 namespace Thyra {
00036 
00038 template <class Scalar> class DefaultClusteredSpmdProductVectorSpace;
00039 
00049 template<class Scalar>
00050 class DefaultClusteredSpmdProductVector
00051   : virtual public ProductVectorBase<Scalar>
00052   , virtual protected VectorDefaultBase<Scalar>
00053 {
00054 public:
00055 
00057   using ProductVectorBase<Scalar>::applyOp;
00058 
00061 
00063   DefaultClusteredSpmdProductVector();
00064 
00066   DefaultClusteredSpmdProductVector(
00067     const Teuchos::RCP<const DefaultClusteredSpmdProductVectorSpace<Scalar> >  &productSpace
00068     ,const Teuchos::RCP<VectorBase<Scalar> >                                   vecs[]
00069     );
00070 
00075   void initialize(
00076     const Teuchos::RCP<const DefaultClusteredSpmdProductVectorSpace<Scalar> >  &productSpace
00077     ,const Teuchos::RCP<VectorBase<Scalar> >                                   vecs[]
00078     );
00079 
00084   void uninitialize(
00085     Teuchos::RCP<const DefaultClusteredSpmdProductVectorSpace<Scalar> >  *productSpace = NULL
00086     ,Teuchos::RCP<VectorBase<Scalar> >                                   vecs[]        = NULL
00087     );
00088 
00090 
00093 
00095   Teuchos::RCP<VectorBase<Scalar> > getNonconstVectorBlock(const int k); 
00097   Teuchos::RCP<const VectorBase<Scalar> > getVectorBlock(const int k) const;
00098 
00100 
00103 
00105   Teuchos::RCP<const ProductVectorSpaceBase<Scalar> > productSpace() const;
00107   bool blockIsConst(const int k) const; 
00109   Teuchos::RCP<MultiVectorBase<Scalar> > getNonconstMultiVectorBlock(const int k); 
00111   Teuchos::RCP<const MultiVectorBase<Scalar> > getMultiVectorBlock(const int k) const;
00112 
00114 
00117 
00119   Teuchos::RCP< const VectorSpaceBase<Scalar> > space() const;
00121   void applyOp(
00122     const RTOpPack::RTOpT<Scalar>    &op
00123     ,const int                       num_vecs
00124     ,const VectorBase<Scalar>*const  vecs[]
00125     ,const int                       num_targ_vecs
00126     ,VectorBase<Scalar>*const        targ_vecs[]
00127     ,RTOpPack::ReductTarget          *reduct_obj
00128     ,const Index                     first_ele
00129     ,const Index                     sub_dim
00130     ,const Index                     global_offset
00131     ) const;
00132 
00134 
00135 private:
00136 
00137   // //////////////////////////////
00138   // Private data members
00139 
00140   Teuchos::RCP<const DefaultClusteredSpmdProductVectorSpace<Scalar> >   productSpace_;
00141   std::vector<Teuchos::RCP<VectorBase<Scalar> > >                       vecs_;
00142 
00143 };
00144 
00145 } // namespace Thyra
00146 
00147 #endif // THYRA_DEFAULT_CLUSTERED_SPMD_PRODUCT_VECTOR_DECL_HPP

Generated on Tue Oct 20 12:46:58 2009 for Thyra Operator/Vector Support by doxygen 1.4.7