ESyS-Particle  2.3.2
CircularNeighbourTable.h
Go to the documentation of this file.
1 
2 // //
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 
14 #ifndef ESYS_LSMCIRCULARNEIGHBOURTABLE_H
15 #define ESYS_LSMCIRCULARNEIGHBOURTABLE_H
16 
18 #include <boost/pool/object_pool.hpp>
19 #include <boost/shared_ptr.hpp>
20 
21 #include <sstream>
22 #include <stdexcept>
23 #include <set>
24 
25 namespace esys
26 {
27  namespace lsm
28  {
32  template <class TmplParticle>
33  class CircularNeighbourTable : public NeighbourTable<TmplParticle>
34  {
35  public:
37  typedef typename Inherited::Particle Particle;
39  typedef std::set<typename ParticleVector::value_type> ParticleSet;
40  typedef boost::object_pool<Particle> ParticlePool;
41  typedef boost::shared_ptr<ParticlePool> ParticlePoolPtr;
42  typedef std::vector<bool> BoolVector;
43 
44  public:
46  const BoundingBox &bBox,
47  double gridSpacing,
48  const BoolVector &periodicDimensions = BoolVector(3, false),
49  double circBorderWidth = 0.0
50  );
51 
53  const BoundingBox &bBox,
54  double gridSpacing,
55  ParticlePoolPtr particlePoolPtr,
56  const BoolVector &periodicDimensions = BoolVector(3, false),
57  double circBorderWidth = 0.0
58  );
59 
60  public:
62 
63  virtual ~CircularNeighbourTable();
64 
66  double circBorderWidth,
67  double gridSpacing
68  );
69 
70  void setCircularBorderWidth(double circBorderWidth);
71 
72  void resize(
73  const BoundingBox &bBox,
74  double gridSpacing,
75  double circBorderWidth
76  );
77 
78  void resize(
79  const BoundingBox &bBox,
80  double gridSpacing
81  );
82 
83  void insertClone(Particle *pParticle, const Vec3 &newPosition);
84 
85  bool havePeriodicDimensions() const;
86 
87  Vec3 getModdedPosn(const Vec3 &posn) const;
88 
89  void insert(Particle *pParticle);
90 
91  void insert(Particle &particle);
92 
93  size_t getNumClonedParticles() const;
94 
95  size_t getNumParticles() const;
96 
97  const BoolVector &getPeriodicDimensions() const;
98 
99  protected:
100  bool isClone(Particle *p) const;
101 
103 
104  void clearClonedParticles();
105 
106  private:
112  };
113  }
114 }
115 
117 
118 #endif