problem with createInteraction() command
Hi all,
When I used createInteraction() command to manually create intrs between 2 spheres, I got an error:
RuntimeError: Interaction #39+#18 already exists.
I have then check these 2 spheres #39 and #18:
Sphere #39 has no intrs, len(O.bodies[
Please see the MWE (Minimal Working Example™) generating this error down below. Please let me know why I have this RuntimeError error?
Best regards,
Thai-Son
PS: I have also tried aabbEnlargeFactor and interactionDete
#-------------- MWE -------
# encoding: utf-8
# -------
#######
### INPUT PARAMETERs ###
#######
seed0=1 # = 1 -> same packing everytime
distributeMass0
num_spheres0=200
mx=Vector3(
mn=Vector3(0,0,0)
porosity0=0.4
rRelFuzz0=0.7 # for the case of polydisperse
compFricDegree = 15.0 # initial contact friction during the confining phase (will be decreased during the REFD compaction process)
confiningS=-1e5
surfaceTension=
young0= 50e9 # 50 GPa
poisson0= 0.2
density0 = 2530 # 2.53 g/cm3 = 2530 kg/m3
tensileStrength = 3.3e9 # 3.3 GPa
shearStrength = 3.3e9 # 3.3 GPa
#######
## GENERATING PARTICLE PACKING ###
#######
from yade import pack
import pylab
O.materials.
O.materials.
walls=aabbWalls
wallIds=
### Aggregate generation ###
num_spheres1D=
sp=pack.
rMean0=
sp.makeCloud(
O.bodies.
### mechanical loading #### To confer a solid-like nature to the packing
triax=TriaxialS
internalCompac
goal1=confiningS,
goal2=confiningS,
goal3=confiningS,
max_vel=10,
label="triax"
)
newton=
unsat=Unsaturat
# -------
O.engines=[
ForceResetter(),
### Collsion detector
InsertionSortC
### Interaction handling
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
useIncrement
always_
label=
),
GlobalStiffnes
triax,
newton
]
# -------
numDEMiter1stDE
numDEMiter2ndDE
numDEMiter3rdDE
numDEMiterPerDr
while 1:
O.run(
unb=unbalanced
if unb<0.01 and abs(triax.
break
## REACH NEW EQU. STATE ###
finalFricDegree = 30 # contact friction during the deviatoric loading
# We move to deviatoric loading, let us turn internal compaction off to keep particles sizes constant
triax.internalC
# Change contact friction (remember that decreasing it would generate instantaneous instabilities)
setContactFrict
while 1:
O.run(
unb=unbalanced
if unb<0.001 and abs(triax.
break
triax.depth0=
triax.height0=
triax.width0=
O.run(numDEMite
ei0=-triax.
si0=-triax.
### counting the real number of spheres generated by YADE
num_spheres_real=0
for b in O.bodies:
if not isinstance(
num_spheres_real =num_spheres_real+1
num_spheres=
### -------
### ---- GLUEING THE PARTICLE manually ---- ###
### -------
### calculating number of no-intrs bodies to see the effect of manuallly creating bond between particles
NoIntrsBodies=[]
for i in range(6,
if len(O.bodies[
NoIntrsBodies
print 'NoIntrsBodies before creating additional bonds: ', len(NoIntrsBodies)
#------
# CREATE BONDS BETWEEN PARTICLES MANUALLY
#------
# List of no-bond particles
EnlargeFactorMa
ParticleWithMan
for i in NoIntrsBodies:
if not i in ParticleWithMan
for j in range(6,
if not i==j and not i in ParticleWithMan
if (float(
# --- MANUALLY CREATE INTERATION (BOND) BETWEEN 2 SPHERES --- #
createInte
# -- this ParticleWithMan
if not i in ParticleWithMan
ParticleW
if not j in ParticleWithMan
ParticleW
NoIntrsBodiesAf
for i in range(6,
if len(O.bodies[
NoIntrsBodies
print 'EnlargeFactorM
print 'NoIntrsBodies after creating additional bonds: ', len(NoIntrsBodi
### --- DEBUGGING section --- # Please use this pack of codes after getting the error "RuntimeError: Interaction #39+#18 already exists."
#%cpaste
print ''
print "i in NoIntrsBodies >>>", i in NoIntrsBodies
print "j in NoIntrsBodies >>>", j in NoIntrsBodies
print "i in ParticleWithMan
print "j in ParticleWithMan
print "EnlargeFactorM
print "len(O.
print "len(O.
if len(O.bodies[
for k in range(len(
print "O.bodies[
print " ", O.bodies[
if len(O.bodies[
for k in range(len(
print "O.bodies[
print " ", O.bodies[
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Bruno Chareyre
- Solved:
- Last query:
- Last reply: