← Back to team overview

yade-users team mailing list archive

Re: [Question #235985]: Highest clump position in clump cloud

 

Question #235985 on Yade changed:
https://answers.launchpad.net/yade/+question/235985

Sergio posted a new comment:
Thank you for the comment Bruno!

So, I've tried to modify the code as follows:

maxHeight1=-1000
maxHeight2=-1000
maxHeight3=-1000
#///////////// Layer heights \\\\\\\\\\\\\\\
def altCapas():
	global maxHeight1
	global maxHeight2
	global maxHeight3
	for b in O.bodies:
		if b.shape.color==(0.3,0.9,1):
			maxHeight1=max(maxHeight1,b.state.pos[1])
			print 'Maximum height layer 1:',maxHeight1
		elif b.shape.color==(0.9,0.2,1):
			maxHeight2=max(maxHeight2,b.state.pos[1])
			print 'Maximum height layer 2:',maxHeight2
		elif b.shape.color==(0.3,0.2,0.1):
			maxHeight3=max(maxHeight3,b.state.pos[1])
			print 'Maximum height layer 3:',maxHeight3

Now, the function works. BUT there is a problem. Since I want the
highest clump position of each layer, this function only works properly
if the clumps move up. If they move down, as in my case, the highest
position in each layer results in first iter. (As iter 1 pos > iter 2
pos). It would be needed something else to achieve the highest clump
position in each time step. I'll keep trying.

Thanks again for the help!!!

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