About the stencil order in pppm

I have simulated a system including 1000 SPC/E water molecules with periodic boundary and pppm method. In the log file, I noticed that the stencil order of pppm equals 5:

PPPM initialization …
using 12-bit tables for long-range coulomb (src/kspace.cpp:342)
G vector (1/distance) = 0.19705771
grid = 50 50 50
stencil order = 5

I have read the source code of the pppm.cpp and find the stencil order is used in the calculation of the K-space error. In the paper provided by the manual, Deserno and Holm, J Chem Phys, 109, 7694 (1998)., the stencil order is represented by P, which is the number of species of charges. For SPC/E model, there are only two kinds of charges, -0.8472 and +0.4236, so P should equal 2, which contradicts the value in the log file.
Is there something wrong with my understanding? I have attached my code and result, and any help is appreciated!
stencil order problem.rar (387.3 KB)

The explanation of what is meant by “stencil order” in PPPM in LAMMPS can be found in the documentation of the kspace_modify command — LAMMPS documentation

The order keyword determines how many grid spacings an atom’s charge extends when it is mapped to the grid in kspace style pppm or msm. The default for this parameter is 5 for PPPM and 8 for MSM, which means each charge spans 5 or 8 grid cells in each dimension, respectively.

2 Likes

Thanks a lot, I have read the explanation in the documentation and reread the relevant part of Deserno’s paper carefully. There are two quantities both named P but with different meanings in Deserno’s paper and I have confused the two quantities.