← Back to team overview

yade-users team mailing list archive

[Question #661471]: Find particle id given its position

 

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

Good evening,
I was wondering, is there the possibility to find a particle id given its position efficiently?
Right now i have something like

	for b in O.bodies:
		if isinstance(b.shape,Sphere):
                      if b.state.pos[0]=1:
                            if b.state.pos[1]=1:
                                  if b.state.pos[2]=1:
	     		                print b.id,b.state.pos[0],b.state.pos[1],b.state.pos[2]

which works, but is horribly slow, as i need this to be done very often 
Anyway, thanks for your time, any help is really appreciated
George

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