<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>
><i> <br>
</i>><i> Hi,<br>
</i>><i> <br>
</i>><i> while tuning the force kernels for BlueGene I stumbled across
the <br>
</i>><i> following.<br>
</i>><i> <br>
</i>><i> The C (also Fortran) code generated by mknb for calculating
the <br>
</i>><i> Buckingham potential is the following:<br>
</i>><i> <br>
</i>><i> rinvsq = rinv * rinv<br>
</i>><i> br = cexp2 * rsq * rinv<br>
</i>><i> Vvdwexp = cexp1 * exp (-br)<br>
</i>><i> Vvdw6 = C6 / (rinvsq*rinvsq*rinvsq)<br>
</i>><i> fscal = (br * Vvdwexp - 6.0 * Vvdw6) * rinvsq;<br>
</i>><i> <br>
</i>><i> fx = dx * fscal<br>
</i>><i> fy = dy * fscal<br>
</i>><i> fz = dz * fscal<br>
</i>><i> <br>
</i>><i> This does not look right to me, because the br * Vvdwexp part
in the <br>
</i>><i> calculation of<br>
</i>><i> fscal should only be scaled by rinv and not rinvsq as deduced
by <br>
</i>><i> following calculation:<br>
</i>><i> <br>
</i>><i> The Buckingham potential is defined by the following form:<br>
</i>><i> <br>
</i>><i> V(r) = C1 * exp ( - C2 * r) - C6 / r**6<br>
</i>><i> <br>
</i>><i> The force on particle 1 is calculated by the formula:<br>
</i>><i> <br>
</i>><i> Fx = - dx / r * d/dr V(r)<br>
</i>><i> = -dx / r * { - C1*C2*r
* exp( -C2 * r) + 6.0 * C6 / r**7 }<br>
</i>><i> = -dx * { 1/r**2 * 6.0
* C6 / r**6 + 1/r * br * C1 * exp (-C2 <br>
</i>><i> * r) }<br>
</i>><i> = -dx * { rinvsq * 6.0 * Vvdw6 +
rinv * br * Vvdwexp }<br>
</i>><i> <br>
</i>><i> != -dx * rinvsq * { 6.0 * Vvdw6 +
br * Vvdwexp }<br>
</i>><i> <br>
</i>><i> Am I making a mistake here or is the GROMACS code wrong ?<br>
</i>><i> <br>
</i>><i> Viele Grüsse / Best regards,<br>
</i>><i> Dr. Mathias Pütz<br>
</i>><i> <br>
</i>><i> IT Specialist for Application Perfomance<br>
</i>><i> <br>
</i>><i> Deep Computing - Strategic Growth Business<br>
</i>><i> IBM Systems & Technology Group<br>
</i>><i> <br>
</i>><i> e-mail: </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>><i> mobile: + 49-(0)160-7120602<br>
</i>><i> fax: + 49-(0)6131-84-6660<br>
</i>><i> <br>
</i>><i> snailmail:<br>
</i>><i> IBM Deutschland GmbH<br>
</i>><i> Department B458<br>
</i>><i> Hechtsheimer Str. 2 / Building 12<br>
</i>><i> 55131 Mainz<br>
</i>><i> Germany<br>
</i>><i> <br>
</i>><i> <br>
</i>><i> ------------------------------------------------------------------------<br>
</i>><i> <br>
</i>><i> _______________________________________________<br>
</i>><i> gmx-developers mailing list<br>
</i>><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>><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>><i> Please don't post (un)subscribe requests to the list. Use the
<br>
</i>><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,
75124 Uppsala, Sweden<br>
phone:
46 18 471 4205
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>
</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> </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 & Technology Group<br>
<br>
e-mail: mpuetz@de.ibm.com<br>
mobile: + 49-(0)160-7120602<br>
fax: + 49-(0)6131-84-6660<br>
<br>
snailmail:<br>
IBM Deutschland GmbH<br>
Department B458<br>
Hechtsheimer Str. 2 / Building 12<br>
55131 Mainz<br>
Germany<br>
</font>