ESyS-Particle  2.3.2
BlockGenerator.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_LSMBLOCKGENERATOR_H
15 #define ESYS_LSMBLOCKGENERATOR_H
16 
19 #include <Foundation/BoundingBox.h>
20 
21 #include <vector>
22 #include <set>
23 
24 namespace esys
25 {
26  namespace lsm
27  {
28  typedef std::vector<bool> BoolVector;
33  {
34  public:
36  NTable &nTable,
37  ParticlePool &particlePool,
38  const BoundingBox &bBox,
39  const BoolVector &periodicDimensions,
40  double tolerance
41  );
42 
43  virtual ~BlockGenerator();
44 
45  virtual void generate() = 0;
46 
47  virtual void generateSeedParticles();
48 
49  virtual SimpleParticle generateParticle(const Vec3 &point);
50 
51  virtual double getRadius() const = 0;
52 
53  virtual double getGridRadius() const = 0;
54 
55  size_t getNumParticles() const;
56 
57  int getNextId();
58 
59  virtual bool particleFits(const SimpleParticle &particle) const;
60 
61  bool is2d() const;
62 
63  bool particleFitsInBBox(const SimpleParticle &particle) const;
64 
65  bool particleFitsWithNeighbours(const SimpleParticle &particle) const;
66 
67  void insertParticle(const SimpleParticle &particle);
68 
69  double getTolerance() const;
70 
71  const BoundingBox &getBBox() const;
72 
73  bool contains(const SimpleParticle &particle) const;
74 
77 
79  {
81  }
82 
83  typedef std::set<int> IdSet;
84  private:
88  double m_tolerance;
90  };
91  }
92 }
93 
94 #endif