1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
|
/////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003-2017 by The University of Queensland //
// Centre for Geoscience Computing //
// http://earth.uq.edu.au/centre-geoscience-computing //
// //
// Primary Business: Brisbane, Queensland, Australia //
// Licensed under the Open Software License version 3.0 //
// http://www.apache.org/licenses/LICENSE-2.0 //
// //
/////////////////////////////////////////////////////////////
#ifndef ESYS_LSMPACKERPY_H
#define ESYS_LSMPACKERPY_H
#include "Geometry/Packer.h"
#include "Geometry/BoxPacker.h"
#include "Geometry/CubicBoxPacker.h"
#include "Geometry/RandomBoxPacker.h"
#include "Geometry/RandomSpherePacker.h"
#include "Geometry/GrainRandomBoxPacker.h"
#include "Geometry/PackerGenerators.h"
#include "Python/esys/lsm/util/BoundingBoxPy.h"
#include "Python/esys/lsm/util/BoundingSpherePy.h"
#include "Python/esys/lsm/util/Vec3Py.h"
#include "Python/esys/lsm/geometry/IteratorPy.h"
#include "Python/esys/lsm/geometry/SimpleSphereCollectionPy.h"
#include "Python/esys/lsm/geometry/GrainPy.h"
#include "Python/esys/lsm/geometry/GrainCollectionPy.h"
namespace boost
{
namespace python
{
class list;
class tuple;
}
}
namespace esys
{
namespace lsm
{
class PackerPy
: public Packer<SimpleSphereCollectionPy>,
public boost::python::wrapper<Packer<SimpleSphereCollectionPy> >
{
public:
typedef Packer<SimpleSphereCollectionPy> Inherited;
typedef
SimpleSphereCollectionPy::SimpleSphereIteratorPy
SimpleSphereIteratorPy;
PackerPy(NTablePtr nTablePtr);
PackerPy(ParticlePoolPtr particlePoolPtr, NTablePtr nTablePtr);
SimpleSphereIteratorPy getSimpleSphereIteratorPy();
SimpleSphereCollectionPy getSimpleSphereCollectionPy();
virtual void generate();
};
typedef BoxPacker<PackerPy> BoxPackerBasePy;
class BoxPackerPy : public BoxPackerBasePy
{
public:
typedef BoxPackerBasePy Inherited;
BoxPackerPy(
ParticlePoolPtr particlePoolPtr,
NTablePtr nTablePtr,
const BoundingBox &bBox,
const BoolVector &periodicDimensions,
double tolerance
);
};
typedef ConstRadiusGen<SimpleSpherePy> ConstRadiusGenPy;
typedef CubicBoxPacker<ConstRadiusGenPy, BoxPackerPy> CubicBoxPackerBasePy;
class CubicBoxPackerPy : public CubicBoxPackerBasePy
{
public:
typedef CubicBoxPackerBasePy Inherited;
CubicBoxPackerPy(
double radius,
const BoundingBoxPy &bBox,
const boost::python::list &periodicDimensions,
double tolerance
);
};
typedef RndRadiusGen<SimpleSpherePy> RndRadiusGenPy;
template <typename TPartGen>
class PackerWrap
{
public:
typedef CubicBoxPacker<TPartGen, BoxPackerPy> CubicBoxPackerBase;
typedef RandomBoxPacker<TPartGen, ::esys::lsm::PackerWrap> RandomBoxPackerBase;
};
typedef PackerWrap<RndRadiusGenPy>::CubicBoxPackerBase RndCubicBoxPackerBasePy;
typedef PackerWrap<RndRadiusGenPy>::RandomBoxPackerBase RandomBoxPackerBasePy;
class RandomBoxPackerPy : public RandomBoxPackerBasePy
{
public:
typedef RandomBoxPackerBasePy Inherited;
RandomBoxPackerPy(
double minRadius,
double maxRadius,
double cubicPackRadius,
int maxInsertionFailures,
const BoundingBoxPy &bBox,
const boost::python::list &periodicDimensions,
double tolerance
);
RandomBoxPackerPy(
ParticleGeneratorPtr particleGeneratorPtr,
ParticlePoolPtr particlePoolPtr,
NTablePtr nTablePtr,
const BoundingBox &bBox,
const BoolVector &periodicDimensions,
double tolerance,
double cubicPackRadius,
int maxInsertionFailures,
const PlaneVector &fitPlaneVector
);
};
typedef RandomSpherePacker<RndRadiusGenPy, PackerWrap> RandomSpherePackerBasePy;
class RandomSpherePackerPy : public RandomSpherePackerBasePy
{
public:
typedef RandomSpherePackerBasePy Inherited;
RandomSpherePackerPy(
double minRadius,
double maxRadius,
double cubicPackRadius,
int maxInsertionFailures,
const BoundingSpherePy &bSphere,
double tolerance,
bool do2d
);
};
typedef GrainRndRadiusGen<GrainPy> RndGrainGenBasePy;
class RndGrainGenPy :
public RndGrainGenBasePy,
public boost::python::wrapper<RndGrainGenBasePy>
{
public:
typedef RndGrainGenBasePy Inherited;
RndGrainGenPy(
double minGrainRadius,
double maxGrainRadius,
double minParticleRadius,
double maxParticleRadius
);
const double &getMinParticleRadius() const;
const double &getMaxParticleRadius() const;
virtual Grain getGrain(const Particle &p);
private:
double m_minParticleRadius;
double m_maxParticleRadius;
};
typedef PackerWrap<RndGrainGenPy>::CubicBoxPackerBase GrainCubicBoxPackerPy;
typedef PackerWrap<RndGrainGenPy>::RandomBoxPackerBase GrainRndBoxPackerPy;
typedef
GrainRandomBoxPacker<RndGrainGenPy,GrainCollectionPy,PackerWrap>
GrainRandomBoxPackerBasePy;
class GrainRandomBoxPackerPy : public GrainRandomBoxPackerBasePy
{
public:
typedef GrainRandomBoxPackerBasePy Inherited;
typedef Inherited::Grain Grain;
typedef
Inherited::GrainCollection::GrainIteratorPy
GrainIteratorPy;
GrainRandomBoxPackerPy(
ParticleGrainGen &particleGrainGen,
double cubicPackRadius,
int maxInsertionFailures,
const BoundingBox &bBox,
const boost::python::list &circDimList,
double tolerance
);
GrainRandomBoxPackerPy(
ParticleGrainGenPtr particleGrainGenPtr,
ParticlePoolPtr particlePoolPtr,
NTablePtr nTablePtr,
const BoundingBox &bBox,
const BoolVector &periodicDimensions,
double tolerance,
double cubicPackRadius,
int maxInsertionFailures,
const PlaneVector &fitPlaneVector,
GrainPoolPtr grainPoolPtr
);
GrainIteratorPy getGrainIteratorPy();
const GrainCollection &getGrainCollectionPy() const;
};
void exportPacker();
}
}
#endif
|