<br><font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">while tuning the force kernels for BlueGene
I stumbled across the following.</font>
<br>
<br><font size=2 face="sans-serif">The C (also Fortran) code generated
by mknb for calculating the Buckingham potential is the following:</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; rinvsq = rinv * rinv</font>
<br><font size=2 face="sans-serif">&nbsp; br = cexp2 * rsq * rinv</font>
<br><font size=2 face="sans-serif">&nbsp; Vvdwexp = cexp1 * exp (-br) </font>
<br><font size=2 face="sans-serif">&nbsp; Vvdw6 = C6 / (rinvsq*rinvsq*rinvsq)</font>
<br><font size=2 face="sans-serif">&nbsp; fscal = (br * Vvdwexp - 6.0 *
Vvdw6) * rinvsq;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; fx = dx * fscal</font>
<br><font size=2 face="sans-serif">&nbsp; fy = dy * fscal</font>
<br><font size=2 face="sans-serif">&nbsp; fz = dz * fscal</font>
<br>
<br><font size=2 face="sans-serif">This does not look right to me, because
the br * Vvdwexp part in the calculation of</font>
<br><font size=2 face="sans-serif">fscal should only be scaled by rinv
and not rinvsq as deduced by following calculation:</font>
<br>
<br><font size=2 face="sans-serif">The Buckingham potential is defined
by the following form:</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; V(r) = &nbsp; C1 * exp ( - C2
* r) - &nbsp;C6 / r**6</font>
<br>
<br><font size=2 face="sans-serif">The force on particle 1 is calculated
by the formula:</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; Fx = - &nbsp;dx / r &nbsp;* &nbsp;d/dr
V(r)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;-dx
/ r &nbsp;* { - C1*C2*r * exp( -C2 * r) &nbsp;+ 6.0 * C6 / r**7 }</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp;= -dx * &nbsp;{
1/r**2 &nbsp;* 6.0 * C6 / r**6 &nbsp;+ 1/r * br * C1 * exp (-C2 * r) }</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp;= -dx * {
rinvsq * 6.0 * Vvdw6 &nbsp;+ rinv * br * Vvdwexp }</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; != -dx * rinvsq
* { 6.0 * Vvdw6 &nbsp;+ br * Vvdwexp }</font>
<br>
<br><font size=2 face="sans-serif">Am I making a mistake here or is the
GROMACS code wrong ?</font>
<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>