#import the GenGeo library:
from gengeo import *

Rmin = 0.3 #mm
Rmax = 1.0 #mm
Length = 10.0 # mm

#bounding points of the box to fill with particles:
minPoint = Vector3(0,0,0)
maxPoint = Vector3(10,10,10)

#create a box volume:
box = BoxWithPlanes3D (
   minPoint = minPoint,
   maxPoint = maxPoint
)

#create a neighbour table:
mntable = MNTable3D (
   minPoint = Vector3(-10,-10,-10),   #minPoint-Vector3(10,10,10)
   maxPoint = Vector3(20,20,20),	     #maxPoint+Vector3(10,10,10)
   gridSize = 2.5 * Rmax,
   numGroups = 1
)

#create a particle packer:
packer = InsertGenerator3D (
   minRadius = Rmin,
   maxRadius = Rmax,
   insertFails = 10000,
   maxIterations = 1000,
   tolerance = 1.0e-6,
   seed = True
)

#generate the particle packing:
packer.generatePacking(
   volume = box, 
   ntable = mntable, 
   groupID = 0,
   tag = 1 
)

mntable.tagParticlesAlongPlane (
   plane = Plane(Vector3(0,0,0),Vector3(0,1,0)),
   distance = 1.5*Rmax,
   tag = 2,
   groupID = 0
)

#write out the geometry file:
mntable.write("box.geo",1)

#write out the geometry as a .vtk file:
mntable.write("box.geo.vtu",2)
GlossyBlue theme adapted by David Gilbert
Powered by PmWiki
www.000webhost.com