Delete interaction

Asked by Przemek

Hi there,
I have a question about deleting the interaction. Maybe it is a trivial question but I can't find the answer to it. I want to implement it in my constitutive law.
Simple example. A surface (box or facet) contacts with the sphere and compress it. After that surface moves back, so the normal stress equals zero at a crucial point. But I still have an interaction between these bodies. How to delete it?
My code is based on CpmPhys.

BR
Przemek

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Przemek
Solved:
Last query:
Last reply:
Revision history for this message
Karol Brzezinski (kbrzezinski) said :
#1

Hi Przemek,

I think that this should be enough[1]:

O.interactions.erase(id1,id2)

This option removes 'geom' and 'phys' properties. Also changes 'isReal' to false. In such a case, the collider should remove potential (not real) interaction [2]. However, if the particles are overlapping or something the interaction may be created in the next loop.

Cheers,
Karol

[1] https://answers.launchpad.net/yade/+question/151859
[2] https://yade-dem.org/doc/prog.html?#handling-interactions

Revision history for this message
Przemek (przemekn) said :
#2

Hi Karol,

Yes, but that is in Python. I need it in C++, because I want to implement it in my Law code :)

BR
Przemek

Revision history for this message
Karol Brzezinski (kbrzezinski) said (last edit ):
#3

Hi Przemek,

sorry, I thought that you can check how this function works in C++ and try to do the same [3]. But I am not really familiar with the C++ side of the Yade, and I realize it may not be that easy.

Cheers,
Karol

[3]https://gitlab.com/yade-dev/trunk/-/blob/master/core/InteractionContainer.cpp#L75

Revision history for this message
Jan Stránský (honzik) said :
#4

Hello,

I could not find any details in documentation, although there should be some (in Programmer's manual, in tutorial->new law or similar).
Feel free to add these information if you find it appropriate.

It depends on what you call "delete interaction".

Normally, you "delete existing interaction" by returning false from Law2::go [1].
Sticking to CPM, see [2] (the "if tension and (broken or not cohesive)" branch, compared to "compression branch" [3] returning true.

BUT, the interaction itself is not deleted, it is just reset (setting geom and phys to None, making it non-real), and it is then up to collider (IMO, not 100% sure) to deal with it.

Cheers
Jan

[1] https://gitlab.com/yade-dev/trunk/-/blob/master/core/InteractionLoop.cpp#L190
[2] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/ConcretePM.cpp#L472
[3] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/ConcretePM.cpp#L498

Revision history for this message
Przemek (przemekn) said :
#5

Hi Jan,

thanks for the hint. Already found the mistake I made when modifying the Cpm model.
Karol, thank you for your help, too.

BR
Przemek

Revision history for this message
Przemek (przemekn) said :
#6

Hi there,

I added this section which returns "false" and now it works. Thanks for your help!

BR
Przemek

Revision history for this message
Przemek (przemekn) said :
#7

It is solved! :)