← Back to team overview

yade-users team mailing list archive

[Question #403773]: contact position

 

New question #403773 on Yade:
https://answers.launchpad.net/yade/+question/403773

Hello,

I want to determinate the contact position (x,y,z) and export it in text file.
I have a cube with 100000 particles in this link:

https://filex.univ-lorraine.fr/get?k=IeGdl6rNjXEaNttLxcF

To obtain the positions of contact, i loop on O.interactions and i use these lines of command

def record():      
  for i in O.interactions:
    if not i.isReal : continue
    if isinstance(O.bodies[i.id1].shape,Sphere) and isinstance(O.bodies[i.id2].shape,Sphere):
      x1=i.geom.contactPoint[0]
      x2=i.geom.contactPoint[1]
      x3=i.geom.contactPoint[2]
  
  yade.plot.addData(x1=x1,x2=x2,x3=x3)
  plot.saveDataTxt(OUT)

The problem is the loop don't work on the contacts and the file text repeat the same coordinates of a contact.
The total script is in this link:

https://filex.univ-lorraine.fr/get?k=MG5vd4Vp8EFcwupfxzT


Best regards.
Jabrane.

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