LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Testing radial distribution function (rdf) calculation results

# Re: [lammps-users] Testing radial distribution function (rdf) calculation results

 From: Axel Kohlmeyer Date: Wed, 22 Nov 2017 18:19:40 -0500

On Wed, Nov 22, 2017 at 4:57 PM, Ali Morshedi wrote:
Sorry, I sent the mail accidentally half done before. The complete version:

Dear all,

My own rdf calculations show different results from lammps. Here is a simple test case:

I have 4 atoms at positions x=[1,2,3,4] and y=0 z=0 for all.
box dimensions so that we have no pbc contribution:
-5   10     xlo  xhi
-5    5      ylo  yhi
-5    5      zlo  zhi
we have vol=1500 and number density is: rho=4/1500
If rmax=1.5 and nbin=2  --> rbin=0.75.

The relative number density for each bin and each atom:
0   30.3152
0   60.6305
0   60.6305
0   30.3152
where the columns correspond to bins and rows to atoms. The mean for the second bin: 45.4728

using:
compute 1 all rdf 2
fix 2 all ave/time 1 1 1 c_1[*] file tmp.rdf mode vector

Lammps gives:

# Time-averaged data for fix 2
# TimeStep Number-of-rows
# Row c_1[1] c_1[2] c_1[3]
0 2
1 0.375 0 0
2 1.125 60.6305 1.5

(60.635=~45.4728) As you can see, it's as if lammps is not considering the first and last atoms and is computing the average for two atoms. The coordination number is correct however.

​that is self-inflicted, since your pair style cutoff is 1.5, thus compute rdf will also use that as a cutoff.

axel.

I'm attaching the runfile and data file that reproduce this. I'm using 11Aug2017 version of lammps.

Thank you and best regards,
Ali

On Wed, Nov 22, 2017 at 1:35 PM, Ali Morshedi wrote:
Dear all,

My own rdf calculations show different results from lammps. Here is a simple test case:

I have 4 atoms at positions x=[1,2,3,4] and y=0 z=0 for all.
box dimensions:

Assume a large simulation box (no pbc contribution).

If rmax=1.5 and nbin=2,

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most