<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Christian,<br>
      <br>
      You may want to have a look at grompy
      (<a class="moz-txt-link-freetext" href="https://github.com/GromPy/GromPy">https://github.com/GromPy/GromPy</a>). This is a python wrapper
      around the gromacs 4.0.7 library, using direct C-library calls.
      One current application is sampling the grand-canonical ensemble
      using a hybrid MC scheme.<br>
      <br>
      The application is published here:<br>
      <a class="moz-txt-link-freetext" href="http://onlinelibrary.wiley.com/doi/10.1002/jcc.22947/abstract">http://onlinelibrary.wiley.com/doi/10.1002/jcc.22947/abstract</a><br>
      <br>
      Best regards,<br>
      Ren&eacute;<br>
      <pre class="moz-signature" cols="72">=====================================================
Ren&eacute; Pool

Department of Biological Psychology
Faculty of Psychology and Education
VU University Amsterdam
Van der Boechorststraat 1
1081 BT AMSTERDAM, the Netherlands

Room 2B-05
E: <a class="moz-txt-link-abbreviated" href="mailto:r.pool@vu.nl">r.pool@vu.nl</a>
T: +31 20 598 38 52
=====================================================
</pre>
      On 02/13/2013 05:01 PM, Christian H. wrote:<br>
    </div>
    <blockquote
cite="mid:CAF_d05jKfATx=BKDrQwnfBHdki8zA+pUZ-ieL+9DahbSymHhuQ@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      Hi,<br>
      <br>
      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.<br>
      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.<br>
      The point I am struggling with is the overall energy: It seems it
      is not sufficient to just deal with enerd-&gt;term[F_ETOT] from
      md.c. For example if I do an integration step, (thereby changing
      the current enerd-&gt;term[F_ETOT]) and then decide to reject it
      (setting enerd-&gt;[F_ETOT] = previousEnergy and copying back the
      previous state-&gt;x), a different value than previousEnergy is
      written to the .edr file.<br>
      <br>
      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-&gt;term[F_ETOT] from md.c is not directly used
      and/or the total energy is recalculated somewhere along the way.<br>
      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. <br>
      <br>
      Thanks,<br>
      Christian<br>
    </blockquote>
    <br>
  </body>
</html>