Thyra_DefaultSpmdVectorSpaceDecl.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 
00030 #ifndef THYRA_SPMD_VECTOR_SPACE_STD_DECL_HPP
00031 #define THYRA_SPMD_VECTOR_SPACE_STD_DECL_HPP
00032 
00033 
00034 #include "Teuchos_Handleable.hpp"
00035 #include "Thyra_SpmdVectorSpaceDefaultBaseDecl.hpp"
00036 
00037 
00038 namespace Thyra {
00039 
00040 
00055 template<class Scalar>
00056 class DefaultSpmdVectorSpace
00057   : public SpmdVectorSpaceDefaultBase<Scalar>,
00058     public Teuchos::Handleable<VectorSpaceBase<Scalar> >
00059 {
00060 public:
00061   /* handleable interface */
00062   TEUCHOS_GET_RCP(VectorSpaceBase<Scalar>);
00063 
00066  
00070   DefaultSpmdVectorSpace();
00071 
00073   DefaultSpmdVectorSpace( const Index dim );
00074 
00076   DefaultSpmdVectorSpace(
00077     const RCP<const Teuchos::Comm<Index> > &comm
00078     ,const Index localSubDim, const Index globalDim
00079     );
00080 
00088   void initialize(
00089     const Index dim
00090     );
00091 
00138   void initialize(
00139     const RCP<const Teuchos::Comm<Index> > &comm
00140     ,const Index localSubDim, const Index globalDim
00141     );
00142 
00151   void uninitialize();
00152 
00154 
00160   bool hasInCoreView(
00161     const Range1D& rng, const EViewType viewType, const EStrideType strideType
00162     ) const;
00164   RCP< const VectorSpaceBase<Scalar> > clone() const;
00166 
00167 protected:
00168 
00171 
00173   RCP<VectorBase<Scalar> >
00174   createMember() const;
00176   RCP<MultiVectorBase<Scalar> >
00177   createMembers(int numMembers) const;
00179   RCP<VectorBase<Scalar> >
00180   createMemberView( const RTOpPack::SubVectorView<Scalar> &raw_v ) const;
00182   RCP<const VectorBase<Scalar> >
00183   createMemberView( const RTOpPack::ConstSubVectorView<Scalar> &raw_v ) const;
00185   RCP<MultiVectorBase<Scalar> >
00186   createMembersView( const RTOpPack::SubMultiVectorView<Scalar> &raw_mv ) const;
00188   RCP<const MultiVectorBase<Scalar> >
00189   createMembersView( const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv ) const;
00190 
00192 
00193 public:
00194 
00197 
00199   RCP<const Teuchos::Comm<Index> > getComm() const;
00201   Index localSubDim() const;
00202 
00204 
00205 private:
00206 
00207   // //////////////////////////////////////
00208   // Private data members
00209 
00210   RCP<const Teuchos::Comm<Index> > comm_;
00211   Index localSubDim_;
00212   int numProc_;
00213   int procRank_;
00214  
00215 }; // end class DefaultSpmdVectorSpace
00216 
00217 
00222 template<class Scalar>
00223 RCP<DefaultSpmdVectorSpace<Scalar> >
00224 defaultSpmdVectorSpace( const Index dim )
00225 {
00226   RCP<DefaultSpmdVectorSpace<Scalar> >
00227     vs(new DefaultSpmdVectorSpace<Scalar>(dim));
00228   return vs;
00229 }
00230 
00231 } // end namespace Thyra
00232 
00233 
00234 #endif // THYRA_SPMD_VECTOR_SPACE_STD_DECL_HPP

Generated on Wed May 12 21:42:27 2010 for Thyra Operator/Vector Support by  doxygen 1.4.7