ESyS-Particle
2.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PackerPy.h
Go to the documentation of this file.
1
2
// //
3
// Copyright (c) 2003-2013 by The University of Queensland //
4
// Earth Systems Science Computational Centre (ESSCC) //
5
// http://www.uq.edu.au/esscc //
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
#ifndef ESYS_LSMPACKERPY_H
14
#define ESYS_LSMPACKERPY_H
15
16
#include "
Geometry/Packer.h
"
17
#include "
Geometry/BoxPacker.h
"
18
#include "
Geometry/CubicBoxPacker.h
"
19
#include "
Geometry/RandomBoxPacker.h
"
20
#include "
Geometry/RandomSpherePacker.h
"
21
#include "
Geometry/GrainRandomBoxPacker.h
"
22
#include "
Geometry/PackerGenerators.h
"
23
#include "
Python/esys/lsm/util/BoundingBoxPy.h
"
24
#include "
Python/esys/lsm/util/BoundingSpherePy.h
"
25
#include "
Python/esys/lsm/util/Vec3Py.h
"
26
#include "
Python/esys/lsm/geometry/IteratorPy.h
"
27
#include "
Python/esys/lsm/geometry/SimpleSphereCollectionPy.h
"
28
#include "
Python/esys/lsm/geometry/GrainPy.h
"
29
#include "
Python/esys/lsm/geometry/GrainCollectionPy.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
:
49
typedef
Packer<SimpleSphereCollectionPy>
Inherited
;
50
typedef
51
SimpleSphereCollectionPy::SimpleSphereIteratorPy
52
SimpleSphereIteratorPy
;
53
54
PackerPy
(
NTablePtr
nTablePtr);
55
56
PackerPy
(
ParticlePoolPtr
particlePoolPtr,
NTablePtr
nTablePtr);
57
58
SimpleSphereIteratorPy
getSimpleSphereIteratorPy
();
59
60
SimpleSphereCollectionPy
getSimpleSphereCollectionPy
();
61
62
virtual
void
generate
();
63
};
64
65
typedef
BoxPacker<PackerPy>
BoxPackerBasePy
;
66
67
class
BoxPackerPy
:
public
BoxPackerBasePy
68
{
69
public
:
70
typedef
BoxPackerBasePy
Inherited
;
71
72
BoxPackerPy
(
73
ParticlePoolPtr
particlePoolPtr,
74
NTablePtr
nTablePtr,
75
const
BoundingBox
&bBox,
76
const
BoolVector
&periodicDimensions,
77
double
tolerance
78
);
79
};
80
81
typedef
ConstRadiusGen<SimpleSpherePy>
ConstRadiusGenPy
;
82
typedef
CubicBoxPacker<ConstRadiusGenPy, BoxPackerPy>
CubicBoxPackerBasePy
;
83
class
CubicBoxPackerPy
:
public
CubicBoxPackerBasePy
84
{
85
public
:
86
typedef
CubicBoxPackerBasePy
Inherited
;
87
CubicBoxPackerPy
(
88
double
radius,
89
const
BoundingBoxPy
&bBox,
90
const
boost::python::list &periodicDimensions,
91
double
tolerance
92
);
93
};
94
95
typedef
RndRadiusGen<SimpleSpherePy>
RndRadiusGenPy
;
96
template
<
typename
TPartGen>
97
class
PackerWrap
98
{
99
public
:
100
typedef
CubicBoxPacker<TPartGen, BoxPackerPy>
CubicBoxPackerBase
;
101
typedef
RandomBoxPacker<TPartGen, ::esys::lsm::PackerWrap>
RandomBoxPackerBase
;
102
};
103
104
typedef
PackerWrap<RndRadiusGenPy>::CubicBoxPackerBase
RndCubicBoxPackerBasePy
;
105
typedef
PackerWrap<RndRadiusGenPy>::RandomBoxPackerBase
RandomBoxPackerBasePy
;
106
class
RandomBoxPackerPy
:
public
RandomBoxPackerBasePy
107
{
108
public
:
109
typedef
RandomBoxPackerBasePy
Inherited
;
110
111
RandomBoxPackerPy
(
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
121
RandomBoxPackerPy
(
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
134
typedef
RandomSpherePacker<RndRadiusGenPy, PackerWrap>
RandomSpherePackerBasePy
;
135
class
RandomSpherePackerPy
:
public
RandomSpherePackerBasePy
136
{
137
public
:
138
typedef
RandomSpherePackerBasePy
Inherited
;
139
140
RandomSpherePackerPy
(
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
151
typedef
GrainRndRadiusGen<GrainPy>
RndGrainGenBasePy
;
152
class
RndGrainGenPy
:
153
public
RndGrainGenBasePy
,
154
public
boost::python::wrapper<RndGrainGenBasePy>
155
{
156
public
:
157
typedef
RndGrainGenBasePy
Inherited
;
158
159
RndGrainGenPy
(
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
:
173
double
m_minParticleRadius
;
174
double
m_maxParticleRadius
;
175
};
176
177
typedef
PackerWrap<RndGrainGenPy>::CubicBoxPackerBase
GrainCubicBoxPackerPy
;
178
typedef
PackerWrap<RndGrainGenPy>::RandomBoxPackerBase
GrainRndBoxPackerPy
;
179
typedef
180
GrainRandomBoxPacker<RndGrainGenPy,GrainCollectionPy,PackerWrap>
181
GrainRandomBoxPackerBasePy
;
182
class
GrainRandomBoxPackerPy
:
public
GrainRandomBoxPackerBasePy
183
{
184
public
:
185
typedef
GrainRandomBoxPackerBasePy
Inherited
;
186
typedef
Inherited::Grain
Grain
;
187
typedef
188
Inherited::GrainCollection::GrainIteratorPy
189
GrainIteratorPy
;
190
191
GrainRandomBoxPackerPy
(
192
ParticleGrainGen
&particleGrainGen,
193
double
cubicPackRadius,
194
int
maxInsertionFailures,
195
const
BoundingBox
&bBox,
196
const
boost::python::list &circDimList,
197
double
tolerance
198
);
199
200
GrainRandomBoxPackerPy
(
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
214
GrainIteratorPy
getGrainIteratorPy
();
215
216
const
GrainCollection
&
getGrainCollectionPy
()
const
;
217
};
218
219
void
exportPacker
();
220
}
221
}
222
223
#endif
Python
esys
lsm
geometry
PackerPy.h
Generated on Mon May 6 2013 23:26:31 for ESyS-Particle by
1.8.3.1