00001
00002
00003
00004
00005 #ifndef PLAYA_EPETRA_GHOST_VIEW_HPP
00006 #define PLAYA_EPETRA_GHOST_VIEW_HPP
00007
00008 #include "PlayaDefs.hpp"
00009 #include "PlayaGhostImporter.hpp"
00010 #include "PlayaGhostView.hpp"
00011 #include "Epetra_Vector.h"
00012 #include "Teuchos_Utils.hpp"
00013
00014
00015
00016 namespace Playa
00017 {
00018 using namespace Teuchos;
00019
00020
00021
00022
00023
00024 class EpetraGhostView : public GhostView<double>
00025 {
00026 public:
00027
00028 EpetraGhostView()
00029 : ghostView_()
00030 {;}
00031
00032
00033 virtual ~EpetraGhostView(){;}
00034
00035
00036 bool isAccessible(int globalIndex) const
00037 {return ghostView_->Map().MyGID(globalIndex);}
00038
00039
00040 const double& getElement(int globalIndex) const ;
00041
00042
00043 void getElements(const int* globalIndices, int numElems,
00044 Array<double>& elems) const ;
00045
00046
00047 void import(const Epetra_Import& importer,
00048 const Epetra_Vector& srcObject);
00049
00050
00051 void print(std::ostream& os) const ;
00052 private:
00053 RCP<Epetra_Vector> ghostView_;
00054 };
00055
00056 }
00057
00058 #endif