← Back to team overview

yade-users team mailing list archive

Re: [Question #695739]: Calculation of the number of contact point in the particles

 

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

Jan Stránský posted a new comment:
Hi,
yet another option is to use [1]
bodyInteractions = b.intrs()
returning list of body interactions. If you are interested merely in the number, then
len(bodyInteractions)
returns you the result, or you can do some more fancy postprocessing (like counting only interactions with spheres, excluding walls:
def isSphereSphere(i):
    bs = [O.bodies[id] for id in (i.id1,i.id2)]
    return all(isinstance(b.shape,Sphere) for b in bs)
len([i for i in bodyInteractions if isSphereSphere(i)])

The optimal choice really depends on your needs..

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Body.intrs

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