espressopp / espressopp

Main ESPResSo++ repository

Home Page:http://www.espresso-pp.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible bug report to CoulombKSpaceEwald.hpp

xzhh opened this issue · comments

Just leave some remarks:

  1. The coulombic prefactor (e.g. vacuum permitivity) is not included in both computeVirial and computeVirialTensor.
    If users call espressopp.analysis.PressureTensor(system), for example, they will get a sum of Pij = tensor_real(pref=given) + tensor_kspace(pref=1.0). For the real-space part, it never goes wrong because its computeVirial is handled by VerletListInteractionTemplates which reads forces directly.

  2. The for-loops for building the k-vector are triple-nested with ranges of kx ∊ [0,kmax], ky ∊ [-kmax,kmax] and kz ∊ [-kmax,kmax]. Recently, I found, from other ewald implementations, that the actual range should be {kz ∊ [1,kmax], when kx=ky=0} ⋃ {kx = 0 / ky = [1,kmax] / kz ∊ [-kmax,kmax]} ⋃ {kx ∊ [1,kmax], ky ∊ [-kmax,kmax], kz ∊ [-kmax,kmax]}. Basically, there is no condition like {kx>=0 / ky<0 / kz<0}.

I have patched both of them and will merge to the pull request if there is no further question.

Regards,
Zhenhao