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.

_______________________________________________
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