no. the com is not used in the g_dipoles.<br><br>The simplest way to use com is to replace the content of the { void mol_dip() } with the following code.<br><br>************************************<br>&nbsp; int&nbsp; k,kk,l;<br>&nbsp; real q,m,m_sum,q_sum;
<br>&nbsp; <br>&nbsp; q_sum = 0;<br>&nbsp; m_sum = 0;<br>&nbsp; for(k=k0; (k&lt;k1); k++) {<br>&nbsp;&nbsp;&nbsp; kk = ma[k];<br>&nbsp;&nbsp;&nbsp; q_sum += atom[kk].q;<br>&nbsp;&nbsp;&nbsp; m_sum += atom[kk].m;<br>&nbsp; }<br>&nbsp; <br>&nbsp; clear_rvec(mu);<br>&nbsp; for(k=k0; (k&lt;k1); k++) {<br>&nbsp;&nbsp;&nbsp; &nbsp; kk = ma[k];
<br>&nbsp;&nbsp;&nbsp; &nbsp; m = atom[kk].m;<br>&nbsp;&nbsp;&nbsp; &nbsp; q = atom[kk].q;<br>&nbsp;&nbsp;&nbsp; &nbsp; q = e2d(q-m*q_sum/m_sum);<br>&nbsp;&nbsp;&nbsp; &nbsp; for(l=0; l&lt;DIM; l++)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; mu[l] += q*x[kk][l];<br>&nbsp; }<br>************************************<br><br><br><br><div><span class="gmail_quote">
2007/3/5, Georgios Patargias &lt;<a href="mailto:G.N.Patargias@leeds.ac.uk">G.N.Patargias@leeds.ac.uk</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello<br><br>Does g_dipole take the center of mass of a molecule as the origin when<br>calculates its dipole moment?<br>If yes, is it the com at t=0 that is used or is it re-calculated for every frame?<br><br>I had look at the source code but it wasn&#39;t very clear to me.
<br><br>Thank you very much in advance.<br><br>Best wishes<br>George<br><br>Dr. George Patargias<br>Polymer IRC Group<br>University of Leeds<br>Leeds, LS2 9JT, UK<br><br>_______________________________________________<br>
gmx-users mailing list&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:gmx-users@gromacs.org">gmx-users@gromacs.org</a><br><a href="http://www.gromacs.org/mailman/listinfo/gmx-users">http://www.gromacs.org/mailman/listinfo/gmx-users</a><br>Please don&#39;t post (un)subscribe requests to the list. Use the
<br>www interface or send it to <a href="mailto:gmx-users-request@gromacs.org">gmx-users-request@gromacs.org</a>.<br>Can&#39;t post? Read <a href="http://www.gromacs.org/mailing_lists/users.php">http://www.gromacs.org/mailing_lists/users.php
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Sincerely yours,<br>**********************************************<br>Baofu Qiao, PhD<br>Frankfurt Institute for Advanced Studies<br>Max-von-Laue-Str. 1<br>60438 Frankfurt am Main, Germany TEL:+49-69-7984-7529
<br>**********************************************