id1, id2

Asked by lingran on 2013-09-10

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:
2013-09-11
Last query:
2013-09-11
Last reply:
2013-09-10
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.

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.

lingran (zhanglingran130) said : #3

Thanks Bruno Chareyre, that solved my question.