← Back to team overview

yade-users team mailing list archive

[Question #682883]: calculate mass content of a group of particles through something like label

 

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

Hi,
I'd like to calculate the mass content of a group of spheres, as far as I know, we can obtain a mass of one sphere by:
O.bodies[id].state.mass
I'd like to ask that if we can obtain the mass of a group of spheres like: appending some spheres with a same label, like:
O.append(sphere((x1,y1,z1),radius=radius,label="label1"))
O.append(sphere((x2,y2,z2),radius=radius,label="label1"))
O.append(sphere((x3,y3,z3),radius=radius,label="label2"))
O.append(sphere((x4,y4,z4),radius=radius,label="label2"))
then we can obtain the total mass of spheres with label1, and label2 respectively?
I have tried in Yade, it seems that we can not give each sphere a label, is there any way that we can classify the spheres to different groups so that we can just loop in one group of spheres to calculate the mass?
Thanks in advance!


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