ESyS-Particle  2.3.2
GrainRandomBoxPacker.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_LSMGRAINRANDOMBOXPACKER_H
15 #define ESYS_LSMGRAINRANDOMBOXPACKER_H
16 
19 
20 #include <vector>
21 #include <boost/shared_ptr.hpp>
22 
23 namespace esys
24 {
25  namespace lsm
26  {
30  template <typename TmplParticleGrainGen, typename TmplGrainCollection, template <typename TPartGrainGen> class TmplRndBoxPackerWrap>
31  class GrainRandomBoxPacker : public TmplRndBoxPackerWrap<TmplParticleGrainGen>::RandomBoxPackerBase
32  {
33  public:
34  typedef TmplGrainCollection GrainCollection;
35  typedef boost::shared_ptr<GrainCollection> GrainCollectionPtr;
38  typedef typename GrainCollection::Grain Grain;
39  typedef typename Grain::Id GrainId;
42  typedef
43  typename TmplRndBoxPackerWrap<TmplParticleGrainGen>::RandomBoxPackerBase
46  typedef typename Inherited::ParticleGenerator ParticleGrainGen;
47  typedef typename Inherited::ParticleGeneratorPtr ParticleGrainGenPtr;
48  typedef typename Inherited::Particle Particle;
49  typedef typename Inherited::NTable NTable;
50  typedef typename Inherited::NTablePtr NTablePtr;
52  typedef typename Inherited::ParticlePool ParticlePool;
53  typedef typename Inherited::ParticlePoolPtr ParticlePoolPtr;
55  typedef typename Inherited::StuffedParticleIterator StuffedParticleIterator;
56 
58  ParticleGrainGenPtr particleGrainGenPtr,
59  ParticlePoolPtr particlePoolPtr,
60  NTablePtr nTablePtr,
61  const BoundingBox &bBox,
62  const BoolVector &periodicDimensions,
63  double tolerance,
64  double cubicPackRadius,
65  int maxInsertionFailures
66  );
67 
69  ParticleGrainGenPtr particleGrainGenPtr,
70  ParticlePoolPtr particlePoolPtr,
71  NTablePtr nTablePtr,
72  const BoundingBox &bBox,
73  const BoolVector &periodicDimensions,
74  double tolerance,
75  double cubicPackRadius,
76  int maxInsertionFailures,
77  const PlaneVector &fitPlaneVector,
78  GrainPoolPtr grainPoolPtr
79  );
80 
81  virtual ~GrainRandomBoxPacker();
82 
84 
86 
87  void setParticleGrainGen(ParticleGrainGen &particleGrainGen);
88 
89  void setParticleGrainGen(ParticleGrainGenPtr particleGrainGenPtr);
90 
91  GrainId getNextGrainId() const;
92 
94 
95  Grain &createAndInsertGrain(const Grain &grain);
96 
98 
100 
101  int getNumGrains() const;
102 
104 
106 
107  const GrainCollection &getGrainCollection() const;
108 
110 
111  virtual void generate();
112 
113  private:
115  };
116  }
117 }
118 
120 
121 #endif