PlayaEpetraGhostView.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 //
00003 /* @HEADER@ */
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  * Ghost element viewer for Epetra vectors
00023  */
00024 class EpetraGhostView : public GhostView<double>
00025 {
00026 public:
00027   /** */
00028   EpetraGhostView()
00029     : ghostView_() 
00030     {;}
00031 
00032   /** virtual dtor */
00033   virtual ~EpetraGhostView(){;}
00034 
00035   /** Indicate whether the given global index is accessible in this view */
00036   bool isAccessible(int globalIndex) const 
00037     {return ghostView_->Map().MyGID(globalIndex);}
00038 
00039   /** get the element at the given global index */
00040   const double& getElement(int globalIndex) const ;
00041 
00042   /** get the batch of elements at the given global indices */
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

Site Contact