[gmx-users] Again: Non-integer charges in tpr-files
Erik Lindahl
lindahl at stanford.edu
Tue Oct 8 20:23:06 CEST 2002
K.A. Feenstra wrote:
> Erik Lindahl wrote:
>
>>Won't work, since we don't request that all charge groups are strictly
>>neutral. It's only with cutoffs that the neutrality is important, but
>>the concept of charge groups still speeds up neighborsearching quite a lot.
>
>
> Ok, then what about this (you probably thought about this also, but
> anyway): in sum_q in topio.c, the charges are summed as follows:
>
> *qt += n*atoms->atom[i].q;
>
> qt is *double, but t_atom.q is a float. Is the increment then done in
> double or single precision? Or is that not defined?
Double according to ANSI C. All intermediary results in C are double,
even if _all_ operands are float (although you can sometimes override
the standard with compiler flags).
Cheers,
Erik
More information about the gromacs.org_gmx-users
mailing list