ESyS-Particle  2.3.4
CircularNeighbourTable.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 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.apache.org/licenses/LICENSE-2.0 //
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
esys::lsm::NeighbourTable::Particle
TmplParticle Particle
Definition: NeighbourTable.h:35
esys::lsm::NeighbourTable
Definition: NeighbourTable.h:33
esys::lsm::CircularNeighbourTable::ParticleVector
Inherited::ParticleVector ParticleVector
Definition: CircularNeighbourTable.h:38
esys::lsm::CircularNeighbourTable::getNumClonedParticles
size_t getNumClonedParticles() const
Definition: CircularNeighbourTable.hpp:259
esys::lsm::CircularNeighbourTable::havePeriodicDimensions
bool havePeriodicDimensions() const
Definition: CircularNeighbourTable.hpp:178
esys::lsm::CircularNeighbourTable::m_periodicDimIndex
int m_periodicDimIndex
Definition: CircularNeighbourTable.h:111
esys::lsm::CircularNeighbourTable::resize
void resize(const BoundingBox &bBox, double gridSpacing, double circBorderWidth)
Definition: CircularNeighbourTable.hpp:128
esys::lsm::CircularNeighbourTable::isClone
bool isClone(Particle *p) const
Definition: CircularNeighbourTable.hpp:278
CircularNeighbourTable.hpp
esys::lsm::BoundingBox
3D bounding box
Definition: BoundingBox.h:28
esys
Definition: CheckPointable.cpp:17
esys::lsm::NeighbourTable::ParticleVector
std::vector< Particle * > ParticleVector
Definition: NeighbourTable.h:36
esys::lsm::CircularNeighbourTable::Inherited
NeighbourTable< TmplParticle > Inherited
Definition: CircularNeighbourTable.h:36
CircularNeighbourTable.h
esys::lsm::CircularNeighbourTable::Particle
Inherited::Particle Particle
Definition: CircularNeighbourTable.h:37
esys::lsm::CircularNeighbourTable::m_circGridWidth
int m_circGridWidth
Definition: CircularNeighbourTable.h:110
esys::lsm::CircularNeighbourTable::getNonClonedParticles
ParticleVector getNonClonedParticles()
Definition: CircularNeighbourTable.hpp:287
esys::lsm::CircularNeighbourTable::ParticleSet
std::set< typename ParticleVector::value_type > ParticleSet
Definition: CircularNeighbourTable.h:39
esys::lsm::CircularNeighbourTable::insert
void insert(Particle *pParticle)
Definition: CircularNeighbourTable.hpp:224
esys::lsm::CircularNeighbourTable::getNumParticles
size_t getNumParticles() const
Definition: CircularNeighbourTable.hpp:265
Vec3
Definition: vec3.h:47
esys::lsm::CircularNeighbourTable::ParticlePool
boost::object_pool< Particle > ParticlePool
Definition: CircularNeighbourTable.h:40
NeighbourTable.h
esys::lsm::CircularNeighbourTable::m_particlePoolPtr
ParticlePoolPtr m_particlePoolPtr
Definition: CircularNeighbourTable.h:108
esys::lsm::CircularNeighbourTable::BoolVector
std::vector< bool > BoolVector
Definition: CircularNeighbourTable.h:42
esys::lsm::CircularNeighbourTable::getModdedPosn
Vec3 getModdedPosn(const Vec3 &posn) const
Definition: CircularNeighbourTable.hpp:184
esys::lsm::CircularNeighbourTable::setCircularBorderWidth
void setCircularBorderWidth(double circBorderWidth, double gridSpacing)
Definition: CircularNeighbourTable.hpp:111
esys::lsm::CircularNeighbourTable::m_periodicDimensions
BoolVector m_periodicDimensions
Definition: CircularNeighbourTable.h:107
esys::lsm::CircularNeighbourTable::insertClone
void insertClone(Particle *pParticle, const Vec3 &newPosition)
Definition: CircularNeighbourTable.hpp:166
esys::lsm::CircularNeighbourTable::CircularNeighbourTable
CircularNeighbourTable(const BoundingBox &bBox, double gridSpacing, const BoolVector &periodicDimensions=BoolVector(3, false), double circBorderWidth=0.0)
Definition: CircularNeighbourTable.hpp:33
esys::lsm::CircularNeighbourTable::checkPeriodicDimensions
void checkPeriodicDimensions()
Definition: CircularNeighbourTable.hpp:76
esys::lsm::CircularNeighbourTable::m_clonedParticleSet
ParticleSet m_clonedParticleSet
Definition: CircularNeighbourTable.h:109
esys::lsm::CircularNeighbourTable::getPeriodicDimensions
const BoolVector & getPeriodicDimensions() const
Definition: CircularNeighbourTable.hpp:272
esys::lsm::CircularNeighbourTable
Definition: CircularNeighbourTable.h:34
esys::lsm::CircularNeighbourTable::clearClonedParticles
void clearClonedParticles()
Definition: CircularNeighbourTable.hpp:307
esys::lsm::CircularNeighbourTable::ParticlePoolPtr
boost::shared_ptr< ParticlePool > ParticlePoolPtr
Definition: CircularNeighbourTable.h:41
esys::lsm::CircularNeighbourTable::~CircularNeighbourTable
virtual ~CircularNeighbourTable()
Definition: CircularNeighbourTable.hpp:106