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_SPMD_VECTOR_SPACE_STD_DECL_HPP 00030 #define THYRA_SPMD_VECTOR_SPACE_STD_DECL_HPP 00031 00032 #include "Teuchos_Handleable.hpp" 00033 #include "Thyra_SpmdVectorSpaceDefaultBaseDecl.hpp" 00034 00035 namespace Thyra { 00036 00051 template<class Scalar> 00052 class DefaultSpmdVectorSpace : public SpmdVectorSpaceDefaultBase<Scalar>, 00053 public Teuchos::Handleable<VectorSpaceBase<Scalar> > 00054 { 00055 public: 00056 /* handleable interface */ 00057 TEUCHOS_GET_RCP(VectorSpaceBase<Scalar>); 00058 00061 00065 DefaultSpmdVectorSpace(); 00066 00068 DefaultSpmdVectorSpace( const Index dim ); 00069 00071 DefaultSpmdVectorSpace( 00072 const Teuchos::RCP<const Teuchos::Comm<Index> > &comm 00073 ,const Index localSubDim, const Index globalDim 00074 ); 00075 00083 void initialize( 00084 const Index dim 00085 ); 00086 00133 void initialize( 00134 const Teuchos::RCP<const Teuchos::Comm<Index> > &comm 00135 ,const Index localSubDim, const Index globalDim 00136 ); 00137 00146 void uninitialize(); 00147 00149 00155 bool hasInCoreView( 00156 const Range1D& rng, const EViewType viewType, const EStrideType strideType 00157 ) const; 00159 Teuchos::RCP< const VectorSpaceBase<Scalar> > clone() const; 00161 00162 protected: 00163 00166 00168 Teuchos::RCP<VectorBase<Scalar> > 00169 createMember() const; 00171 Teuchos::RCP<MultiVectorBase<Scalar> > 00172 createMembers(int numMembers) const; 00174 Teuchos::RCP<VectorBase<Scalar> > 00175 createMemberView( const RTOpPack::SubVectorView<Scalar> &raw_v ) const; 00177 Teuchos::RCP<const VectorBase<Scalar> > 00178 createMemberView( const RTOpPack::ConstSubVectorView<Scalar> &raw_v ) const; 00180 Teuchos::RCP<MultiVectorBase<Scalar> > 00181 createMembersView( const RTOpPack::SubMultiVectorView<Scalar> &raw_mv ) const; 00183 Teuchos::RCP<const MultiVectorBase<Scalar> > 00184 createMembersView( const RTOpPack::ConstSubMultiVectorView<Scalar> &raw_mv ) const; 00185 00187 00188 public: 00189 00192 00194 Teuchos::RCP<const Teuchos::Comm<Index> > getComm() const; 00196 Index localSubDim() const; 00197 00199 00200 private: 00201 00202 // ////////////////////////////////////// 00203 // Private data members 00204 00205 Teuchos::RCP<const Teuchos::Comm<Index> > comm_; 00206 Index localSubDim_; 00207 int numProc_; 00208 int procRank_; 00209 00210 }; // end class DefaultSpmdVectorSpace 00211 00212 } // end namespace Thyra 00213 00214 #endif // THYRA_SPMD_VECTOR_SPACE_STD_DECL_HPP
1.4.7