← Back to team overview

yade-dev team mailing list archive

Re: Why Ip2 functors must be symmetric?

 

>> Maybe not removed. I think it is necessary, precisely because we can
>> have non-symmetric functors. If you swap ids in Ip2 you may break the
>> work of the Ig2.
>> The go reverse is here for this reason (handling non-symmetric cases
>> without forcing a specific ordering of id1/id2 and without the need to
>> define to functors).
> The comment in line 98  in IntersectionLoop.cpp says:
>
> // arguments for the geom functor are in the reverse order (dispatcher would 
> normally call goReverse).
> // we don't remember the fact that is reverse, so we swap bodies within the 
> interaction
> // and can call go in all cases
>
> In fact, it seams goReverse is never called because bodies are swapped before. 
> So maybe we can get rid of it???
Swapping for the Ig2 and swapping for the Ip2 are two different things.
This comment at L98 applies for geometry only.

Swapping for the Ip2 after computing the geometry would break everything
(contact normal should be inverted, etc.)
It is also what L125  suggests: "assert(!swap)"; it is clear that the
Ip2 must NOT swap.
The only way to go without swapping is to call goReverse, as far as I
understand.

Removing goReverse was maybe an objective of Vaclav, then the present
situation would be half way to it. Not sure.
I don't see how we can get rid of goReverse when materials are not
symmetric anyway.

Bruno




Follow ups

References