id1, id2

Asked by lingran

Hi all,

Suppose two particles are in contact. What kind of regime does yade use to choose one particle as interaction.id1 and the other particle as interaction.id2? Or id1 and id2 are just chosen randomly by yade?

Thanks.

Best regards.

Lingran

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hello Lingran,

The answer should be there : pkg/common/InsertionSortCollider.cpp (give a look to the call to function handleBoundInversion). Determination of "id1" and "id2" bodies relies, I think, on comparison of numerical values of "bounds" of the two bodies.

Before other answers, more precise, you should maybe give a look to https://www.yade-dem.org/doc/yade.wrapper.html#bound and https://www.yade-dem.org/doc/user.html#creating-interactions to figure how it works.

Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#2

They are ordered randomly.
Well... as Jerome suggests, we don't make a call to random() to order them, it results from details of the collider's algorithm.
As a user though, better ignore these details and act as if it was completely random.

Revision history for this message
lingran (zhanglingran130) said :
#3

Thanks Bruno Chareyre, that solved my question.