← 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

    Status: Open => Answered

Karol Brzezinski proposed the following answer:
Hi,

all the interactions are stored in the O.interactions object, so you can
count the interactions in the following way:

i_count = len(O.interactions) # this will include also interaction with
walls and facets

You can count the number of spheres in such a way:

sp_count = 0

for bb in O.bodies:
    if isinstance(bb.shape, Sphere):
        sp_count += 1

and the number of clumps:

clump_count = 0

for bb in O.bodies:
    if bb.isClump:
        clump_count += 1

This solution is pretty straightforward, but I think that you can just
divide the number of interactions by the number of spheres (or clumps).

Cheers,
Karol

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