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> int k,kk,l;<br> real q,m,m_sum,q_sum;
<br> <br> q_sum = 0;<br> m_sum = 0;<br> for(k=k0; (k<k1); k++) {<br> kk = ma[k];<br> q_sum += atom[kk].q;<br> m_sum += atom[kk].m;<br> }<br> <br> clear_rvec(mu);<br> for(k=k0; (k<k1); k++) {<br> kk = ma[k];
<br> m = atom[kk].m;<br> q = atom[kk].q;<br> q = e2d(q-m*q_sum/m_sum);<br> for(l=0; l<DIM; l++)<br> mu[l] += q*x[kk][l];<br> }<br>************************************<br><br><br><br><div><span class="gmail_quote">
2007/3/5, Georgios Patargias <<a href="mailto:G.N.Patargias@leeds.ac.uk">G.N.Patargias@leeds.ac.uk</a>>:</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'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 <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'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'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>**********************************************