← Back to team overview

yade-dev team mailing list archive

Questions on contact logic and the new "requestErase" approach

 

Hello

I saw (perhaps not so) recent changes in the contact logic (in CohesiveFrictionalContactLaw), and I'm not sure it is correct. I started writing an email then I found a message from Vaclav about this. I'm reviewing Vaclav's message and sending another mail when its done.
The text below is a "before-review" version, just for history...

Bruno





If I understand correctly, we have :

1. Previous approach :

The contact law set !isReal when there is no physical interraction.
If (!isReal && !AABBintersection) _at the end of the cycle_, then erase interaction.

2. Current approach :

The contact law request deleting interaction at the beginning of next iteration as soon as there is no physical interraction.

CohesiveFrictionalContactLaw, l.122 :
{ // BREAK due to tension
ncb->interactions->requestErase(contact->getId1(),contact->getId2());

But then, if AABBs still overlap, the collider will immediatly create the same iteration again, which is a waste of time. Or, even worst, it might be possible that the collider will keep this interaction deleted (IIRC the collider only detects BBs changing status from !overlap to overlap, when BBs keep overlaping, it does nothing). So if the same bodies come in contact again, the contact will not be detected at all.

Also, I still see in the collider :

if(!overlap && found && (haveDistantTransient ? !interaction->isReal() : true) ){ //LOG_DEBUG("Erasing interaction #"<<id1<<"=#"<<id2<<" (isReal="<<interaction->isReal<<")");
           transientInteractions->erase(body_id_t(id1),body_id_t(id2));

Which means we are deleting interactions twice if (haveDistantTransient), or perhaps never, since the contact law is not setting isReal=false anymore.





O



--

_______________
Chareyre Bruno
Maitre de conference

Grenoble INP
Laboratoire 3SR - bureau E145
BP 53 - 38041, Grenoble cedex 9 - France
Tél : 33 4 56 52 86 21
Fax : 33 4 76 82 70 43
________________