[gmx-developers] tabulated potential energy=nan for r=0 nm and charged atoms

chris.neale at utoronto.ca chris.neale at utoronto.ca
Mon May 9 16:54:09 CEST 2011

Dear Developers:

I find that even when tabulated potentials specify f(x)=0 and -f'(x)=0  
for x=0, I still get a coulomb(SR) energy=nan when two charges occupy  
the exact same spot.

Both the manual 4.5.4 page 151 equation 6.23 and the gromacs_nb.pdf  
tabulated potentials tutorial (  
http://www.gromacs.org/Documentation/How-tos/Tabulated_Potentials )  
indicate that setting f(x)=0 and -f'(x)=0 for x=0 should lead to an  
energy of zero in this case.

Is this a bug or a case of WYSIWYG? Can anybody offer any hints on  
where I might start searching through the source code with printf  
statements to see where the nan develops? I'm guessing there is some  
if(r>0) in the code that doesn't technically need to be there.

More information and a test system is available in my users-list post  
for which I received no responses:

Thank you very much,

More information about the gromacs.org_gmx-developers mailing list