[lammps-users] Regarding error: ERROR: Out of range atoms - cannot compute PPPM

Hi all,

I am trying to simulate flexible tip3p water (100 molecules) with K_space values, and am getting an error “ERROR: Out of range atoms - cannot compute PPPM”. It works fine, when used with coul/cut. The force field parameters used are taken from LAMMPS documentation itself.

I found it as a frequently occurring error and discussed in the LAMMPS documentation. Considering the suggestion, I tried to fix the error by reducing the timestep, increasing the initial packing volume to avoid bad initial geometry etc, and it didn’t work. While visualizing the final configuration, there appears to be no overlapping also. The re-neighbouring criteria was updated to neigh_modify every 1 delay 0 check yes. To avoid any cross-mapping of charges to PPPM grids owned by different processors, the simulation was run in serial with a single processor.

Apart from that, I have a confusion with the density values printed by the thermo_style command. It appears always higher than the expected/calculated value from the volume values. Consider step 1000 as an example: the volume is 27000 and density is 0.1107 printed by the thermo_style. But when calculating the density manually using mass/volume (mass of 100 water molecules is 1801.54 and volume 27000) the value obtained is 0.0667. Could you please help me to understand why this difference arises? This calculation is included in the script, assigned to variable Den and printed as the last column in thermo_style.

I have been trying to resolve this issue for a long time now, but nothing works. Can someone please help me to resolve it.

The lammps input script, data file and log file are attached for reference.

Thanks in advance.

water100.txt (20.5 KB)

in.tip3p (1.14 KB)

log_1.txt (395 KB)

1 Like

There are multiple issues with your input and multiple of them contribute to the errors you are seeing.

  • your system is very small and that makes using fix npt particularly difficult because your pressure will fluctuate much more than for larger systems. this can be in part alleviated by using the drag keyword, but also you need to use a larger pdamp time constant to avoid coupling of the barostat fictitious degrees of freedom to the system and so that the relative changes in volume are small enough to be able to handle pppm’s requirements.
  • you are not simulating a correct TIP3P model. you are missing making it rigid with fix shake or fix rattle. then you can also save time by using a larger timestep (in the 1-2 fs range)
  • you are wasting a lot of CPU time by explicitly setting the kspace cutoff to a much larger value than required by your kspace precision. You can see that from the timing summary where you spend over 75% of the time computing kspace while with the optimal setting it would be 40%

Since your system is small and since you don’t mind spending CPU time, you may consider using kspace style ewald instead of pppm which should not suffer from the “out of range” atom situation.

The discrepancy in the density calculation stems from different units. your density is computed in AMU/Angstrom3 while LAMMPS reports density for real units in g/cm3 as is explained in the documentation of the units keyword.