yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #20551
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
Status: Answered => Open
Leonard is still having a problem:
Hi Jan,
Thanks for your answer, I think it should work.
However, when I check "O.interactions.has(1,2)" using this MWE, it seems that when there is no interaction between id1 and id2, O.interactions.has(1,2) can still be True:
#####
from yade import pack, plot
sand = CohFrictMat(isCohesive=True,young=30e9,poisson=0.3,frictionAngle=radians(30),density=2650.0,normalCohesion=10e9, shearCohesion=80e6,label='sand')
O.materials.append(sand)
s1=utils.sphere((0,0,0),radius=1,color=[1,1,1],fixed=True,material='sand')
s2=utils.sphere((0,0,1.8),radius=0.8,color=[1,1,1],material='sand')
O.bodies.append(s1)
O.bodies.append(s2)
s2.state.blockedDOFs='z'
s2.state.vel = Vector3(0,0,1e2)
Gl1_Sphere.quality=3
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D()],
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
NewtonIntegrator(damping=0.4),
]
# run for one step for generating interaction
O.step()
####
I found that:
At iter 1, I run:
In [1]: for i in O.interactions:
...: print i.id1,i.id2
...:
0 1
In [2]: O.interactions.has(0,1)
Out[2]: True
It is correct, then I move forward for one step to make the two spheres separate and check again:
In [3]: O.step()
In [4]: for i in O.interactions:
...: print i.id1,i.id2
...:
In [5]: O.interactions.has(0,1)
Out[5]: True
It means that at iter2, there is no interaction between id1 and id2, but O.interactions.has(0,1) still equals True.
Could you please point out where is the problem?
Thanks!
--
You received this question notification because your team yade-users is
an answer contact for Yade.