← Back to team overview

yade-users team mailing list archive

[Question #258987]: updating O.bodies

 

New question #258987 on Yade:
https://answers.launchpad.net/yade/+question/258987


There's a problem in O,.bodies when we delete some particles during simulation. Or if we use replaceByClumps() (because in replaceByClumps also a ball is deleted and replaced by a clump).

In these case, if we then want to iterate over bodies we get an error because O.bodies() has not been updates and there're some ids with no physical body. 

for example after using replaceByClumps(), I'd like to use calm() function in pyrunner as

def calm():
	for ii in range(1,(len(O.bodies)-1)):
 		O.bodies[ii].state.vel=Vector3(0,0,0)

but the function crashes because some bodies are missing. This can be solved by:

1- if there's a function to check the existence of a body
2- if we can update O.bodies

Do you guys have any idea about this?

Thanks
Behzad

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.