Neighbor lists for large systems

Dear LAMMPS developers,

I have been trying to calculate the full neighbor list for each atom in a bilayer system having 11908 atoms. My goal is to find the most nearest neighbor of each atom out of those full neighbor lists.

I have been using pair_style ‘hybrid’ with ‘rebo’ and ‘zero’ potentials for different pairs of atoms.

So far, I have chosen the cutoff for the neighbors as 100 A^o and the vacuum in the input structure is 120 A^o, to see if I could get the neighbor lists correctly. As the system is large, I think the neighbor list cutoff should not be less than 100 A^o, since the atoms at the edges of the unit cell needs to find the neighbors. While having this large cutoff, if the vacuum in the input structure is less than 100 A^o, then some of the atoms from the repeated unit cell along z-axis are also included in the neighbor lists. To avoid this , I am always choosing the vacuum to be more than the neighbor cutoff.

When I calculate the neighbor lists with these input conditions, I have noticed that the atoms at the edges of the unit cell do not have the most nearest neighbors included in their neighbor lists. To overcome this problem, I attempted to increase the neighbor list cutoff even further. However, I encountered the following error:

Exception: ERROR on proc 0: Neighbor list overflow, boost neigh_modify one (src/npair_full_bin.cpp:120)
Last c

When I increase the neigh_modify one from 10000, I am getting this error :

Exception: ERROR: Neighbor page size must be >= 10x the one atom setting (src/neighbor.cpp:307)

I am having trouble understanding this error. This is the first time I am working with a large system in LAMMPS. To achieve my goal that I mentioned above, should I have to increase the neighbor cut-off further? Or is there a better approach I should take ?
I would appreciate your help in resolving this issue.

Thank you in advance.

From https://docs.lammps.org/neigh_modify.html:

Default
The option defaults are delay = 0, every = 1, check = yes, once = no, cluster = no, include = all (same as no include option defined), exclude = none, page = 100000, one = 2000, and binsize = 0.0.

The default value of page is 100000, so with one>10000 you’ll have the error since page is < 10x of one now. You need to increase the page setting accordingly, too.

  • How exactly are you planning to do that step?
  • What do you need to know the closest neighbor over a long distance for?
  • (Ab-)Using the neighbor list code for this purpose is awfully inefficient and wasteful.
  • What is the purpose of the vacuum?
  • Can you provide a snapshot of the system geometry including the box boundaries?

Hi Akohlemy,

By using the lmp.extract_atom(“x”) method, I get the positions of all the neighbors. Then by sorting the distance between the neighbors and the central atom, I get the most nearest neighbor.

I need this information as I need to understand the stacking type that the central atom is forming with it’s most interlayer nearest neighbor.

Sorry for the inefficiencies in my previous usage of LAMMPS. I appreciate your guidance and would like to explore alternative methods for calculating the neighbors more effectively. If you have any suggestions or recommendations, please let me know.

As per my understanding, the purpose of including a vacuum region in the simulation is to prevent the consideration of interactions between consecutive unit cells along the z-axis.

That does not explain why you need to use such a crazy large cutoff. Within a structure like yours, the closest neighbors are within less than 2 angstrom. Indeed, it makes even less sense with that explanation that without. :frowning:

lmp.extract_atom(“x”) will provide access to the coordinates of the per processor atoms (local and ghost). Of course, if you increase the cutoff, you increase the cutoff for communicating ghost atoms so you create more ghosts (and waste memory and performance) and eventually have copies of all atoms (and then some) when using periodic boundaries.

You get access to the neighbor lists with the the python module functions:

  • find_pair_neighlist()
  • get_neighlist()
  • get_neighlist_size(), and
  • get_neighlist_element_neighbors()

Please see 2.3.10. Neighbor list access — LAMMPS documentation for examples on using those functions.

LAMMPS has several computes to classify the immediate environment of atoms in solids.

Hi Akohlmey,

Thank you for the explanations.

I have been following the https://docs.lammps.org/Python_neighbor.html example to get the neighbor lists for each atom. To get the access to the positions of those neighbors, I used the command lmp.extract_atom(“x”) as shown in the example code attached below.

When I get the positions of the neighbors for each atom, I am calculating the distance between them and the central atom to find the most nearest neighbor.

For some atoms which are at the boundaries of the unitcell, the most nearest neighbor could be a ghost atom. That’s why I am using the large cutoff. At the end, I need the position of the most nearest neighbor for each local atom.

Is there any possible way that instead of taking large cutoff, I could read the position of the most nearest neighbor even it is a ghost atom?

This statement makes no sense at all. When you increase the cutoff, you are only adding atoms to the neighbor list that are farther away. So, if anything, you should reduce the cutoff. For as long as you have at least one neighbor in each neighbor list, you will have the closest atom within that list. Because ghost atoms are real copies, their positions will already be suitable for computing the distance right away and thus not special treatment for applying minimum image conventions or similar is necessary.

Thank you so much for the explanations. It seems I understood the code wrong way. I will reduce the cutoff in order to get the list of closest neighbors.