RDF
go back to Main Page, Computational Resources, Scripts, VASP, Núria López and Group, Scripts for VASP
Description
This program computes the Radial Distribution Function (RDF) for a given system, being it a single geometry, an optimization, or a dynamics. For more infos about what the RDF is, please check: [1].
Setting up the program
First, we download the following file:
Tar/zipped directory ==> File:RDF.tgz
and we untar and unzip it with the following command:
user@computer: tar -xvzf RDF.tgz
A directory called ( quite unoriginally ¬¬ ) "RDF" will appear in your current directory. You enter the directory and do the following commands:
user@computer: a=`ls *.f` user@computer: f95 $a -o x.RDF [NOTE: if you don't have f95, try using ifort or g95, otherwise download and install a proper compiler for the program.]
The program is now ready.
Input file: preparation
Two inputs are parsed by the program to compute the radial distribution function: Movie.xyz and param.dat.
Movie.xyz
This is the xyz format file with your geometry/geometries. It is in standard xyz format; if you have an OUTCAR/CONTCAR/POSCAR, translate it in xyz, with the script ngeom.sh for example (link: ngeom.sh).
param.dat
In param.dat I specify how many and what kind of RDF I want, between which atoms, if it is BI- or TRI-dimensional RDF, and other details.
Example:
Please find above an example of the param.dat, with a short description of the keywords. Don't worry, is much easier than it seems at first sight.
In the directory you unzipped there is already a param.dat file, so you have just to modify it.
NOTE: in param.dat, you can insert data unformatted by columns: the program x.RDF does not care. Nevertheless, the number of the rows and blank lines have to be respected.
So, for example, you could have:
[input 1]
# nCat nTyp dR dZ ....
1 2 0.08 1.5 ...
[blank]
# Cell costant and lattice vectors...
or
[input 2]
# nCat nTyp dR dZ .... 1 2 0.08 1.5 ... <== Format of the second line different from the [input 1] [blank] # Cell costant and lattice vectors...
They are both ok.
YOU CANNOT HAVE:
[input 3]
# nCat nTyp dR dZ ....
1 2 0.08 1.5 ...
[blank]
[blank] <== One more [blank] than needed!!
# Cell costant and lattice vectors...
or
[input 4]
<== Missing the first commented first line!!
1 2 0.08 1.5 ...
[blank]
# Cell costant and lattice vectors...
param.dat: detailed examination
I will examine this file, row by row (excluding the blank lines, important only for aesthetic reasons).
1st row: commented. This is not read by x.RDF, but it is important for the user because specifies which parameters we want to use for the RDF calculation.
2nd row
nCat: number of categories I want to compute. This is basically the number of different RDF I want to calculate. For example, if I have a dynamics with water, I can be interested in
the calculation of RDF between the oxygens, and between oxygens and hydrogens: in this case, nCat = 2.
nTyp: number of different species of atoms. For example, if I have specified Pt H O C H O in row 9 (see below), nTyp = 6.
dR: step of the grid (in angstrom) on which I compute the RDF. If, by definition, RDF is the normalized number of atoms between R and R+dR, this dR is the theoretical dR.
dZ: only used for 2D-RDF. Specified as an initial guess for the distribution of layers. It tells roughly the height of each layer on which compute the 2D-RDF.
ncyc: number of geometries in the file Movie.xyz. If you have just one snapshot, put 1.
DN: it tells x.RDF after how many snapshot you want to compute a new RDF. The initial RDF is always computed. For example, if you have a dynamics with 150 fs, you could ask the
program to print the RDF every 30 fs (DN = 30). In this case, you would have 6 output files: (1) for the initial RDF, (2) at 30 fs, (3) at 60 fs, (4) at 90 fs, (5) at 120 fs,
and (6) at 150 fs.
rcut: cut-off radius (in angstrom) for the RDF. Basically, I will not compute the RDF of one atom with any other more than rcut angstrom away.
dimensionality: if specifies if I want a BI-dimensional (dimensionality=2) or TRI-dimensional (dimensionality=3) RDF.
4th row: commented. This is not read by x.RDF, but it is important for the user because specifies which parameters we want to use for the RDF calculation.
5th-10th rows: classical POSCAR/CONTCAR lines. Lattice constant (5th), lattice vectors (6th-8th), species (9th) and how many atoms per species (10th).
12th row: commented. This is not read by x.RDF, but it is important for the user because specifies which parameters we want to use for the RDF calculation.
13th-xxth row: in this line, I specify the two groups between which I want to compute the RDF. Please, notice that the number of lines depends on the variable nCat (line 2). For example,
in the case of water, if I want to compute RDF between oxygens (RDF(OO)), between oxygens and hydrogens (RDF(OH)), and between hydrogens (RDF(HH)), I have to specify nCat = 3 in
the 2nd line, and you will have a line 13 where you specify the two groups of oxygen, a line 14 where you specify the group of oxygen and the group of hydrogen, and a line 15
where you specify a group of hydrogens and the group of hydrogens.