PlayaEpetraVectorType.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 //
00003 /* @HEADER@ */
00004 
00005 #ifndef PLAYA_EPETRAVECTORTYPE_HPP
00006 #define PLAYA_EPETRAVECTORTYPE_HPP
00007 
00008 #include "PlayaEpetraVectorSpace.hpp"
00009 #include "PlayaHandleable.hpp"
00010 #include "PlayaPrintable.hpp"
00011 #include "Teuchos_Describable.hpp"
00012 #include "PlayaVectorTypeBase.hpp"
00013 
00014 
00015 namespace Playa
00016 {
00017 using namespace Teuchos;
00018   
00019 /**
00020  * \!brief Epetra vector type is a factory for epetra vector spaces
00021  */
00022 class EpetraVectorType : public VectorTypeBase<double>,
00023                          public Playa::Handleable<VectorTypeBase<double> >,
00024                          public Printable,
00025                          public Describable
00026 {
00027 public:
00028   /** Construct a vector type */
00029   EpetraVectorType();
00030       
00031   /** virtual dtor */
00032   virtual ~EpetraVectorType() {;}
00033 
00034   /** create a distributed vector space.
00035    * @param dimension the dimension of the space 
00036    * @param nLocal number of indices owned by the local processor
00037    * @param locallyOwnedIndices array of indices owned by this processor  
00038    */
00039   RCP<const VectorSpaceBase<double> > 
00040   createSpace(int dimension, 
00041     int nLocal,
00042     const int* locallyOwnedIndices,
00043     const MPIComm& comm) const ;
00044 
00045   /**  
00046    * Create an importer for accessing ghost elements.
00047    * @param space the distributed vector space on which ghost elements
00048    * are to be shared
00049    * @param nGhost number of ghost elements needed by this processor
00050    * @param ghostIndices read-only C array of off-processor indices needed
00051    * by this processor.
00052    * @return A RCP to a GhostImporter object.
00053    */
00054   RCP<GhostImporter<double> > 
00055   createGhostImporter(const VectorSpace<double>& space,
00056     int nGhost,
00057     const int* ghostIndices) const ;
00058 
00059 
00060   /**
00061    * Create a matrix factory of type compatible with this vector type,
00062    * sized according to the given domain and range spaces.
00063    */
00064   RCP<MatrixFactory<double> >
00065   createMatrixFactory(const VectorSpace<double>& domain,
00066     const VectorSpace<double>& range) const ;
00067 
00068     
00069 
00070   /** \name Printable interface */
00071   //@{
00072   /** Print to stream */
00073   void print(std::ostream& os) const {os << description();}
00074   //@}
00075 
00076   GET_RCP(VectorTypeBase<double>);
00077 };
00078   
00079 }
00080 
00081 #endif

Site Contact