PlayaVectorType.hpp

00001 /* @HEADER@ */
00002 //   
00003 /* @HEADER@ */
00004 
00005 #ifndef PLAYA_VECTORTYPE_HPP
00006 #define PLAYA_VECTORTYPE_HPP
00007 
00008 #include "PlayaHandle.hpp"
00009 #include "PlayaVectorTypeBase.hpp"
00010 #include "PlayaVectorSpaceDecl.hpp"
00011 
00012 namespace Playa
00013 {
00014 using namespace Teuchos;
00015 
00020 template <class Scalar>
00021 class VectorType : public Playa::Handle<VectorTypeBase<Scalar> >
00022 {
00023 public:
00024   HANDLE_CTORS(VectorType<Scalar>, VectorTypeBase<Scalar>);
00025    
00026 
00029   VectorSpace<Scalar> createEvenlyPartitionedSpace(const MPIComm& comm,
00030     int nLocal) const ;
00031 
00039   VectorSpace<Scalar> createSpace(int dimension, 
00040     int nLocal,
00041     const int* locallyOwnedIndices,
00042     const MPIComm& comm) const ;
00043 
00044 
00045 
00049   RCP<GhostImporter<Scalar> > 
00050   createGhostImporter(const VectorSpace<Scalar>& space,
00051     int nGhost,
00052     const int* ghostIndices) const ;
00053 
00058   virtual RCP<MatrixFactory<Scalar> >
00059   createMatrixFactory(const VectorSpace<Scalar>& domain,
00060     const VectorSpace<Scalar>& range) const ;
00061                                                       
00062 };
00063 
00064 
00065 
00066 
00067 template <class Scalar> inline 
00068 VectorSpace<Scalar> VectorType<Scalar>::createSpace(int dimension,
00069   int nLocal,
00070   const int* locallyOwnedIndices, const MPIComm& comm) const
00071 {
00072   return this->ptr()->createSpace(dimension, nLocal, locallyOwnedIndices, comm);
00073 }
00074 
00075 template <class Scalar> inline 
00076 VectorSpace<Scalar> VectorType<Scalar>
00077 ::createEvenlyPartitionedSpace(const MPIComm& comm,
00078   int nLocal) const
00079 {
00080   return this->ptr()->createEvenlyPartitionedSpace(comm, nLocal);
00081 }
00082 
00083 
00084 template <class Scalar> inline 
00085 RCP<GhostImporter<Scalar> > 
00086 VectorType<Scalar>::createGhostImporter(const VectorSpace<Scalar>& space,
00087   int nGhost,
00088   const int* ghostIndices) const
00089 {
00090   return this->ptr()->createGhostImporter(space, nGhost, ghostIndices);
00091 }
00092 
00093 template <class Scalar> inline
00094 RCP<MatrixFactory<Scalar> >
00095 VectorType<Scalar>::createMatrixFactory(const VectorSpace<Scalar>& domain,
00096   const VectorSpace<Scalar>& range) const
00097 {
00098   return this->ptr()->createMatrixFactory(domain, range);
00099 }
00100 
00101   
00102 }
00103 
00104 #endif

doxygen