<br><tt><font size=3>Hi David,</font></tt>
<br>
<br><tt><font size=3>sorry, I found my mistake: the factor of r in my derivate
of the exp()</font></tt>
<br><tt><font size=3>is incorrect and then the generated GROMACS code is
actually correct.</font></tt>
<br>
<br><tt><font size=3>Mathias PUETZ wrote:<br>
&gt;<i> <br>
</i>&gt;<i> Hi,<br>
</i>&gt;<i> <br>
</i>&gt;<i> while tuning the force kernels for BlueGene I stumbled across
the <br>
</i>&gt;<i> following.<br>
</i>&gt;<i> <br>
</i>&gt;<i> The C (also Fortran) code generated by mknb for calculating
the <br>
</i>&gt;<i> Buckingham potential is the following:<br>
</i>&gt;<i> <br>
</i>&gt;<i> &nbsp; rinvsq = rinv * rinv<br>
</i>&gt;<i> &nbsp; br = cexp2 * rsq * rinv<br>
</i>&gt;<i> &nbsp; Vvdwexp = cexp1 * exp (-br)<br>
</i>&gt;<i> &nbsp; Vvdw6 = C6 / (rinvsq*rinvsq*rinvsq)<br>
</i>&gt;<i> &nbsp; fscal = (br * Vvdwexp - 6.0 * Vvdw6) * rinvsq;<br>
</i>&gt;<i> <br>
</i>&gt;<i> &nbsp; fx = dx * fscal<br>
</i>&gt;<i> &nbsp; fy = dy * fscal<br>
</i>&gt;<i> &nbsp; fz = dz * fscal<br>
</i>&gt;<i> <br>
</i>&gt;<i> This does not look right to me, because the br * Vvdwexp part
in the <br>
</i>&gt;<i> calculation of<br>
</i>&gt;<i> fscal should only be scaled by rinv and not rinvsq as deduced
by <br>
</i>&gt;<i> following calculation:<br>
</i>&gt;<i> <br>
</i>&gt;<i> The Buckingham potential is defined by the following form:<br>
</i>&gt;<i> <br>
</i>&gt;<i> &nbsp; V(r) = &nbsp; C1 * exp ( - C2 * r) - &nbsp;C6 / r**6<br>
</i>&gt;<i> <br>
</i>&gt;<i> The force on particle 1 is calculated by the formula:<br>
</i>&gt;<i> <br>
</i>&gt;<i> &nbsp; Fx = - &nbsp;dx / r &nbsp;* &nbsp;d/dr V(r)<br>
</i>&gt;<i> &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;-dx / r &nbsp;* { - C1*C2*r
* exp( -C2 * r) &nbsp;+ 6.0 * C6 / r**7 }<br>
</i>&gt;<i> &nbsp; &nbsp; &nbsp; &nbsp;= -dx * &nbsp;{ 1/r**2 &nbsp;* 6.0
* C6 / r**6 &nbsp;+ 1/r * br * C1 * exp (-C2 <br>
</i>&gt;<i> * r) }<br>
</i>&gt;<i> &nbsp; &nbsp; &nbsp; &nbsp;= -dx * { rinvsq * 6.0 * Vvdw6 &nbsp;+
rinv * br * Vvdwexp }<br>
</i>&gt;<i> <br>
</i>&gt;<i> &nbsp; &nbsp; &nbsp; != -dx * rinvsq * { 6.0 * Vvdw6 &nbsp;+
br * Vvdwexp }<br>
</i>&gt;<i> <br>
</i>&gt;<i> Am I making a mistake here or is the GROMACS code wrong ?<br>
</i>&gt;<i> <br>
</i>&gt;<i> Viele Grüsse / Best regards,<br>
</i>&gt;<i> Dr. Mathias Pütz<br>
</i>&gt;<i> <br>
</i>&gt;<i> IT Specialist for Application Perfomance<br>
</i>&gt;<i> <br>
</i>&gt;<i> Deep Computing - Strategic Growth Business<br>
</i>&gt;<i> IBM Systems &amp; Technology Group<br>
</i>&gt;<i> <br>
</i>&gt;<i> e-mail: &nbsp;</i></font></tt><a href="http://www.gromacs.org/mailman/listinfo/gmx-developers"><tt><font size=3 color=blue><i><u>mpuetz
at de.ibm.com</u></i></font></tt></a><tt><font size=3><i><br>
</i>&gt;<i> mobile: + 49-(0)160-7120602<br>
</i>&gt;<i> fax: &nbsp; &nbsp; &nbsp; &nbsp; + 49-(0)6131-84-6660<br>
</i>&gt;<i> <br>
</i>&gt;<i> snailmail:<br>
</i>&gt;<i> &nbsp;IBM Deutschland GmbH<br>
</i>&gt;<i> &nbsp;Department B458<br>
</i>&gt;<i> &nbsp;Hechtsheimer Str. 2 / Building 12<br>
</i>&gt;<i> &nbsp;55131 Mainz<br>
</i>&gt;<i> &nbsp;Germany<br>
</i>&gt;<i> <br>
</i>&gt;<i> <br>
</i>&gt;<i> ------------------------------------------------------------------------<br>
</i>&gt;<i> <br>
</i>&gt;<i> _______________________________________________<br>
</i>&gt;<i> gmx-developers mailing list<br>
</i>&gt;<i> </i></font></tt><a href="http://www.gromacs.org/mailman/listinfo/gmx-developers"><tt><font size=3 color=blue><i><u>gmx-developers
at gromacs.org</u></i></font></tt></a><tt><font size=3><i><br>
</i>&gt;<i> </i></font></tt><a href="http://www.gromacs.org/mailman/listinfo/gmx-developers"><tt><font size=3 color=blue><i><u>http://www.gromacs.org/mailman/listinfo/gmx-developers</u></i></font></tt></a><tt><font size=3><i><br>
</i>&gt;<i> Please don't post (un)subscribe requests to the list. Use the
<br>
</i>&gt;<i> www interface or send it to </i></font></tt><a href="http://www.gromacs.org/mailman/listinfo/gmx-developers"><tt><font size=3 color=blue><i><u>gmx-developers-request
at gromacs.org.</u></i></font></tt></a><tt><font size=3><i><br>
</i>I think it is correct because there is an extra r in the br term.<br>
<br>
-- <br>
David.<br>
________________________________________________________________________<br>
David van der Spoel, PhD, Assoc. Prof., Molecular Biophysics group,<br>
Dept. of Cell and Molecular Biology, Uppsala University.<br>
Husargatan 3, Box 596, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; 75124 Uppsala, Sweden<br>
phone: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
46 18 471 4205 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;fax: 46 18 511 755<br>
</font></tt><a href="http://www.gromacs.org/mailman/listinfo/gmx-developers"><tt><font size=3 color=blue><u>spoel
at xray.bmc.uu.se</u></font></tt></a><tt><font size=3> &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font></tt><a href="http://www.gromacs.org/mailman/listinfo/gmx-developers"><tt><font size=3 color=blue><u>spoel
at gromacs.org</u></font></tt></a><tt><font size=3> &nbsp; </font></tt><a href=http://folding.bmc.uu.se/><tt><font size=3 color=blue><u>http://folding.bmc.uu.se</u></font></tt></a><tt><font size=3><br>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font></tt>
<br><font size=2 face="sans-serif"><br>
Viele Grüsse / Best regards,<br>
Dr. Mathias Pütz<br>
<br>
IT Specialist for Application Perfomance<br>
<br>
Deep Computing - Strategic Growth Business<br>
IBM Systems &amp; Technology Group<br>
<br>
e-mail: &nbsp;mpuetz@de.ibm.com<br>
mobile: + 49-(0)160-7120602<br>
fax: &nbsp; &nbsp; &nbsp; &nbsp; + 49-(0)6131-84-6660<br>
<br>
snailmail:<br>
 &nbsp;IBM Deutschland GmbH<br>
 &nbsp;Department B458<br>
 &nbsp;Hechtsheimer Str. 2 / Building 12<br>
 &nbsp;55131 Mainz<br>
 &nbsp;Germany<br>
</font>