From: Axel Kohlmeyer (
Date: Tue Jul 22 2008 - 17:06:30 CDT

On Tue, 22 Jul 2008, Valeria Molinero wrote:

VM> Hello,

hi vale,

VM> I am trying to compute the radial distribution function for a big system
VM> (more than 100,000 particles, typically 0.25 million)
VM> and found that the calculation proceeds but the result is definitely wrong:
VM> the g(r) does not go to 1 at long distances but
VM> to a negative number.

there is a ton of possible reasons for that.
it depends a lot on the settings you use.

VM> Is this a bug or a memory issue that can be fixed in some way?

there were a few minor bugs in the implementation that can be
avoided by using a small bin size. i've fixed them since and
if you download a recent alpha test version for the next VMD
release, gofr calculations should work fine.

if you still have problems, i'd appreciate it, if you could
make some of your problematic data files available to me and
describe what settings you were using.

VM> I appreciate your help,
VM> Vale
VM> ps: where can I find the algorithm that vmd uses to compute the rdf? it is
VM> much faster than my naive implementations.

actually, there is still a _lot_ of room for improvement to the
code (e.g. using grid-searches, parallelization, CUDA port) to
make it even faster. in any case the implementation is part of
the VMD source code. i also have an older implementation
that is a simple TCL plugin (written in C) which could potentially
be tuned for your needs.



Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.