#initGeoemtry.py:
#===============
#
#A script to initialise a box of particles to settle into a conical bucket
#
# D. Weatherley, UQ, 2018.
#
#import the gengeo module:
from gengeo import *

minPoint = Vector3 (-20,-20,-20)
maxPoint = Vector3 (20,20,20)
Rmax = 0.5
Rmin = 0.2
bmin = Vector3 (-2.5,4.5,-2.5)
bmax = Vector3 (2.5,9.5,2.5)

#define a box volume to fill with particles:
box = BoxWithPlanes3D (
   minPoint = bmin,
   maxPoint = bmax
)

#initialise the particle neighbour table:
ntable = MNTable3D (
   minPoint = minPoint,
   maxPoint = maxPoint,
   gridSize = 2.5 * Rmax, 
   numGroups = 1
)

#Construct a packer to insert particles within the box:
packer = InsertGenerator3D (
   minRadius = Rmin,
   maxRadius = Rmax,
   insertFails = 10000, 
   maxIterations = 100,
   tolerance = 1.0e-6,
   seed = True
)

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

#Write the particle geometry as ESyS-Particle geometry file:
ntable.write("myparticles.geo", 1)

#Write the particle geometry as a VTK file for visualisation:
ntable.write("myparticles.vtu", 2)

GlossyBlue theme adapted by David Gilbert
Powered by PmWiki
www.000webhost.com