Hi!

I’m working on perfect lattices with porosities and in order to make it easier to quantify the porosity of a lattice, I created a little Python script which calls upon LAMMPS’s neighbor list in order to evaluate as optimally as possible how many neighbors are within a given cutoff distance for every atom, the idea being to plot the results in an histogram.

In the simple simulation setup I use a simple morse potential of the desired cutoff and no skin in the neighbor list.I then simply loop over the neighbor list and note the number of occurrence of each nearest neighbors given using this adapted code from the documentation :

nlidx = lmp.find_pair_neighlist(‘morse’)

nl = lmp.numpy.get_neighlist(nlidx)

tags = lmp.extract_atom(‘id’)

neighlist = {}

for i in range(0,nl.size):

idx, nlist = nl.get(i)

neighlist[nlist.size] = neighlist[nlist.size] + 1 if (nlist.size in neighlist) else 1

However I’m only now realizing the neighbor list is pairwise, and hence doesn’t yield the result I was hoping for, which makes sense otherwise neighbor list calculations would be much more computationally costly.

Is there a fix or use of the neigh_modify command that could yield the results I was hoping for? I was hoping on using LAMMPS to do this instead of some fully custom script in order to take advantage of LAMMPS’s powerful and already well optimized functions.

I haven’t found something of the sort in the documentation that could directly do this, but I’m guessing some use of compute cnp/atom or compute voronoi/atom could work, but I’m really uncertain.

Any hints or tips would be much appreciated! Thanks for your time!

Have a great day,