1
#############################################################
3
## Copyright (c) 2007-2011 by The University of Queensland ##
4
## Earth Systems Science Computational Centre (ESSCC) ##
5
## http://www.uq.edu.au/esscc ##
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 ##
11
#############################################################
14
#An example python script to generate a bonded rectangular prism
16
# Define region extremities:
19
minPoint = Vector3(0.0,0.0,0.0)
20
maxPoint = Vector3(size,2.0*size,size)
22
# Define the volume to be filled with spheres:
23
# (e.g. a box bounded by planes)
24
# QUESTION: Are there constraints on normals e.g. inward facing?
25
box = BoxWithPlanes3D (
33
normal = Vector3(1.0,0.0,0.0)
37
box.addPlane(Plane(minPoint, Vector3(0.0,1.0,0.0)))
38
box.addPlane(Plane(minPoint, Vector3(0.0,0.0,1.0)))
39
box.addPlane(Plane(maxPoint, Vector3(-1.0,0.0,0.0)))
40
box.addPlane(Plane(maxPoint, Vector3(0.0,-1.0,0.0)))
41
box.addPlane(Plane(maxPoint, Vector3(0.0,0.0,-1.0)))
43
# Create a multi-group neighbour table to contain the particles:
47
gridSize = 2.5*maxRadius
53
sList.addGenericShape(
54
db = "shapeDatabase.db",
62
sList.addGenericShape(
63
db = "shapeDatabase.db",
71
# Fill the volume with particles:
72
packer = InsertGenerator3D (
74
maxRadius = maxRadius,
80
packer.generatePacking(
88
volume = 2.0*size*size*size
89
porosity = (volume - mntable.getSumVolume())/volume
90
print "Porosity: ", porosity
92
# write a geometry file in VTK format
94
fileName = "temp/geo_exampleShapeList.vtu",
98
# write a geometry file in raw (debug) format
100
fileName = "temp/geo_exampleShapeList.raw",
104
# write a geometry file in gengeo file format
106
fileName = "temp/geo_exampleShapeList.geo",