ESyS-Particle  2.3
TempPartStore.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __TEMPPARTSTORE_H
14 #define __TEMPPARTSTORE_H
15 
16 // --- Project includes ---
17 #include "vec3.h"
18 
19 // --- STL includes ---
20 #include <map>
21 #include <utility>
22 
23 using std::map;
24 using std::multimap;
25 using std::pair;
26 using std::make_pair;
27 
33 {
34  public:
35  virtual ~ATempPartStore() {}
36  virtual void addSlaveID(int,int,int,int)=0;
37  virtual void addConnection(int,int,int)=0;
38 };
39 
46 template<typename T>
48 {
49  private:
50  multimap<int,T> m_mmap;
51  map<int,typename multimap<int,T>::iterator> m_by_id;
52  map<int,int> m_slave_id_map;
53 
55  int m_nx,m_ny,m_nz;
56 
57  int coordsToIndex(int,int,int);
58  int posToIndex(const Vec3&);
59 
60  public:
61  TTempPartStore(const Vec3&,const Vec3&, int,int,int);
62 
63  virtual void addSlaveID(int,int,int,int);
64  virtual void addParticle(const T&);
65  virtual void addConnection(int,int,int);
66 
67  const multimap<int,T>& getMap() const {return m_mmap;};
68 };
69 
70 #include "TempPartStore.hpp"
71 
72 #endif //__TEMPPARTSTORE_H
virtual void addSlaveID(int, int, int, int)
Definition: TempPartStore.hpp:77
Definition: vec3.h:46
double m_xmin
Definition: TempPartStore.h:54
virtual void addParticle(const T &)
Definition: TempPartStore.hpp:89
TTempPartStore(const Vec3 &, const Vec3 &, int, int, int)
Definition: TempPartStore.hpp:23
multimap< int, T > m_mmap
Definition: TempPartStore.h:50
double m_xsize
Definition: TempPartStore.h:54
pure virtual base for TTempPartStore
Definition: TempPartStore.h:32
map< int, typename multimap< int, T >::iterator > m_by_id
Definition: TempPartStore.h:51
double m_zsize
Definition: TempPartStore.h:54
int m_ny
Definition: TempPartStore.h:55
double m_zmin
Definition: TempPartStore.h:54
int posToIndex(const Vec3 &)
Definition: TempPartStore.hpp:60
virtual ~ATempPartStore()
Definition: TempPartStore.h:35
virtual void addSlaveID(int, int, int, int)=0
virtual void addConnection(int, int, int)=0
class for the temporary storage and distribution of particle data
Definition: TempPartStore.h:47
int coordsToIndex(int, int, int)
Definition: TempPartStore.hpp:48
virtual void addConnection(int, int, int)
Definition: TempPartStore.hpp:108
int m_nz
Definition: TempPartStore.h:55
map< int, int > m_slave_id_map
Definition: TempPartStore.h:52
int m_nx
Definition: TempPartStore.h:55
double m_ymin
Definition: TempPartStore.h:54
double m_ysize
Definition: TempPartStore.h:54
const multimap< int, T > & getMap() const
Definition: TempPartStore.h:67