<div dir="ltr"><div>Thanks a lot for your response.<br>Currently, I am using gmx traj and a C-program to calculate osmotic pressure. My test calculations for NaCl ions matches the previous study of Luo and Roux.<br>The study by Lay et al. mentions minor modification ( J. Chem Theory Comput., 2016,12, 1401) in GROMACS source code. I thought it would be efficient to print these values on the fly. Thanks once again.  <br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_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 size="2" face="arial, helvetica, sans-serif"><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><font size="2"><span style="font-family:monospace,monospace"><span style="color:rgb(0,0,255)"><span style="background-color:rgb(255,255,255)"></span>Postdoctoral Research Fellow,<br></span></span></font></div><div><font size="2"><span style="font-family:monospace,monospace"><span style="color:rgb(0,0,255)">Department of Chemistry,<br></span></span></font></div><div><font size="2"><span style="font-family:monospace,monospace"><span style="color:rgb(0,0,255)">Pusan National University,</span></span></font></div><div><span style="color:rgb(0,0,255)"><font size="2" face="arial, helvetica, sans-serif"><span style="font-family:monospace,monospace">Busan, South Korea</span><br></font></span><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Nov 17, 2017 at 8:00 PM,  <span dir="ltr">&lt;<a href="mailto:gromacs.org_gmx-developers-request@maillist.sys.kth.se" target="_blank">gromacs.org_gmx-developers-request@maillist.sys.kth.se</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send gromacs.org_gmx-developers mailing list submissions to<br>
        <a href="mailto:gromacs.org_gmx-developers@maillist.sys.kth.se">gromacs.org_gmx-developers@<wbr>maillist.sys.kth.se</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/<wbr>mailman/listinfo/gromacs.org_<wbr>gmx-developers</a><br>
<br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:gromacs.org_gmx-developers-request@maillist.sys.kth.se">gromacs.org_gmx-developers-<wbr>request@maillist.sys.kth.se</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:gromacs.org_gmx-developers-owner@maillist.sys.kth.se">gromacs.org_gmx-developers-<wbr>owner@maillist.sys.kth.se</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of gromacs.org_gmx-developers digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. Re: Flat-bottom position restraints: printing of<br>
      instantaneous forces (Justin Lemkul)<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Thu, 16 Nov 2017 08:05:18 -0500<br>
From: Justin Lemkul &lt;<a href="mailto:jalemkul@vt.edu">jalemkul@vt.edu</a>&gt;<br>
To: <a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
Subject: Re: [gmx-developers] Flat-bottom position restraints:<br>
        printing of instantaneous forces<br>
Message-ID: &lt;<a href="mailto:b52cfa65-c9c1-21ed-5642-084fc8853512@vt.edu">b52cfa65-c9c1-21ed-5642-<wbr>084fc8853512@vt.edu</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;; Format=&quot;flowed&quot;<br>
<br>
<br>
<br>
On 11/13/17 1:26 AM, Mandar Kulkarni wrote:<br>
&gt; Dear Gromacs Developers,<br>
&gt; I am running osmotic pressure simulation using GROMACS 5.0.7 version.<br>
&gt; I am applying flat-bottom potential similar to the work of Lay et al.<br>
&gt; (J. Chem Theory Comput., 2016,12, 1401).<br>
&gt;<br>
&gt; I have provided reference pdb which has Z-coordinates of solute atoms<br>
&gt; to be restrained are set to the value of? half of the box length in<br>
&gt; Z-direction and layer like potential is applied using posre.itp with a<br>
&gt; format shown below:<br>
&gt; [ position_restraints ]<br>
&gt; ;? i funct????? g??? r??? k<br>
&gt; ?? 1??? 2????? 5??? 2.8??? 1000<br>
&gt;<br>
&gt; I would like to print instantaneous force acting on the wall due to<br>
&gt; solute atoms while running a simulation. I guess that forces are<br>
&gt; calculated in &quot;position-restraints.cpp&quot; file and Line 293 gives the<br>
&gt; total force acting on the wall for layer-like flat bottom potential.<br>
&gt;<br>
&gt; for (m = 0; (m &lt; DIM); m++)<br>
&gt; ??????? {<br>
&gt; ??????????? f[ai][m]?? += fm[m];<br>
&gt; ??????????? /* Here we correct for the pbc_dx which included rdist */<br>
&gt; ??????????? vir_diag[m] -= 0.5*(dx[m] + rdist[m])*fm[m];<br>
&gt; ??????? }<br>
&gt;<br>
&gt; Please, any guidance to implement printing of instantaneous forces<br>
&gt; will be really helpful.<br>
&gt; Thanks in advance.<br>
&gt;<br>
&gt; (PS: I am sorry if this is answered previously, but I am unable to<br>
&gt; find the similar discussions in archived threads.)<br>
&gt;<br>
<br>
I wouldn&#39;t bother trying to hack the GROMACS source, just re-compute the<br>
force due to the restraint after the simulation, based on the<br>
z-coordinate over time. Extract the z-coordinates with gmx traj and<br>
post-process the frames with whatever code you like. It&#39;s a simple<br>
calculation.<br>
<br>
-Justin<br>
<br>
&gt;<br>
&gt; Best Regards,<br>
&gt; Mandar Kulkarni<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
--<br>
==============================<wbr>====================<br>
<br>
Justin A. Lemkul, Ph.D.<br>
Assistant Professor<br>
Virginia Tech Department of Biochemistry<br>
<br>
303 Engel Hall<br>
340 West Campus Dr.<br>
Blacksburg, VA 24061<br>
<br>
<a href="mailto:jalemkul@vt.edu">jalemkul@vt.edu</a> | (540) 231-3129<br>
<a href="http://www.biochem.vt.edu/people/faculty/JustinLemkul.html" rel="noreferrer" target="_blank">http://www.biochem.vt.edu/<wbr>people/faculty/JustinLemkul.<wbr>html</a><br>
<br>
==============================<wbr>====================<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20171116/fb29531e/attachment-0001.html" rel="noreferrer" target="_blank">http://maillist.sys.kth.se/<wbr>pipermail/gromacs.org_gmx-<wbr>developers/attachments/<wbr>20171116/fb29531e/attachment-<wbr>0001.html</a>&gt;<br>
<br>
------------------------------<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/<wbr>Support/Mailing_Lists/GMX-<wbr>developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/<wbr>Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/<wbr>mailman/listinfo/gromacs.org_<wbr>gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@<wbr>gromacs.org</a>.<br>
<br>
End of gromacs.org_gmx-developers Digest, Vol 163, Issue 17<br>
******************************<wbr>*****************************<br>
</font></span></blockquote></div><br></div>