[gmx-users] Time-varying Ion Charges

Zach Levine zach.levine.gmx at gmail.com
Tue Sep 13 02:55:11 CEST 2011

Hi everyone,

I'm trying to implement time-varying charges for various ions located
in ions.itp in GROMACS 4.5.4, but I'm not sure where to begin.

I've already had some luck implementing AC external electric fields by
modifying /src/mdlib/sim_util.c, but this required minimal work from
me and a few strategically placed cosines. I have a feeling though
that time-varying individual atomic charges will be considerably more
difficult since I imagine GROMACS only reads from topol.top (and thus
from ions.itp) just once at the beginning without updating the value,
so I would likely have to import the time variable and recalculate the
charge at every successive step. Since time is explicitly mentioned in
the calc_f_el routine of sim_util.c (when I was dealing with external
fields) I had no problems making this work there, but is it possible
(or practical) to do the same thing with my static atomic charges as

I've found some references to reading topol.top in
/src/kernel/topio.c, and in theory I'd like to import, update, and
export certain charges as a function of time, perhaps also in
sim_util.c? I just don't know which files or variables to start
importing in, or where the best place to implement this would be.

Any ideas on this would be greatly appreciated, even if it's just
keywords or significant variables for me to grep.


More information about the gromacs.org_gmx-users mailing list