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