missing neighbors in the neighbor list...

Hi all lammps users,

I am new for the LAMMPS and I have a question about the missing neighbors in the neighbor list in the dump file. I would explain what I tried to do.

I am doing some stress calculations related to a force perturbation with 1000 particles in a 2D simulations box. After all the simulation I wanted to find which particle is contacting with which (neighbor list). Actually I can find the neighbor list in two different ways…

first method:

looking at the particle position coordinates which I have dumped out in the dump.cor file. I have no any problem with this…

second method:

Lammps can generates neighbor list and this will show me who are the contacting particles. This where I got the problem…

I found the neighbor list from the both method… But the problem is I am missing some neighbors when I directly used the second method. (I lost around 10% of the neighbors when I compared with the first method). Then I searched which type of neighbor pairs I am missing… Actually all of them were at the boundaries of the simulations box. I guess I haven’t done anything wrong with the introducing periodic boundary conditions… Following is the important steps of the simulation. I did this simulation through 3 different steps using 3 different input files. (I have written all the important steps only).

Hi all lammps users,

I am new for the LAMMPS and I have a question about the missing neighbors in
the neighbor list in the dump file. I would explain what I tried to do.

i seriously doubt that LAMMPS is missing neighbors. that would cause
problems and inconsistent results throughout.
i am convinced that the issue is with how you interpret the data.
your input below is complex and incomplete. nobody has the time to check this.

if you are still convinced that there is a bug in LAMMPS, please
construct a simple, small and complete input deck (so that it can be
run and tested with minimal effort) that creates a small test system
and then outputs the neighbors.
...and then provide an explanation what pairs you are missing and why
you think they should be there.

Hi all lammps users,

This is a continuation with the very first email of this conversation.

Thank you very much for all the responses… but I wasn’t able to solve the problem yet. I made a simple input test file out of 1000 particles and I identified the neighbors from the particles’ coordinates files (dump.cor) and directly from the neighbor list file (dump.lst) which are dumped out from the lammps. I have 2671 total number of neighbor pairs in the dump.lst file. But still I have some extra neighbors (220 neighbor pairs) when I identify neighbors from the dump.cor file.

Then I found missing fairs of the dump.lst file by comparing with the dump.cor file (using by a FORTRAN code… I implemented periodic boundary conditions even in the analysis routing…)

This is how I checked whether they are supposed to be neighbors or not… say one of the missing particle IDs, i and j…

( radious_i + radius_j ) > r_ij ; where r_ij is the distance between the i and j particles

as an example dump.lst file was missing following pair with the IDs,

27 & 587 ( say i and j )

# original position coordinates.(this is 2 dimensional and the length scale is from - 0.5 to + 0.5 )
xi yi x_j y_j
0.47802999999999995 0.15983599999999998 -0.49010123999999999 0.16892700000000005

# distance between two particles:
sqrt(x^2+y^2) = 0.9681

# distance between two particles after implementing periodic boundary conditions.
1-0.9681 = 0.0319

# length of the simulation box :

# changing the length scale for particle separation :
34.979600 * 0.0319 = 1.1158

# sum of the radius :
0.5 + 0.7 = 1.2 ( this is with the same length scale with the simulation box )

since ( radious_i + radius_j ) > r_ij, this two particles should be neighbors according to this situation. But in the dump.lst file doesn’t show this pair as a neighbor pair.

I don’t know this issue is related to something else with my codes. So I copied the simple test program here with as more information.

Further, all the missing pairs, i and j, are located near to the boundaries of the simulation box. i.e., -L/2 and the +L\2 (If particle i located near to the -L/2 wall, the other particle j is located near to the +L/2 wall.)

It’s possible the dump local command is not doing the
right thing when you have newton off and the internal
neighbor list is different than with newton on (the default).

However it’s very unlikely that the internal neighbor

list itself is incorrect.

If you can post a simple, complete input script
that illustrates the mis-match, we can take a look.

What you posted does not appear to be complete,
as I do not see where any atoms are defined.


I checked compute pair/local. It was

missing some logic to count the number
of pairs correctly when the newton pair
flag = 0, as it does for your granular model.

Try the patch today and see if you now get

a consistent count of neighbors from the
output of dump local using compute pair/local.

As I said before, the internal LAMMPS neighbor
list (used for computing forces, etc) was correct.
It was just the output of dump local with newton = 0
that was flawed.


Hi dear Stev and Axel,

Thanks for working on my problem and really appreciate this. I would let you know if I solved the problem.

Have a great night.


Hi all,

With Dr. Steve’s previous email, he said that " try the patch today and see …" It was 23rd of September… But I couldn’t see any patch release on that day. I want to download that file… Any one can help me where I can find it?

Also I have another question…

The lammps version I have been working with was issued in last year (September 2013)and I never wanted to update that and I have so much data that I created with that lammps version. After I started to analyze those data, I realized the issue with the missing neighbors and then I reported to the lammps forum… The problem was related to the lammps and then it was fixed (according to the Dr. Steve mail above) with a patch.

I have spent lot of time with simulations for getting data and this problem was related to the final stage of my simulation.

As I understand, I have two options to rectify the issue,

  1. Install the patch- If I want to install this patch, I will have to install all the patches which was released after the Sep 2013…

  2. reinstall lammps with the updated version…

When I select one of the above options, I have two major concerns,

  1. I don’t want to re-do all of my simulations from the beginning since it is too much time consuming.

  2. Since the problem I had with the final stage of the simulation (say this is a multistage simulation which was done with several input files running one after another…), I just need to fix the problem at the final stage… ( I hope I would be able to get the correct dump output with re-running the simulation with very few # of time steps and size of the time step making extra small )

What I am thinking to do is,

  • Compare the patch and the lammps version I have already and identifying differences related to the bug

  • Change those specific lines accordingly in the current version of the lammps that I have.

Is this possible ? Could you please someone suggest me the best way to do this…

Thank you so much for all.


It should be in either the 25 or 30Sep patch. On the bug patch web page each
lists the files that are affected. It also has links to the download page

which explains how to apply patches. They leave *orig files so you can
compare each file that was changed. Or you can just download a new
tarball and compare the files in the 2 dirs.



Thank you very much Dr. Steve and all others for the great helps always.

This mail again related to recent bug fixes which was related to the missing neighbors.

Before all, I would include part of my input file as follows.

compute 2 all property/local patom1 patom2
compute 3 all pair/local fx fy fz p1 p2 p3 force p4

dump 3 all local 100001 dump.lst index c_2[1] c_2[2] &
c_3[1] c_3[2] c_3[3] &
c_3[4] c_3[5] c_3[6] &
c_3[7] c_3[8]

This is the way that I used to get the neighbor list and the pairwise force list for the neighbors. Before the recent bug fixes, I was able to get dump output of pairwise neighbor IDs and the pairwise forces from single dump local command since the every member of the output had same number of rows(for example 2506 rows for the 1000 particles). But after the recent bug fix, output related to the compute pair/local has more lines( # of rows 2606) than the compute property/local ( # of rows 2506). Due to this reason, I cannot get the dump local output as a single file or from a single dump local command. Even though, if I got the pairwise force separately as a separate out put file, I cannot get the IDs of the contacting particles which is related to the each force pairs.

Could you please anyone give me an idea for solving this problem.

Thanks for your valuable time.



I am sorry that if I am annoying. But I would like to know why didn’t I get a reply for my question which I asked with previous email. At least I would like to know whether this is an another bug related to lammps or this is something that I should figure out myself.

I am waiting to hear from you.

Thanks for your time.


you’re not annoying, but looking into some Qs takes time.

And other tasks often take priority.


I think I fixed this - will be in next patch later today …