Hello LAMMPS users,

I want to obtain a global vector, "delta_z" of length N (where N is the number of atoms in the system), in which each element, "delta_z_i" is the minimum difference between the z-coordinate of atom i and the z-coordinate of any other atom with a z-coordinate larger than that of atom i (e.g., atom i's "nearest(+z) neighbor"). I can then use fix ave/time to get an averaged distribution of delta_z. I do not want to include second-, third-, etc. nearest(+z) neighbors.

My motivation is the following: I am studying adsorbates in very small-diameter cylindrical pores, such that atoms cannot pass by another, and I have been instructed to calculate this distribution as one descriptor of the structure of the adsorbate.

Does anyone have a suggestion for how to obtain the vector, delta_z? At present, my thought is to write a compute that searches the neighbor list of each particle to find its nearest-z neighbor and then calculates the difference in z-coordinate to that particle. I would use compute_rdf as a starting point.

Kind regards,

Matt Mansell

PhD Candidate

Dept. of Chemical & Biomolecular Engineering

North Carolina State University