Number of neighbouring atoms not calculated correctly

Hello LAMMPS users,
I am using the LAMMPS version 12Dec2018. I am currently attempting to do a KMC simulation to calculate the diffusion coefficient of an Inconel-Ni alloy using LAMMPS. I have attached the required parts of the input file here. I am trying to count the number of atoms within the radius of a randomly-chosen atom using the ‘region sphere’ command. But it is giving me 0 as the number of neighbours, which is wrong. I checked the number of neighbours for that particular atom, and the number should be 43. This is what the log file displays at the end.

variable num_nnatoms equal “count(nnatoms)”
variable nn equal ${num_nnatoms}
variable nn equal 0

How do I rectify this?
MATSCI.in (3.3 KB)

Regards,
Rajesh

Please study the documentation of the region command and specifically check out the meaning of the “units” keyword for the region command. Please note that the default setting is “units lattice”.