[gmx-developers] Hybrid MC, accept/reject state
hypolit at googlemail.com
Wed Feb 13 17:01:51 CET 2013
I am trying to figure out how one would go about implementing a simple
Hybrid Monte Carlo scheme in GROMACS. For my purposes I am only interested
in the md-vv integrator, using either a NVT or NPT ensemble. MPI is not a
strict necessity, as the system I am going to look at are probably small.
So far I reversed the order between the energy calculation and the
trajectory output, by keeping a backup of my current configuration where
appropriate. This way I can check whether to accept the current
configuration before anything is written to the trajectory file.
The point I am struggling with is the overall energy: It seems it is not
sufficient to just deal with enerd->term[F_ETOT] from md.c. For example if
I do an integration step, (thereby changing the current
enerd->term[F_ETOT]) and then decide to reject it (setting enerd->[F_ETOT]
= previousEnergy and copying back the previous state->x), a different value
than previousEnergy is written to the .edr file.
I guess the actual energy output takes place in print_ebin of
mdlib/mdebin.c, or more precisely do_enx of gmxlib/enxio.c. I can't really
make out of this works though. Is there any detailed information about the
file format available somewhere? It seems like either enerd->term[F_ETOT]
from md.c is not directly used and/or the total energy is recalculated
somewhere along the way.
If anybody sees a glaring error in my approach in general, please point it
out as well - I am really new to the GROMACS source and have only a rough
understanding of how it works overall.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gromacs.org_gmx-developers