you can use a script like this for what you need:
import woo, woo.core, woo.dem, woo.pack
# this returns geometry only via dynamic simulation
# define the geometyr (cylinder)
# define what particles go into the cylinder
# create new scene
# add capsules
# print endpoint coordinates for all of them
for p in S.dem.par:
if not isinstance(p.shape,woo.dem.Capsule): continue
Note however a few caveats:
- You will need the latest version of woo from git (or wait for the package from woo-daily PPA) since I only wrapped Capsule::endPt in python now (the function existed before, by only in c++)
- The dynamic simulation in randomDensePack2 is somewhat unreliable depending on what you do, and might involve some hand-tuning. On the top of that, I did some big fixes in the underlying PeriIsoCompressor engine lately... I am not sure what the result will be, as the input variation is too big.
- The generated packing is not 100% overlap-free, which is in fact impossible (at least with dynamic methods). If you use the packing later, make sure you take the initial position as equilibrium, to avoid initial explosion.
If you only need loose packing, or want to run gravity deposition yourself, that is another topic, and the solution would be simpler (no secondary simulation involved, just generation and deposition):
import woo.core, woo.dem, woo.utils, math
from minieigen import *
# add bottom and cylinder walls
# run and stop manually when happy
The post-processing to save particle endpoints would be the same as in the former case.