← Back to team overview

yade-users team mailing list archive

Re: [Question #658699]: Deleting the desired interactions

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello Xavier,
please try the following code. In the GUI on display tab, I checked intrAllWire and do not see any bonds between the two cubes. What version of Yade you use and what system? This works for me for Ubuntu 16.04 and yade-1.20.0.

###
from yade import pack

porosity = 0.3042744476
Young = 1.0e11 # 100Gpa
FrictAng = radians(18)
Density = 2640/(1-porosity)
Poisson = 1/3.0
Cohesion = 4.5e7 # pa
TensileStr = 4.5e6 # pa

rock = JCFpmMat(young=Young,frictionAngle=FrictAng,density=Density,poisson=Poisson,tensileStrength=TensileStr,cohesion=Cohesion)
steel = JCFpmMat(young=2.06e11,frictionAngle=radians(30),density=7800,poisson=0.3,tensileStrength=0,cohesion=0)

pred1 = pack.inAlignedBox((0,0,0),(0.01,0.01,0.01))
pred2 = pack.inAlignedBox((0,0,0.01),(0.01,0.01,0.02))

assembly1 = pack.randomDensePack(pred1,radius=0.0005,spheresInCell=1000,color=(1,1,1),material=rock)
O.bodies.append(assembly1)
assembly2 = pack.randomDensePack(pred2,radius=0.0005,spheresInCell=1000,color=(1,1,0),material=rock)
O.bodies.append(assembly2)

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5,label='bo1'),Bo1_Facet_Aabb()]),
   InteractionLoop(
      [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.5,label='ig2'),Ig2_Facet_Sphere_ScGeom()],
      [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys()],
      [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,label='lawFunctor')]
   ),
   VTKRecorder(fileName='post/scp-',recorders=['all'],iterPeriod=50),
   GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
   NewtonIntegrator(damping=0.3,gravity=(0,0,-9.81)),

]
O.trackEnergy=True
O.step()
bo1.aabbEnlargeFactor = 1.
ig2.interactionDetectionFactor = 1.

print len(O.interactions), len([i for i in O.interactions])

for i in O.interactions:
   if O.bodies[i.id1].shape.color != O.bodies[i.id2].shape.color:
      O.interactions.erase(i.id1,i.id2)
O.step()

print len(O.interactions), len([i for i in O.interactions])
###

cheers
Jan

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