← Back to team overview

yade-users team mailing list archive

Re: [Question #233241]: how to get the body numbers who is contact with a sphere

 

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

    Status: Answered => Open

liucheng83 is still having a problem:
Hello,
I try this srcipts:
-----------------------------------------------------------
k=200
count = 0
for i in O.interactions.withBody(k):
if i.isReal:
count += 1

print count

len(O.interactions.withBody(k))

len(O.interactions.withBodyAll(k))
------------------------------------------------------------------
The result is the same as the inspector.   Thank you all,  Christian and Jan.

But how to caculate the coordination number wihin a box range, I just
want to caculate the particle who is not moving. Is the following is
true?

----------
                   for i in range(103,len(O.bodies)):
                         if O.bodies[i].state.vel.norm()<0.1 :
					if len(O.interactions.withBody(i))>=3:
						num_in_contact[0]=num_in_contact[0]+1	
						num_contact[0]=num_contact[0]+len(O.interactions.withBody(i))
                  num_coordination[0]=1.0*num_contact[0]/num_in_contact[0]
----------

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.