00001 /* @HEADER@ */ 00002 // 00003 /* @HEADER@ */ 00004 00005 #ifndef PLAYA_GHOSTIMPORTER_HPP 00006 #define PLAYA_GHOSTIMPORTER_HPP 00007 00008 #include "PlayaVectorDecl.hpp" 00009 #include "PlayaVectorSpaceDecl.hpp" 00010 #include "PlayaGhostView.hpp" 00011 00012 namespace Playa 00013 { 00014 using namespace Teuchos; 00015 00016 /** 00017 * In many applications it is necessary to view some subset of 00018 * off-processor, or "ghost", elements of a vector. In 00019 * matrix-vector multiplications, 00020 * access to off-processor elements is assumed to be handled internally 00021 * by the apply() method of LinearOp subtypes, so the Playa Vector type 00022 * does not need explicit accessors for ghost elements. However, in 00023 * application interfaces such as finite element assembly engines, 00024 * read-only access to ghost elements is sometimes required. The abstract 00025 * classes GhostImporter and GhostView define flexible interfaces 00026 * through which a set of required ghosts can be defined, ghost values 00027 * can be imported, and element values can be accessed through 00028 * global indices. 00029 * 00030 * Class GhostImporter is used to specify the set of ghost elements 00031 * that must be imported to this processor, and then to carry out the import. 00032 * It will often be the case that we do many imports with the same 00033 * set of ghost indices; for example, in a nonlinear problem the 00034 * import of the same set of ghost indices 00035 * will be repeated at each function evaluation. Therefore, it makes sense 00036 * to do the definition of the ghost index set and the import as 00037 * distinct methods. The definition of the ghost index set should be done 00038 * in the constructors of GhostImporter subclasses. 00039 */ 00040 template <class Scalar> 00041 class GhostImporter 00042 { 00043 public: 00044 /** virtual dtor */ 00045 virtual ~GhostImporter(){;} 00046 00047 /** 00048 * Import the ghost elements of the given vector 00049 * as specified during construction of this object. 00050 */ 00051 virtual void importView(const Vector<Scalar>& x, 00052 RCP<GhostView<Scalar> >& ghostView) const = 0 ; 00053 00054 }; 00055 00056 } 00057 00058 #endif