yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #17035
[Question #667121]: Problem creating clumps with existing spheres
New question #667121 on Yade:
https://answers.launchpad.net/yade/+question/667121
Hi everyone!
I'm trying to model concrete with clumps . I make a very simple test for creating clumps with existing spheres but it does not work. I get the error "IndexError: Body already has id 0 set; appending such body (for the second time) is not allowed.". The script is as follows:
from yade import pack,export,qt,ymport
#define material for all bodies:
id_Mat=O.materials.append(FrictMat(young=1e6,poisson=0.3,density=1000,frictionAngle=1))
Mat=O.materials[id_Mat]
O.bodies.append(sphere([0,0,0], material=Mat, radius=0.5))
O.bodies.append(sphere([1,0,0], material=Mat, radius=0.5))
O.bodies.append(sphere([0,1,0], material=Mat, radius=0.5))
O.bodies.append(sphere([1,1,0], material=Mat, radius=0.5))
listOfClumpMembers = []
for b in O.bodies:
tpos=b.state.pos
if tpos[0]<0.1:
listOfClumpMembers.append(b)
O.bodies.appendClumped(listOfClumpMembers)
I have checked the related answers but I still cannot solve this problem.
Thanks in advance!!
--
You received this question notification because your team yade-users is
an answer contact for Yade.