ESyS-Particle  2.3.2
RandomBlockGenerator.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_LSMRANDOMBLOCKGENERATOR_H
15 #define ESYS_LSMRANDOMBLOCKGENERATOR_H
16 
18 #include <Geometry/Plane3D.h>
19 
20 #include <vector>
21 #include <boost/shared_ptr.hpp>
22 
23 namespace esys
24 {
25  namespace lsm
26  {
27  class ParticleFitter;
28 
29  typedef std::vector<Plane3D> PlaneVector;
30  typedef boost::shared_ptr<ParticleFitter> FitterPtr;
31  typedef std::vector<FitterPtr> FitterPtrVector;
32 
37  {
38  public:
40  NTable &nTable,
41  ParticlePool &particlePool,
42  const BoundingBox &bBox,
43  const BoolVector &periodicDimensions,
44  double tolerance,
45  double minSphereRadius,
46  double maxSphereRadius,
47  const PlaneVector &fitPlaneVector,
48  int maxInsertionFailures
49  );
50 
51  virtual ~RandomBlockGenerator();
52 
53  virtual bool particleFits(const SimpleParticle &particle) const;
54 
55  virtual void generate();
56 
57  double getRandom(double min, double max) const;
58 
59  virtual double getRadius() const;
60 
61  virtual double getGridRadius() const;
62 
63  Vec3 getRandomPoint() const;
64 
65  ParticleVector getClosestNeighbors(const SimpleParticle& particle, int numClosest);
66 
67  int getMaxInsertionFailures() const;
68 
70 
71  void generateFillParticles();
72 
73  const PlaneVector &getFitPlaneVector() const;
74 
75  Plane3D getClosestFitPlane(const SimpleParticle &particle) const;
76 
77  private:
78  double m_minRadius;
79  double m_maxRadius;
82  };
83  }
84 }
85 
86 #endif