← Back to team overview

yade-users team mailing list archive

Re: [Question #700889]: Output collsions particles-walls and particle-particle per cycle

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

number of interactions/contacts of one specific body (e.g. a wall) you can do
len(body.intrs()) # [1]

For more "overall" interaction statistics, you can loop over interactions [2].
E.g. to get total number of sphere-sphere (meaning of particle-particle?) interactoins:
### maybe better to put the code in a function
nSphSph = 0
for i in O.interactions:
    shape1 = O.bodies[i.id1].shape
    shape2 = O.bodies[i.id2].shape
    if type(shape1) is Sphere and type(shape2) is Sphere:
        nSphSph += 1
###

Cheers
Jan

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

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