<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <br>
    <div class="moz-cite-prefix">On 11/13/17 1:26 AM, Mandar Kulkarni
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAKC_24hKJ9qYYzrQoipSx2Ce0Q192KoGFRrnFFT8b3Q+ZUOkvw@mail.gmail.com">
      <div dir="ltr">
        <div>
          <div>
            <div>Dear Gromacs Developers,<br>
            </div>
            I am running osmotic pressure simulation using GROMACS 5.0.7
            version. I am applying flat-bottom potential similar to the
            work of Lay et al. (J. Chem Theory Comput., 2016,12, 1401).<br>
            <br>
            I have provided reference pdb which has Z-coordinates of
            solute atoms to be restrained are set to the value of  half
            of the box length in Z-direction and layer like potential is
            applied using posre.itp with a format shown below:<br>
            [ position_restraints ]<br>
            ;  i funct      g    r    k<br>
               1    2      5    2.8    1000<br>
            <br>
          </div>
          I would like to print instantaneous force acting on the wall
          due to solute atoms while running a simulation. I guess that
          forces are calculated in "position-restraints.cpp" file and
          Line 293 gives the total force acting on the wall for
          layer-like flat bottom potential.<br>
          <br>
          for (m = 0; (m &lt; DIM); m++)<br>
                  {<br>
                      f[ai][m]   += fm[m];<br>
                      /* Here we correct for the pbc_dx which included
          rdist */<br>
                      vir_diag[m] -= 0.5*(dx[m] + rdist[m])*fm[m];<br>
                  }<br>
        </div>
        <div><br>
          Please, any guidance to implement printing of instantaneous
          forces will be really helpful.<br>
        </div>
        <div>Thanks in advance.<br>
        </div>
        <div><br>
          (PS: I am sorry if this is answered previously, but I am
          unable to find the similar discussions in archived threads.)<br>
        </div>
        <div>
          <div><br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    I wouldn't bother trying to hack the GROMACS source, just re-compute
    the force due to the restraint after the simulation, based on the
    z-coordinate over time. Extract the z-coordinates with gmx traj and
    post-process the frames with whatever code you like. It's a simple
    calculation.<br>
    <br>
    -Justin<br>
    <br>
    <blockquote type="cite"
cite="mid:CAKC_24hKJ9qYYzrQoipSx2Ce0Q192KoGFRrnFFT8b3Q+ZUOkvw@mail.gmail.com">
      <div dir="ltr">
        <div>
          <div><br clear="all">
            <div>
              <div>
                <div>
                  <div class="m_1281973837817339044gmail_signature">
                    <div dir="ltr">
                      <div>
                        <div dir="ltr">
                          <div>
                            <div dir="ltr">
                              <div>
                                <div dir="ltr">
                                  <div>
                                    <div dir="ltr">
                                      <div>
                                        <div dir="ltr">
                                          <div>
                                            <div dir="ltr">
                                              <div>
                                                <div dir="ltr">
                                                  <div>
                                                    <div dir="ltr"><font
                                                        face="arial,
                                                        helvetica,
                                                        sans-serif"
                                                        size="2"><font
                                                          style="background-color:rgb(255,255,255)"><font
color="#000000"><span></span><span></span></font><span
                                                          style="font-family:monospace,monospace"><span
style="color:rgb(0,0,255)"><span
                                                          style="background-color:rgb(255,255,255)">Best
                                                          Regards</span>,<br>
                                                          Mandar
                                                          Kulkarni</span></span></font><span
style="font-family:monospace,monospace"><span style="color:rgb(0,0,255)">
                                                          <br>
                                                          </span></span></font>
                                                      <div><span
                                                          style="color:rgb(0,0,255)"><font
                                                          face="arial,
                                                          helvetica,
                                                          sans-serif"
                                                          size="2"><br>
                                                          </font></span><br>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
==================================================

Justin A. Lemkul, Ph.D.
Assistant Professor
Virginia Tech Department of Biochemistry

303 Engel Hall
340 West Campus Dr.
Blacksburg, VA 24061

<a class="moz-txt-link-abbreviated" href="mailto:jalemkul@vt.edu">jalemkul@vt.edu</a> | (540) 231-3129
<a class="moz-txt-link-freetext" href="http://www.biochem.vt.edu/people/faculty/JustinLemkul.html">http://www.biochem.vt.edu/people/faculty/JustinLemkul.html</a>

==================================================
</pre>
  </body>
</html>