Interaction between sphere and facet with specific ID

Asked by Ruidong LI

Hi!

If I want to get interaction between the bottom plate and spheres, how can I achieve this? For example, if we focus on the gravity deposition code, can we know which interactions happened between spheres and bottom plates?
The code for gravity deposition is presented here: https://yade-dem.org/doc/tutorial-examples.html#gravity-deposition

Cheer,
Kyle

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,

to get interaction of specific body, use [1]:
bodyIntrs = b.intrs()

To get interaction of multiple bodies, do:
bs = [bottom1,bottom2] # for example, bottom1 and bottom2 are bottom facets
intrs = [i for b in bs for i in b.intrs()]

# make them without possible duplicates
ids = set([(i.id1,i.id2) for i in intrs])
intrs = [O.interactions[id1,id2] for id1,id2 in ids]

Cheers
Jan

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

Can you help with this problem?

Provide an answer of your own, or ask Ruidong LI for more information if necessary.

To post a message you must log in.