00001 // -*- C++ -*- 00002 // 00003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00004 // 00005 // Fehmi Cirak 00006 // California Institute of Technology 00007 // (C) 2004 All Rights Reserved 00008 // 00009 // <LicenseText> 00010 // 00011 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00012 // 00013 // EDITED BY MATT GALLOWAY FOR USE WITH DAPTA 00014 00015 #ifndef __FIELDEXCHANGER_HPP__ 00016 #define __FIELDEXCHANGER_HPP__ 00017 00018 #include "DomainCoupler.hpp" 00019 00020 #include <vector> 00021 #include <functional> 00022 #include <cassert> 00023 00024 namespace DAPTA { // Define namespace DAPTA 00025 00026 namespace pico { // Define namespace pico 00027 00028 template <typename V> 00029 class FieldExchanger { 00030 public: 00031 typedef V VertexType; 00032 typedef V* VertexHandle; 00033 00034 FieldExchanger(DomainCoupler<V>* coupler, std::vector<int>::iterator lGBegin, int nodes); 00035 ~FieldExchanger() {;} 00036 00037 template <int NVAR, typename FT, template <typename> class OP> 00038 void exchange(FT *field, int fsize); 00039 00040 private: 00041 // copy and equality constructor 00042 FieldExchanger(const FieldExchanger<V> &); 00043 const FieldExchanger & operator=(const FieldExchanger<V> &); 00044 00045 private: 00046 // mapping from imported node id's to local node id's 00047 std::vector<int> _importedNodeIDs; 00048 00049 // domain coupler instance which handles the communication 00050 DomainCoupler<V> *_coupler; 00051 }; 00052 00053 } // namespace pico 00054 00055 } // namespace DAPTA 00056 00057 #include "FieldExchanger.cpp" 00058 00059 #endif
1.5.1