ESyS-Particle  2.3.2
CubicBoxPacker.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_LSMCUBICBOXPACKER_H
15 #define ESYS_LSMCUBICBOXPACKER_H
16 
17 #include <Geometry/BoxPacker.h>
18 
19 namespace esys
20 {
21  namespace lsm
22  {
23  typedef std::vector<bool> BoolVector;
27  template <typename TmplParticleGenerator, typename TmplBoxPackerBase>
28  class CubicBoxPacker : public TmplBoxPackerBase
29  {
30  public:
31  typedef TmplParticleGenerator ParticleGenerator;
32  typedef boost::shared_ptr<ParticleGenerator> ParticleGeneratorPtr;
33  typedef TmplBoxPackerBase Inherited;
35  typedef typename Inherited::Particle Particle;
36  typedef typename Inherited::NTable NTable;
37  typedef typename Inherited::NTablePtr NTablePtr;
38  typedef typename Inherited::ParticlePool ParticlePool;
39  typedef typename Inherited::ParticlePoolPtr ParticlePoolPtr;
40 
42  ParticleGeneratorPtr particleGeneratorPtr,
43  ParticlePoolPtr particlePoolPtr,
44  NTablePtr nTablePtr,
45  const BoundingBox &bBox,
46  const BoolVector &periodicDimensions,
47  double tolerance,
48  double cubicPackRadius
49  );
50 
51  virtual ~CubicBoxPacker();
52 
53  Particle getCandidateParticle(const Vec3 &point);
54 
55  Particle getCandidateParticle(const Vec3 &point, double radius);
56 
57  double getCubicPackingRadius() const;
58 
60 
62 
63  void setParticleGenerator(ParticleGenerator &particleGenerator);
64 
65  void setParticleGenerator(ParticleGeneratorPtr particleGenerator);
66 
67  void generateCubicPacking();
68 
69  virtual void generate();
70 
71  private:
75  };
76  }
77 }
78 
80 
81 #endif