[gmx-users] detailed force output from gromacs

Mark Abraham mark.j.abraham at gmail.com
Mon May 25 16:54:20 CEST 2015


On Mon, May 25, 2015 at 4:00 PM Isabel Constantine <
isabel.constantine.usa at gmail.com> wrote:

> Dear gromacs community,
> Is there a way to get the detailed force components from a simple Ewald
> analysis?

Not directly. Writing each force component to its own memory and then
adding each component together is slower to run than the alternative
(accumulate to the force array as you go). mdrun -rerun will be your friend.

> I am interested in the individual contribution by real space, fourier and
> the intra-correction terms.
> "g_traj -f traj.trr -of " merely gives me total force which is not useful
> for me.
> If someone can point out the details and locations of such calculations in
> the code that also would be great. I could locate ewald.c, but couldnt find
> the erf function and intramolecular terms.. :(

Yeah, that's not the best approach. You can see in do_force_lowlevel (in
force.c[pp] depending what GROMACS version you're looking at) some knobs
you can hack in the code to get whole force components calculated (or not).

You probably want to make a .tpr with zero values for VDW parameters and
bonded force constants, so that only electrostatics forces will be computed
with mdrun -s special.tpr -rerun configurations.trr -o forces.trr. Hack the
code to separately turn off the three components you mention (e.g. in
response to setting environment variables before the run), and verify you
get zero force and energy. Then turn components on to get trajectories
whose forces are what you want.

Be aware that in the Verlet scheme, the bonded-interaction exclusions are
handled immediately in the short-ranged kernels (unlike in the group
scheme, where they are re-computed and subtracted off later). The only way
to compute the "excluded" forces with the Verlet scheme is to compare the
values from two runs, one with and without the *bonds* defined at all
(since it is the connectivity that creates the exclusions). But maybe you
don't actually want these components broken down at all.

Unless you're building a run-time optimizer for GROMACS, or going to
analyze millions of sets of forces, you might get better value for your
time with a slower and simpler MD package. ;-)



> Isabel
> PhD Candidate,
> Livingston University.
> --
> Gromacs Users mailing list
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> posting!
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-request at gromacs.org.

More information about the gromacs.org_gmx-users mailing list