yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #22488
Re: [Question #689131]: Basic Problem using parallel run in Yade
Question #689131 on Yade changed:
https://answers.launchpad.net/yade/+question/689131
Status: Open => Answered
Jan Stránský proposed the following answer:
Have a look how pack.randomDensePack does it [1] using sp.cellFill [2]
(and optionally sp.filterSPherePack [3])
A MWE:
###
from yade import pack
r = 0.005
num = 20
dimSmall = (0.04, 0.04, 0.04)
dimFull = (1, 1, 1)
sp = pack.SpherePack()
sp.makeCloud((0,0,0),dimSmall,r,num=num,periodic=True,seed=1)
print(len(sp),sp.dim()) # 20 particles in this case
sp.cellFill(dimFull)
print(len(sp),sp.dim()) # 312500 particles in this case (is "instantaneous")
#filterSpherePack(...) # if needed
#sp.toSimulation() # takes 30 s on my laptop
###
sp.toSimulation() might take some time, adding to simulation is not prallelized :-)
but should be significantly faster than makeCloud with all the particles
cheers
Jan
[1] https://gitlab.com/yade-dev/trunk/-/blob/master/py/pack/pack.py#L560
[2] https://yade-dem.org/doc/yade.pack.html#yade._packSpheres.SpherePack.cellFill
[3] https://yade-dem.org/doc/yade.pack.html#yade.pack.filterSpherePack
--
You received this question notification because your team yade-users is
an answer contact for Yade.