Avoid grompp charge warning with rounding
commit635eb138152e351d7bdaeb2575c8cddae8ec5f78
authorBerk Hess <hess@kth.se>
Fri, 2 Jun 2017 08:35:16 +0000 (2 10:35 +0200)
committerKasson <kasson@gmail.com>
Wed, 7 Jun 2017 16:44:51 +0000 (7 18:44 +0200)
tree633368775156029884880778307110b252dc9096
parentcd6b63dbe65fd262a1732ee3a1ff38b2be0018a7
Avoid grompp charge warning with rounding

Even though the grompp total charge check uses double for summation,
there are rounding errors for each charge when charges are stored
in single precision. Now the charge check rounds the net charge of
molecules to integer when the difference is less than the maximum
possible sum of charge rounding errors.

Fixes #2192.

Change-Id: I4e24620ed4ff0901b297db4689e75f0befd23944
src/gromacs/gmxpreprocess/topio.cpp