How to determine particles out of a specific range

Submitted by knoe_ph on Tue, 07/03/2012 - 15:49

Hi there,

I'm trying to determine all the top particles of my pebble bed (so basically the top layer) in order to figure out the average z-coordinate of these particles (the z-coordinate of the top layer particles slightly vary, obviously.)

Is there a clever way to do so?

My idea was to pick my top particle with bound(all,z_max) and then put all atoms which are in the range of (z_max - particlediameter) in one group. But then again, how do i get the average z-coordinate of this group of particles out of it?

Hopefully someone can help me here.

Kind regards,
Philipp