ESyS-Particle
4.0.1
|
00001 00002 // // 00003 // Copyright (c) 2003-2011 by The University of Queensland // 00004 // Earth Systems Science Computational Centre (ESSCC) // 00005 // http://www.uq.edu.au/esscc // 00006 // // 00007 // Primary Business: Brisbane, Queensland, Australia // 00008 // Licensed under the Open Software License version 3.0 // 00009 // http://www.opensource.org/licenses/osl-3.0.php // 00010 // // 00012 00013 #ifndef __PARALLEL_INTERACTION_STORAGE_E_H 00014 #define __PARALLEL_INTERACTION_STORAGE_E_H 00015 00016 //--- project includes --- 00017 #include "pi_storage.h" 00018 #include "tml/comm/cart_comm.h" 00019 00020 //--- STL includes --- 00021 #include <utility> 00022 #include <set> 00023 #include <vector> 00024 using std::vector; 00025 using std::pair; 00026 using std::make_pair; 00027 using std::set; 00028 00029 class AParallelParticleArray; 00030 00035 template<typename P,typename I> 00036 class ParallelInteractionStorage_E : public TParallelInteractionStorage<I> 00037 { 00038 public: // types 00039 // typedef I ParallelInteractionStorage_E::interaction_type; 00040 typedef TParallelInteractionStorage<I> Inherited; 00041 typedef typename Inherited::InteractionIterator InteractionIterator; 00042 bool m_unbreakable; 00043 00044 private: 00045 00046 static const int m_exchg_tag; 00047 00048 void exchange_boundary(int,int); 00049 00050 protected: 00051 TML_CartComm m_comm; 00052 set<pair<int,int> > m_set; // evil hack, should be std::vector<int>, not pair<int,int> 00053 typename I::ParameterType m_param; 00054 00055 public: 00056 ParallelInteractionStorage_E(AParallelParticleArray *, const typename I::ParameterType &); 00057 00058 virtual void setUnbreakable(bool); 00059 virtual void exchange(); 00060 virtual void rebuild(); 00061 virtual void tryInsert(const I&); 00062 virtual void tryInsert(const std::vector<int>&); 00063 virtual bool isIn(const std::vector<int>&); 00064 virtual void setTimeStepSize(double dt) 00065 { 00066 } 00067 virtual void calcForces(); 00068 }; 00069 00070 #include "pis/pi_storage_e.hpp" 00071 00072 #endif // __PARALLEL_INTERACTION_STORAGE_E_H