← Back to team overview

yade-users team mailing list archive

Re: ids bodies contact

 

> could you tell me where exactly in the code I can find the creation of
> the interaction by the collider? 
For InsertionSortCollider, it is
InsertionSortCollider::handleBoundInversion or
InsertionSortCollider::handleBoundInversionPeri (for periodic boundary
condition). Concerning the former, it is called from line 61, inside the
loop where the actual sort happens (insertionSort method); the first id
passed to handleBoundInversion (which might become id1 of the new
interaction) will that with lower coordinate along the respective axis
(viInit). Since the sort is done along 3 axes independently, it is the
last axis along which bounding boxes will finally overlap that
determines the order.
> I repeated the same example with two spheres (so this time the functor
> is symmetric) and I still get the same result (as the one I initially
> described, this time being two spheres involved in the interaction). 
> Sorry if I ask but one of my "check" depends on the ids at contact.
You need to handle both cases, like

	if((i->getId1()==idA && i->getId2()==idB) || (i->getId1()==idB && i->getId2()==idA))

(we could add Interaction::matchIds(idA,idB) that would do that for you;
would it help you?)

There are (and will be) other colliders that might order things
differently and you shouldn't rely on this small detail. If you _really_
need it, you can describe what your problem is and we can try to find a
different solution.

Cheers, edx





References