← Back to team overview

yade-users team mailing list archive

Re: [Question #628595]: Problem creating clumps from existing spheres

 

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

    Status: Answered => Solved

loiseaurare confirmed that the question is solved:
Hi christian,

thanks for your answer !

However, I thought I was trying to append a list of object, because that
is what is stores in each occurence of the agglomerates list, as defined
here :

# clump agglomerates
n = max(a for a in attrs) -- > numbers af agglomerates
colors = [randomColor() for _ in xrange(n)]
agglomerates = [[] for _ in xrange(n)] ---> create a list af list with n occurences

for s,a in zip(sp2,attrs):  ----> here sp2 is a list of bodies
        aa = a
 s.agglomerate = aa
 s.shape.color = colors[aa]
        agglomerates[aa].append(s) ---> so it's bodies that are appended in each of the agglomerates lists.

Anyway, I actually think I solved my problem. I was explained that
actually the function appendClumped appends the bodies that are given as
a list, whereas the bodies I wanted to clump where already appended in
the simulation ( with the sphereToSimulation function ).

So I used the clump function, which however does not take a list of
BODIES, like appendClumped, but a list of IDS of bodies. I didn't get
that while reading the documentation, I thought the two functions used
the same args, so I didn't succeed in using clump at first.

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