ESyS-Particle  2.3.4
PackerPy.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 #ifndef ESYS_LSMPACKERPY_H
14 #define ESYS_LSMPACKERPY_H
15 
16 #include "Geometry/Packer.h"
17 #include "Geometry/BoxPacker.h"
30 
31 namespace boost
32 {
33  namespace python
34  {
35  class list;
36  class tuple;
37  }
38 }
39 
40 namespace esys
41 {
42  namespace lsm
43  {
44  class PackerPy
45  : public Packer<SimpleSphereCollectionPy>,
46  public boost::python::wrapper<Packer<SimpleSphereCollectionPy> >
47  {
48  public:
50  typedef
53 
54  PackerPy(NTablePtr nTablePtr);
55 
56  PackerPy(ParticlePoolPtr particlePoolPtr, NTablePtr nTablePtr);
57 
59 
61 
62  virtual void generate();
63  };
64 
66 
68  {
69  public:
71 
73  ParticlePoolPtr particlePoolPtr,
74  NTablePtr nTablePtr,
75  const BoundingBox &bBox,
76  const BoolVector &periodicDimensions,
77  double tolerance
78  );
79  };
80 
84  {
85  public:
88  double radius,
89  const BoundingBoxPy &bBox,
90  const boost::python::list &periodicDimensions,
91  double tolerance
92  );
93  };
94 
96  template <typename TPartGen>
97  class PackerWrap
98  {
99  public:
102  };
103 
107  {
108  public:
110 
112  double minRadius,
113  double maxRadius,
114  double cubicPackRadius,
115  int maxInsertionFailures,
116  const BoundingBoxPy &bBox,
117  const boost::python::list &periodicDimensions,
118  double tolerance
119  );
120 
122  ParticleGeneratorPtr particleGeneratorPtr,
123  ParticlePoolPtr particlePoolPtr,
124  NTablePtr nTablePtr,
125  const BoundingBox &bBox,
126  const BoolVector &periodicDimensions,
127  double tolerance,
128  double cubicPackRadius,
129  int maxInsertionFailures,
130  const PlaneVector &fitPlaneVector
131  );
132  };
133 
136  {
137  public:
139 
141  double minRadius,
142  double maxRadius,
143  double cubicPackRadius,
144  int maxInsertionFailures,
145  const BoundingSpherePy &bSphere,
146  double tolerance,
147  bool do2d
148  );
149  };
150 
153  public RndGrainGenBasePy,
154  public boost::python::wrapper<RndGrainGenBasePy>
155  {
156  public:
158 
160  double minGrainRadius,
161  double maxGrainRadius,
162  double minParticleRadius,
163  double maxParticleRadius
164  );
165 
166  const double &getMinParticleRadius() const;
167 
168  const double &getMaxParticleRadius() const;
169 
170  virtual Grain getGrain(const Particle &p);
171 
172  private:
175  };
176 
179  typedef
183  {
184  public:
187  typedef
188  Inherited::GrainCollection::GrainIteratorPy
190 
192  ParticleGrainGen &particleGrainGen,
193  double cubicPackRadius,
194  int maxInsertionFailures,
195  const BoundingBox &bBox,
196  const boost::python::list &circDimList,
197  double tolerance
198  );
199 
201  ParticleGrainGenPtr particleGrainGenPtr,
202  ParticlePoolPtr particlePoolPtr,
203  NTablePtr nTablePtr,
204  const BoundingBox &bBox,
205  const BoolVector &periodicDimensions,
206  double tolerance,
207  double cubicPackRadius,
208  int maxInsertionFailures,
209  const PlaneVector &fitPlaneVector,
210  GrainPoolPtr grainPoolPtr
211  );
212 
213 
215 
216  const GrainCollection &getGrainCollectionPy() const;
217  };
218 
219  void exportPacker();
220  }
221 }
222 
223 #endif
esys::lsm::BoxPackerPy
Definition: PackerPy.h:68
esys::lsm::SimpleSphereCollectionPy
Definition: SimpleSphereCollectionPy.h:28
esys::lsm::GrainRandomBoxPackerPy::Inherited
GrainRandomBoxPackerBasePy Inherited
Definition: PackerPy.h:185
esys::lsm::CubicBoxPacker::NTable
Inherited::NTable NTable
Definition: CubicBoxPacker.h:36
esys::lsm::GrainRandomBoxPacker::getGrainIterator
GrainConstIterator getGrainIterator() const
Definition: GrainRandomBoxPacker.hpp:107
esys::lsm::RandomBoxPacker::Inherited
TmplCubicBoxPackerWrap< TmplParticleGenerator >::CubicBoxPackerBase Inherited
Definition: RandomBoxPacker.h:116
esys::lsm::CubicBoxPackerBasePy
CubicBoxPacker< ConstRadiusGenPy, BoxPackerPy > CubicBoxPackerBasePy
Definition: PackerPy.h:82
esys::lsm::GrainRandomBoxPacker::GrainPoolPtr
GrainCollection::GrainPoolPtr GrainPoolPtr
Definition: GrainRandomBoxPacker.h:41
esys::lsm::RandomSpherePacker::generate
virtual void generate()
Definition: RandomSpherePacker.hpp:406
esys::lsm::ConstRadiusGen
Definition: PackerGenerators.h:28
esys::lsm::RandomBoxPackerPy
Definition: PackerPy.h:107
esys::lsm::RandomBoxPacker
Definition: RandomBoxPacker.h:112
esys::lsm::GrainRandomBoxPackerBasePy
GrainRandomBoxPacker< RndGrainGenPy, GrainCollectionPy, PackerWrap > GrainRandomBoxPackerBasePy
Definition: PackerPy.h:181
CubicBoxPacker.h
esys::lsm::GrainRndRadiusGen::getMaxGrainRadius
const double & getMaxGrainRadius() const
Definition: PackerGenerators.hpp:171
esys::lsm::CubicBoxPacker::ParticlePoolPtr
Inherited::ParticlePoolPtr ParticlePoolPtr
Definition: CubicBoxPacker.h:39
esys::lsm::GrainRndRadiusGen::getGrain
virtual Grain getGrain(const Particle &p)=0
esys::lsm::Packer< SimpleSphereCollectionPy >::getParticleIterator
ParticleIterator getParticleIterator()
Definition: Packer.hpp:111
esys::lsm::CubicBoxPacker::generate
virtual void generate()
Definition: CubicBoxPacker.hpp:121
esys::lsm::PackerPy::generate
virtual void generate()
Definition: PackerPy.cpp:46
PackerGenerators.h
esys::lsm::RandomSpherePacker::ParticleGeneratorPtr
Inherited::ParticleGeneratorPtr ParticleGeneratorPtr
Definition: RandomSpherePacker.h:118
Vec3Py.h
esys::lsm::Packer< SimpleSphereCollectionPy >::NTablePtr
boost::shared_ptr< NTable > NTablePtr
Definition: Packer.h:42
esys::lsm::CubicBoxPacker::Inherited
TmplBoxPackerBase Inherited
Definition: CubicBoxPacker.h:33
esys::lsm::BoundingBoxPy
Definition: BoundingBoxPy.h:30
esys::lsm::GrainRndBoxPackerPy
PackerWrap< RndGrainGenPy >::RandomBoxPackerBase GrainRndBoxPackerPy
Definition: PackerPy.h:178
esys::lsm::RandomSpherePacker::Inherited
TmplCubicBoxPackerWrap< TmplParticleGenerator >::CubicBoxPackerBase Inherited
Definition: RandomSpherePacker.h:116
esys::lsm::PackerPy::getSimpleSphereCollectionPy
SimpleSphereCollectionPy getSimpleSphereCollectionPy()
Definition: PackerPy.cpp:41
esys::lsm::RandomSpherePackerBasePy
RandomSpherePacker< RndRadiusGenPy, PackerWrap > RandomSpherePackerBasePy
Definition: PackerPy.h:134
esys::lsm::RndGrainGenPy::RndGrainGenPy
RndGrainGenPy(double minGrainRadius, double maxGrainRadius, double minParticleRadius, double maxParticleRadius)
Definition: PackerPy.cpp:196
BoxPacker.h
esys::lsm::CubicBoxPacker::ParticlePool
Inherited::ParticlePool ParticlePool
Definition: CubicBoxPacker.h:38
console.h
boost
Definition: BondInteractionGroupPy.h:20
esys::lsm::RndGrainGenPy::getGrain
virtual Grain getGrain(const Particle &p)
Definition: PackerPy.cpp:218
esys::lsm::GrainRandomBoxPackerPy::GrainRandomBoxPackerPy
GrainRandomBoxPackerPy(ParticleGrainGen &particleGrainGen, double cubicPackRadius, int maxInsertionFailures, const BoundingBox &bBox, const boost::python::list &circDimList, double tolerance)
Definition: PackerPy.cpp:223
esys::lsm::RandomBoxPacker::ParticlePoolPtr
Inherited::ParticlePoolPtr ParticlePoolPtr
Definition: RandomBoxPacker.h:124
esys::lsm::RandomBoxPackerPy::Inherited
RandomBoxPackerBasePy Inherited
Definition: PackerPy.h:109
esys::lsm::GrainRndRadiusGen::Grain
TmplGrain Grain
Definition: PackerGenerators.h:145
esys::lsm::GrainRandomBoxPacker::Grain
GrainCollection::Grain Grain
Definition: GrainRandomBoxPacker.h:38
esys::lsm::GrainRandomBoxPackerPy::getGrainCollectionPy
const GrainCollection & getGrainCollectionPy() const
Definition: PackerPy.cpp:287
esys::lsm::BoxPackerPy::BoxPackerPy
BoxPackerPy(ParticlePoolPtr particlePoolPtr, NTablePtr nTablePtr, const BoundingBox &bBox, const BoolVector &periodicDimensions, double tolerance)
Definition: PackerPy.cpp:54
esys::lsm::RandomSpherePacker::NTablePtr
Inherited::NTablePtr NTablePtr
Definition: RandomSpherePacker.h:121
esys::lsm::BoundingSpherePy
Definition: BoundingSpherePy.h:30
esys::lsm::RndGrainGenBasePy
GrainRndRadiusGen< GrainPy > RndGrainGenBasePy
Definition: PackerPy.h:151
esys::lsm::RndRadiusGenPy
RndRadiusGen< SimpleSpherePy > RndRadiusGenPy
Definition: PackerPy.h:95
esys::lsm::BoxPacker::ParticlePoolPtr
Inherited::ParticlePoolPtr ParticlePoolPtr
Definition: BoxPacker.h:40
esys::lsm::BoxPacker::NTablePtr
Inherited::NTablePtr NTablePtr
Definition: BoxPacker.h:38
esys::lsm::RandomSpherePackerPy::RandomSpherePackerPy
RandomSpherePackerPy(double minRadius, double maxRadius, double cubicPackRadius, int maxInsertionFailures, const BoundingSpherePy &bSphere, double tolerance, bool do2d)
Definition: PackerPy.cpp:103
esys::lsm::GrainRandomBoxPacker::ParticleGrainGen
Inherited::ParticleGenerator ParticleGrainGen
Definition: GrainRandomBoxPacker.h:46
esys::lsm::PackerWrap::RandomBoxPackerBase
RandomBoxPacker< TPartGen, ::esys::lsm::PackerWrap > RandomBoxPackerBase
Definition: PackerPy.h:101
esys::lsm::PackerPy::Inherited
Packer< SimpleSphereCollectionPy > Inherited
Definition: PackerPy.h:49
esys::lsm::BoxPackerPy::Inherited
BoxPackerBasePy Inherited
Definition: PackerPy.h:70
BoundingBoxPy.h
esys::lsm::Packer< SimpleSphereCollectionPy >::generate
virtual void generate()=0
esys::lsm::GrainRandomBoxPacker::getNumGrains
int getNumGrains() const
Definition: GrainRandomBoxPacker.hpp:114
esys::lsm::BoundingBox
3D bounding box
Definition: BoundingBox.h:28
esys
Definition: CheckPointable.cpp:17
esys::lsm::CubicBoxPacker::ParticleGenerator
TmplParticleGenerator ParticleGenerator
Definition: CubicBoxPacker.h:31
esys::lsm::GrainRandomBoxPackerPy
Definition: PackerPy.h:183
esys::lsm::RandomBoxPacker::NTablePtr
Inherited::NTablePtr NTablePtr
Definition: RandomBoxPacker.h:121
esys::lsm::RandomBoxPacker::PlaneVector
std::vector< Plane3D > PlaneVector
Definition: RandomBoxPacker.h:125
esys::lsm::GrainRandomBoxPacker::Inherited
TmplRndBoxPackerWrap< TmplParticleGrainGen >::RandomBoxPackerBase Inherited
Definition: GrainRandomBoxPacker.h:44
PackerPy.h
IteratorPy.h
esys::lsm::RandomSpherePacker
Definition: RandomSpherePacker.h:112
esys::lsm::GrainRandomBoxPacker::GrainCollection
TmplGrainCollection GrainCollection
Definition: GrainRandomBoxPacker.h:34
SimpleSphereCollectionPy.h
esys::lsm::GrainRandomBoxPacker::PlaneVector
Inherited::PlaneVector PlaneVector
Definition: GrainRandomBoxPacker.h:54
RandomSpherePacker.h
esys::lsm::GrainRndRadiusGen
Definition: PackerGenerators.h:142
esys::lsm::RandomSpherePacker::ParticlePool
Inherited::ParticlePool ParticlePool
Definition: RandomSpherePacker.h:123
esys::lsm::exportPacker
void exportPacker()
Definition: PackerPy.cpp:301
esys::lsm::PackerPy::getSimpleSphereIteratorPy
SimpleSphereIteratorPy getSimpleSphereIteratorPy()
Definition: PackerPy.cpp:36
esys::lsm::Packer< SimpleSphereCollectionPy >::ParticlePoolPtr
boost::shared_ptr< ParticlePool > ParticlePoolPtr
Definition: Packer.h:40
esys::lsm::GrainRndRadiusGen::Particle
Grain::Particle Particle
Definition: PackerGenerators.h:146
esys::lsm::GrainRandomBoxPacker::setParticleGrainGen
void setParticleGrainGen(ParticleGrainGen &particleGrainGen)
Definition: GrainRandomBoxPacker.hpp:135
esys::lsm::RandomBoxPacker::ParticleGeneratorPtr
Inherited::ParticleGeneratorPtr ParticleGeneratorPtr
Definition: RandomBoxPacker.h:118
esys::lsm::PackerPy::PackerPy
PackerPy(NTablePtr nTablePtr)
Definition: PackerPy.cpp:27
esys::lsm::RndRadiusGen
Definition: PackerGenerators.h:118
esys::lsm::RandomBoxPackerBasePy
PackerWrap< RndRadiusGenPy >::RandomBoxPackerBase RandomBoxPackerBasePy
Definition: PackerPy.h:105
esys::lsm::RndGrainGenPy
Definition: PackerPy.h:155
esys::lsm::CubicBoxPackerPy::CubicBoxPackerPy
CubicBoxPackerPy(double radius, const BoundingBoxPy &bBox, const boost::python::list &periodicDimensions, double tolerance)
Definition: PackerPy.cpp:73
esys::lsm::GrainRandomBoxPacker::getGrainCollection
const GrainCollection & getGrainCollection() const
Definition: GrainRandomBoxPacker.hpp:86
esys::lsm::RndGrainGenPy::m_maxParticleRadius
double m_maxParticleRadius
Definition: PackerPy.h:174
esys::lsm::RandomSpherePackerPy
Definition: PackerPy.h:136
esys::lsm::GrainRandomBoxPacker::ParticleGrainGenPtr
Inherited::ParticleGeneratorPtr ParticleGrainGenPtr
Definition: GrainRandomBoxPacker.h:47
esys::lsm::PackerWrap::CubicBoxPackerBase
CubicBoxPacker< TPartGen, BoxPackerPy > CubicBoxPackerBase
Definition: PackerPy.h:100
esys::lsm::RandomBoxPacker::generate
virtual void generate()
Definition: RandomBoxPacker.hpp:494
esys::lsm::GrainRandomBoxPacker
Definition: GrainRandomBoxPacker.h:32
esys::lsm::BoolVector
std::vector< bool > BoolVector
Definition: BlockGenerator.h:28
esys::lsm::CubicBoxPacker::ParticleGeneratorPtr
boost::shared_ptr< ParticleGenerator > ParticleGeneratorPtr
Definition: CubicBoxPacker.h:32
esys::lsm::BoxPacker::Inherited
TmplPackerBase Inherited
Definition: BoxPacker.h:35
esys::lsm::GrainRandomBoxPacker::NTable
Inherited::NTable NTable
Definition: GrainRandomBoxPacker.h:49
BoundingSpherePy.h
Packer.h
esys::lsm::GrainRandomBoxPacker::generate
virtual void generate()
Definition: GrainRandomBoxPacker.hpp:211
esys::lsm::RandomBoxPackerPy::RandomBoxPackerPy
RandomBoxPackerPy(double minRadius, double maxRadius, double cubicPackRadius, int maxInsertionFailures, const BoundingBoxPy &bBox, const boost::python::list &periodicDimensions, double tolerance)
Definition: PackerPy.cpp:137
ListConverter.h
RandomBoxPacker.h
esys::lsm::CubicBoxPacker
Definition: CubicBoxPacker.h:29
esys::lsm::GrainRandomBoxPacker::ParticlePoolPtr
Inherited::ParticlePoolPtr ParticlePoolPtr
Definition: GrainRandomBoxPacker.h:53
esys::lsm::ConstRadiusGenPy
ConstRadiusGen< SimpleSpherePy > ConstRadiusGenPy
Definition: PackerPy.h:81
esys::lsm::Packer< SimpleSphereCollectionPy >
esys::lsm::CubicBoxPacker::NTablePtr
Inherited::NTablePtr NTablePtr
Definition: CubicBoxPacker.h:37
esys::lsm::Packer< SimpleSphereCollectionPy >::getParticleCollection
ParticleCollection & getParticleCollection()
Definition: Packer.hpp:90
esys::lsm::RndGrainGenPy::Inherited
RndGrainGenBasePy Inherited
Definition: PackerPy.h:157
esys::lsm::PackerPy
Definition: PackerPy.h:47
esys::lsm::RandomBoxPacker::ParticleGenerator
Inherited::ParticleGenerator ParticleGenerator
Definition: RandomBoxPacker.h:117
esys::lsm::CubicBoxPackerPy
Definition: PackerPy.h:84
esys::lsm::BoxPacker
Definition: BoxPacker.h:33
esys::lsm::GrainCubicBoxPackerPy
PackerWrap< RndGrainGenPy >::CubicBoxPackerBase GrainCubicBoxPackerPy
Definition: PackerPy.h:177
esys::lsm::RandomBoxPacker::ParticlePool
Inherited::ParticlePool ParticlePool
Definition: RandomBoxPacker.h:123
esys::lsm::RandomSpherePacker::NTable
Inherited::NTable NTable
Definition: RandomSpherePacker.h:120
esys::lsm::bpu::listToVector
std::vector< TmplValue > listToVector(const boost::python::list &pythonList)
Definition: ListConverter.h:42
esys::lsm::Packer< SimpleSphereCollectionPy >::getNumParticles
int getNumParticles() const
Definition: Packer.hpp:125
esys::lsm::RandomSpherePackerPy::Inherited
RandomSpherePackerBasePy Inherited
Definition: PackerPy.h:138
esys::lsm::BoxPackerBasePy
BoxPacker< PackerPy > BoxPackerBasePy
Definition: PackerPy.h:65
esys::lsm::GrainRandomBoxPacker::NTablePtr
Inherited::NTablePtr NTablePtr
Definition: GrainRandomBoxPacker.h:50
esys::lsm::GrainRandomBoxPackerPy::GrainIteratorPy
Inherited::GrainCollection::GrainIteratorPy GrainIteratorPy
Definition: PackerPy.h:189
esys::lsm::RndGrainGenPy::m_minParticleRadius
double m_minParticleRadius
Definition: PackerPy.h:173
esys::lsm::PackerPy::SimpleSphereIteratorPy
SimpleSphereCollectionPy::SimpleSphereIteratorPy SimpleSphereIteratorPy
Definition: PackerPy.h:52
esys::lsm::PackerWrap
Definition: PackerPy.h:98
esys::lsm::bpu::vectorToList
boost::python::list vectorToList(const TmplVector &vec)
Definition: ListConverter.h:83
esys::lsm::GrainRndRadiusGen::getMinGrainRadius
const double & getMinGrainRadius() const
Definition: PackerGenerators.hpp:165
GrainPy.h
esys::lsm::RandomBoxPacker::NTable
Inherited::NTable NTable
Definition: RandomBoxPacker.h:120
esys::lsm::IteratorPy
Definition: IteratorPy.h:29
getBBox
BoundingBox getBBox(const std::string &arg)
Definition: Main.cpp:24
esys::lsm::GrainRandomBoxPacker::ParticlePool
Inherited::ParticlePool ParticlePool
Definition: GrainRandomBoxPacker.h:52
esys::lsm::RndGrainGenPy::getMinParticleRadius
const double & getMinParticleRadius() const
Definition: PackerPy.cpp:207
esys::lsm::RndGrainGenPy::getMaxParticleRadius
const double & getMaxParticleRadius() const
Definition: PackerPy.cpp:212
GrainRandomBoxPacker.h
esys::lsm::RandomSpherePacker::ParticleGenerator
Inherited::ParticleGenerator ParticleGenerator
Definition: RandomSpherePacker.h:117
GrainCollectionPy.h
esys::lsm::GrainRandomBoxPackerPy::getGrainIteratorPy
GrainIteratorPy getGrainIteratorPy()
Definition: PackerPy.cpp:281
esys::lsm::GrainRandomBoxPackerPy::Grain
Inherited::Grain Grain
Definition: PackerPy.h:186
esys::lsm::RandomSpherePacker::ParticlePoolPtr
Inherited::ParticlePoolPtr ParticlePoolPtr
Definition: RandomSpherePacker.h:124
esys::lsm::RndCubicBoxPackerBasePy
PackerWrap< RndRadiusGenPy >::CubicBoxPackerBase RndCubicBoxPackerBasePy
Definition: PackerPy.h:104
esys::lsm::CubicBoxPackerPy::Inherited
CubicBoxPackerBasePy Inherited
Definition: PackerPy.h:86