Question #404417 on Yade changed:
https://answers.launchpad.net/yade/+question/404417

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Amir,
thanks for the script, revealing the problem (which would be very difficult
without the scripts). The problem is in your 2nd script:

sp = pack.SpherePack([(b.state.pos,b.shape.radius) for b in O.bodies if
> isinstance (b.shape,Sphere)])
> print len(O.bodies)
> sp = pack.SpherePack() # TO BE DELETED, DO NOT CREATE NEW SpherePack !
> sp.makeCloud((0,0,0.0),(0.01,0.01,0.01),rMean=r2,num=10)


once you create sphere pack from existing particles (first "sp = ..."), do
not create another spherePack, since then sp variable is somathing
completely different and you would lose your particles (as you experience
now).

sp = SpherePack()
sp.fromSimulation() # a more elegant way instead
of pack.SpherePack([(b.state.pos,b.shape.radius) ...)
sp.makeCloud((0,0,0.0),(0.01,0.01,0.01),rMean=r2,num=10)
# ... delete existing spheres OR O.clear(); O.bodies.append(facetBox(...))
sp.toSimulation()

cheers
Jan

-- 
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     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to