uodate len(O.bodies) after erasing particles
Dear all
I deleted some particles in my simulation. Particles and their interactions are erased without a problem.
But the length of O.bodies is the same as before deletion. I did that with looping over bodies and also with looping over len(O.bodies) but neither of them solve my problem.
Thanks in advance.
Here is my script:
# -*- coding: utf-8 -*-
from yade import pack
num_spheres=1000
compFricDegree = 30
targetPorosity = 0.43
finalFricDegree = 30
rate=-0.02
damp=0.2
stabilityThresh
young=5e6
mn,mx=Vector3(
O.materials.
O.materials.
walls=aabbWalls
wallIds=
sp=pack.
clumps=False
if clumps:
volume = (mx[0]-
mean_rad = pow(0.09*
c1=pack.
sp.makeClumpCl
sp.toSimulatio
O.bodies.
else:
sp.makeCloud(
O.bodies.
triax=TriaxialS
maxMultiplier=
finalMaxMultip
thickness = 0,
stressMask = 7,
internalCompac
)
newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
GlobalStiffnes
triax,
newton
]
triax.goal1=
while 1:
O.run(1000, True)
unb=unbalance
print 'unbalanced force:',unb,' mean stress: ',triax.meanStress
if unb<stabilityTh
break
######### 1 loop over O.bodies
triax.internalC
for b in O.bodies:
if b.id>5:
if b.state.pos[0]<.5:
O.bodies.
######### 2 loop over len(O.bodies)
#triax.
#for b in range(len(
# if O.bodies[b].id in range(6):
# continue
# else:
# if O.bodies[
# O.bodies.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- azim
- Solved:
- Last query:
- Last reply: