compute rdf command
Syntax
compute ID group-ID rdf Nbin itype1 jtype1 itype2 jtype2 ... keyword/value ...
ID, group-ID are documented in compute command
rdf = style name of this compute command
Nbin = number of RDF bins
itypeN = central atom type for Nth RDF histogram (integer, type label, or asterisk form)
jtypeN = distribution atom type for Nth RDF histogram (integer, type label, or asterisk form)
zero or more keyword/value pairs may be appended
keyword = cutoff
cutoff value = Rcut Rcut = cutoff distance for RDF computation (distance units)
Examples
compute 1 all rdf 100
compute 1 all rdf 100 1 1
compute 1 all rdf 100 * 3 cutoff 5.0
compute 1 fluid rdf 500 1 1 1 2 2 1 2 2
compute 1 fluid rdf 500 1*3 2 5 *10 cutoff 3.5
Description
Define a computation that calculates the radial distribution function
(RDF), also called
Note
If you have a bonded system, then the settings of
special_bonds command can remove pairwise
interactions between atoms in the same bond, angle, or dihedral. This
is the default setting for the special_bonds
command, and means those pairwise interactions do not appear in the
neighbor list. Because this fix uses a neighbor list, it also means
those pairs will not be included in the RDF. This does not apply when
using long-range coulomb interactions (coul/long, coul/msm,
coul/wolf or similar. One way to get around this would be to set
special_bond scaling factors to very tiny numbers that are not exactly
zero (e.g.,
By default the RDF is computed out to the maximum force cutoff defined
by the pair_style command. If the cutoff keyword
is used, then the RDF is computed accurately out to the Rcut
Note
Normally, you should only use the cutoff keyword if no pair
style is defined (e.g., the rerun command is being used to
post-process a dump file of snapshots) or if you really want the RDF
for distances beyond the pair_style force cutoff and cannot easily
post-process a dump file to calculate it. This is because using the
cutoff keyword incurs extra computation and possibly communication,
which may slow down your simulation. If you specify Rcut
The itypeN and jtypeN arguments are optional. These arguments
must come in pairs. If no pairs are listed, then a single histogram
is computed for
The itypeN and jtypeN settings can be specified in one of three
ways. One or both of the types in the I,J pair can be a
type label. Or an explicit numeric value can be
used, as in the fourth example above. Or a wild-card asterisk can be used
to specify a range of atom types. This takes the form “*” or “*n” or
“m*” or “m*n”. If
If both itypeN and jtypeN are single values, as in the fourth example
above, this means that a
Pairwise distances are generated by looping over a pairwise neighbor
list, just as they would be in a pair_style
computation. The distance between two atoms
atoms
and are both in the specified compute groupthe distance between atoms
and is less than the maximum force cutoffthe type of the
atom matches itypeN (one or a range of types)the type of the
atom matches jtypeN (one or a range of types)
It is OK if a particular pairwise distance is included in more than one individual histogram, due to the way the itypeN and jtypeN arguments are specified.
The
A coordination number
The simplest way to output the results of the compute rdf calculation to a file is to use the fix ave/time command, for example:
compute myRDF all rdf 50
fix 1 all ave/time 100 1 100 c_myRDF[*] file tmp.rdf mode vector
Output info
This compute calculates a global array in which the number of rows is
Nbins and the number of columns is
The array values calculated by this compute are all “intensive”.
The first column of array values will be in distance
units. The
Restrictions
By default, the RDF is not computed for distances longer than the largest force cutoff, since the neighbor list creation will only contain pairs up to that distance (plus neighbor list skin). This distance can be increased using the cutoff keyword but this keyword is only valid with neighbor styles ‘bin’ and ‘nsq’.
If you want an RDF for larger distances, you can also use the rerun command to post-process a dump file, use pair style zero and set the force cutoff to be longer in the rerun script. Note that in the rerun context, the force cutoff is arbitrary and with pair style zero you are not computing any forces, and you are not running dynamics you are not changing the model that generated the trajectory.
The definition of
Note
compute rdf can handle dynamic groups and systems where atoms are added or removed, but this causes that certain normalization parameters need to be re-computed in every step and include collective communication operations. This will reduce performance and limit parallel efficiency and scaling. For systems, where only the type of atoms changes (e.g., when using fix atom/swap), you need to explicitly request the dynamic normalization updates via compute_modify dynamic/dof yes
Default
The keyword defaults are cutoff = 0.0 (use the pairwise force cutoff).