How to compute neighbour atoms when use pair_style sw?

Hey everyone

I want to count the neighbour atoms for a 2D MoS2 system, and i wrote “compute 4 all coord/atom 2.0” in the input file. But the program stopped with the message “ERROR: Compute coord/atom cutoff is longer than pairwise cutoff (…/compute_coord_atom.cpp:89)”. I try to reduce the cutoff value but it doesn’t work unless cutoff = 0. And of course the number of neighbour atoms in dump file is 0, which is still meaningless for me.

The potential i use is a sw potential, by setting “pair_style sw” and “pair_coeff * * MoS2.sw Mo S”, MoS2.sw is the potential file. So i read the manual and find this:
“LAMMPS introduces an additional performance-optimization parameter tol that is used for both two-body and three-body interactions. In the Stillinger-Weber potential, the interaction energies become negligibly small at atomic separations substantially less than the theoretical cutoff distances. LAMMPS therefore defines a virtual cutoff distance based on a user defined tolerance tol. The use of the virtual cutoff distance in constructing atom neighbor lists can significantly reduce the neighbor list sizes and therefore the computational cost. LAMMPS provides a tol value for each of the three-body entries so that they can be separately controlled. If tol = 0.0, then the standard Stillinger-Weber cutoff is used.”
Is that means we cannot change the default cutoff vaule in sw pair style, Like “pair_style lj/cut 2.5”? Even so, is there any method to count the neighbour atoms by using “compute coord/atom” option and avoid the error as i mentioned before?

Thanks for your attention and look forward to your reply

Hey everyone

    I want to count the neighbour atoms for a 2D MoS2 system, and i wrote
"compute 4 all coord/atom 2.0" in the input file. But the program stopped
with the message "ERROR: Compute coord/atom cutoff is longer than pairwise
cutoff (../compute_coord_atom.cpp:89)". I try to reduce the cutoff value
but it doesn't work unless cutoff = 0. And of course the number of
neighbour atoms in dump file is 0, which is still meaningless for me.

   The potential i use is a sw potential, by setting "pair_style sw" and "pair_coeff
* * MoS2.sw Mo S", MoS2.sw is the potential file. So i read the manual
and find this:
"LAMMPS introduces an additional performance-optimization parameter tol
that is used for both two-body and three-body interactions. In the
Stillinger-Weber potential, the interaction energies become negligibly
small at atomic separations substantially less than the theoretical cutoff
distances. LAMMPS therefore defines a virtual cutoff distance based on a
user defined tolerance tol. The use of the virtual cutoff distance in
constructing atom neighbor lists can significantly reduce the neighbor list
sizes and therefore the computational cost. LAMMPS provides a tol value for
each of the three-body entries so that they can be separately controlled.
If tol = 0.0, then the standard Stillinger-Weber cutoff is used."
    Is that means we cannot change the default cutoff vaule in sw pair
style, Like "pair_style lj/cut 2.5"? Even so, is there any method to count
the neighbour atoms by using "compute coord/atom" option and avoid the
error as i mentioned before?

​i cannot reproduce what you are describing with the current version of
LAMMPS.
which version of LAMMPS are you using and on what platform are you running?

​when you start a run (without the compute), you should see an output like
this:

Neighbor list info ...
  2 neighbor list requests
  update every 1 steps, delay 5 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 4.77118
  ghost atom cutoff = 4.77118
  binsize = 2.38559, bins = 46 46 23
Setting up Verlet run ...
  Unit style : metal
  Current step : 0
  Time step : 0.001

​this "master list distance cutoff" is the largest cutoff available for the
compute.

axel.​

This is the log file when i run lammps. The lammps version is 16-Feb-2016 Stable version.

LAMMPS (16 Feb 2016)
units metal
atom_style full
atom_modify sort 1000 2.0
boundary p p p
read_data data
orthogonal box = (0 0 0) to (50 40 500)
1 by 1 by 8 MPI processor grid
reading atoms …
576 atoms
0 = max # of 1-2 neighbors
0 = max # of 1-3 neighbors
0 = max # of 1-4 neighbors
1 = max # of special neighbors
group Mo type 1
192 atoms in group Mo
group S type 2
384 atoms in group S
pair_style sw
pair_coeff * * MoS2.sw Mo S
newton on on
neighbor 2.0 bin
neigh_modify every 100 delay 0 check no
compute 1 all temp
compute 2 all pe/atom
compute 3 all ke/atom
compute 4 all coord/atom 2.0
min_style sd
minimize 1.0e-15 1.0e-15 100000 100000
WARNING: Resetting reneighboring criteria during minimization (…/min.cpp:168)
ERROR: Compute coord/atom cutoff is longer than pairwise cutoff (…/compute_coord_atom.cpp:89)

As you can see, it doesn’t mention the cutoff value, and there isn’t any “master list distance cutoff” neither.

Here is the input file I used:

units metal
atom_style full
atom_modify sort 1000 2.0
boundary p p p
read_data data
group Mo type 1
group S type 2
pair_style sw
pair_coeff * * MoS2.sw Mo S
newton on on
neighbor 2.0 bin
neigh_modify every 100 delay 0 check no

compute 1 all temp
compute 2 all pe/atom
compute 3 all ke/atom
compute 4 all coord/atom 2.0


The program stop at this line so the rest code is needless. And maybe you need the potential file:
#MoS2.sw

Mo S S 6.0672 0.7590 4.1634 1.0801 0.8568 0.1525 1.0 45.4357 4 0 4.0
Mo S Mo 0.0000 0.6097 7.0034 0.0000 0.8568 0.1525 1.0 181.8799 4 0 4.0
Mo Mo S 0.0000 0.6097 7.0034 0.0000 0.8568 0.1525 1.0 181.8799 4 0 4.0
Mo Mo Mo 3.5040 0.6097 7.0034 0.0000 0.8568 0.1525 1.0 181.8799 4 0 4.0
S S S 0.4651 0.6501 5.7837 0.0000 0.8568 0.1525 1.0 125.0923 4 0 4.0
S S Mo 0.0000 0.6097 7.0034 0.0000 0.8568 0.1525 1.0 181.8799 4 0 4.0
S Mo S 0.0000 0.6097 7.0034 0.0000 0.8568 0.1525 1.0 181.8799 4 0 4.0
S Mo Mo 6.0672 0.7590 4.1634 1.0801 0.8568 0.1525 1.0 45.4357 4 0 4.0

Thank you for your reply

This is the log file when i run lammps. The lammps version is 16-Feb-2016 Stable
version.

​please try a later version.​

​[...]

*WARNING: Resetting reneighboring criteria during minimization
(../min.cpp:168)*
*ERROR: Compute coord/atom cutoff is longer than pairwise cutoff
(../compute_coord_atom.cpp:89)*

As you can see, it doesn't mention the cutoff value, and there isn't any "master
list distance cutoff" neither.

​here is what i get (after faking an empty system, but atom coordinates are
irrelevant in this case):

​LAMMPS (28 Mar20 2016-ICMS)
WARNING: OMP_NUM_THREADS environment is not set. (../comm.cpp:90)
  using 1 OpenMP thread(s) per MPI task
Created orthogonal box = (0 0 0) to (10 10 10)
  1 by 2 by 2 MPI processor grid
0 atoms in group Mo
0 atoms in group S
WARNING: Resetting reneighboring criteria during minimization
(../min.cpp:168)
Neighbor list info ...
  2 neighbor list requests
  update every 1 steps, delay 0 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 6.15654
  ghost atom cutoff = 6.15654
  binsize = 3.07827, bins = 4 4 4
Setting up sd style minimization ...
  Unit style : metal
Memory usage per processor = 0.0636444 Mbytes
Step Temp E_pair E_mol TotEng Press
​ ​

​axel.​