← Back to team overview

yade-users team mailing list archive

Re: [Question #556997]: How to compute average contact radius

 

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

Bruno Chareyre proposed the following answer:
There is at least one thing in the above code which is bizzare. 
This:

for i in O.interactions:
                          id1.append(i.id1); id2.append(i.id2)
for k in rang (0,len(id1)):
                          Acontactradius=O.interactions[id1[k],id2[k]].phys.contactradius+...

It is literally equivalent to (in pseudo code):

for i in O.interactions:
    get(id1,id2)
for all (id1,id2):
    find i=O.interaction(id1,id2) 

Which is obviously pointless.
Jérôme (#1) was mainly  speaking about syntax  ([i.phys.kn for i in O.interactions]  is exactly like "for i in O.interactions: append" in terms of operations) but what he suggested also replaces these two loops by one.

Bruno

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