← Back to team overview

yade-users team mailing list archive

Re: [Question #683555]: How to check if there is interaction between Id1 and Id2 at current step?

 

Question #683555 on Yade changed:
https://answers.launchpad.net/yade/+question/683555

Description changed to:
Hi,
I'd like to make the simulation pause when O.interactions[id1,id2] lost, so I tried two ways to check if there is interaction between id1 and id2 at current step?
1.def stopIfIntLost():
    if O.interactions[1,2].isReal ==False:
        O.pause()
But I found that this way is wrong according to [1].
2. def stopIfIntLost():
    if O.interactions[1,2].geom.penetrationDepth==0:
        O.pause()
But I think this way is not good (it is wrong), because when O.interactions[1,2] lost, there will post an error. 
What I want is something like:
def stopIfIntLost():
    if there is no interaction between id1 and id2:
        O.pause()
Is there any strategy you recommend to achieve it?
Many thanks.

[1]https://yade-
dev.gitlab.io/trunk/yade.wrapper.html#yade.wrapper.Interaction.isActive

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.