yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #13760
Re: [Question #404417]: Generate a specific number of spheres in the empty spaces of a created loose pack
Question #404417 on Yade changed:
https://answers.launchpad.net/yade/+question/404417
Status: Open => Answered
Jan Stránský proposed the following answer:
Hi Amir,
you have to add existing particles to SpherePack, otherwise it does not
know about other particles:
######################## script 1 - save simulation
from yade import pack
sp = pack.SpherePack()
sp.makeCloud((0,0,0),(10,10,10),1)
sp.toSimulation()
O.save('pip0.yade')
########################
######################## script 2 - loads simulation and correclty use
SperePack
from yade import pack
O.load('pip0.yade')
# adds all existing particles
sp = pack.SpherePack([(b.state.pos,b.shape.radius) for b in O.bodies])
print len(O.bodies)
sp.makeCloud((0,0,0),(10,10,10),0.1,num=100)
O.bodies.clear() # important !!, otherwise there will be existing particles
twice
sp.toSimulation()
print len(O.bodies)
########################
cheers
Jan
2016-11-27 1:23 GMT+01:00 amir <question404417@xxxxxxxxxxxxxxxxxxxxx>:
> New question #404417 on Yade:
> https://answers.launchpad.net/yade/+question/404417
>
> Hello,
>
> I need to generate a specific number of small particles inside the empty
> spaces of a created loose pack with bigger spheres. The geometry of the
> loose pack was created in a separated file and it is loaded at the begging.
>
> O.load('pip0.yade')
>
> sp = pack.SpherePack()
> sp.makeCloud((0,0,0),(0.01,0.01,0.01),rMean=.0001,num=100)
> sp.toSimulation()
>
> The problem is that small spheres are generated over existing particles
> and it results in a kinda explosion while there is enough empty space to
> embed new particles. I was wondering if you could help me to solve this
> problem.
>
> Regards,
> Amir
>
>
>
>
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>
--
You received this question notification because your team yade-users is
an answer contact for Yade.