← Back to team overview

yade-users team mailing list archive

Re: [Question #689196]: How to add all particles to a new pack.SpherePack()

 

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

Description changed to:
Hi,
I want to plot the PSD curve in a triaxial test, the PSD curve is the curve of all particles after scale up (not original psd in makeCloud). And the yade psd.py[1] is really a good example to plot the psd curve, but it aims at the original size of the particles(see MWE below).
#####
import matplotlib; matplotlib.rc('axes',grid=True)
from yade import pack
import pylab
sp=pack.SpherePack(); 
sp.makeCloud((0,0,0),(1,1,1),rMean=0.03,rRelFuzz=2/3.,distributeMass=False);
pylab.figure()
pylab.plot(*(sp.psd(mass=True)+('g',)))
pylab.legend(['Mass PSD of size-uniform distribution'])
#############

I tried in this way: 
##
sp=pack.SpherePack(); 
sp.makeCloud((0,0,0),(1,1,1),rMean=0.03,rRelFuzz=2/3.,distributeMass=False);
Here: particles scale-up code which is from yade triaxial script
sp2=pack.SpherePack()
Here: how to add all scale-up particles to the new defined sp2
Then :
pylab.figure()
pylab.plot(*(sp2.psd(mass=True)+('g',)))
pylab.legend(['Mass PSD of size-uniform distribution'])
###

I'd like to ask that how to add all particles to a new pack.SpherePack().
Or is there other ways that can directly plot the scale-up psd curve?

Thanks,
Leonard
[1]https://github.com/yade/trunk/blob/master/examples/test/psd.py

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.