LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

### fix rdf command

Syntax:

    fix ID group-ID rdf N file Nbin itype1 jtype1 itype2 jtype2 ...

- ID, group-ID are documented in fix command
- rdf = style name of this fix command
- N = compute radial distribution function (RDF) every this many timesteps
- file = filename to write radial distribution function info to
- Nbin = number of RDF bins
- itypeN = central atom type for RDF pair N
- jtypeN = distribution atom type for RDF pair N

Examples:

    fix 1 all rdf 500 rdf.out 100 1 1
    fix 1 fluid rdf 10000 rdf.out 100 1 1 1 2 2 1 2 2

Description:

Compute the radial distribution function (RDF), also known as g(r), and coordination number every N steps. The RDF for each specified atom type pair is histogrammed in Nbin bins from distance 0 to Rc, where Rc = the maximum force cutoff for any pair of atom types. An atom pair only contributes to the RDF if

- both atoms are in the fix group
- the distance between them is within the maximum force cutoff
- their interaction is stored in the neighbor list

Bonded atoms (1-2, 1-3, 1-4 interactions within a molecular topology) with a pairwise weighting factor of 0.0 are not included in the RDF; pairs with a non-zero weighting factor are included. The weighting factor is set by the special_bonds command.

The RDF statistics for each timestep are written to the specified file, as are the RDF values averaged over all timesteps.

Restart, fix_modify, output, run start/stop, minimize info:

No information about this fix is written to binary restart files. None of the fix_modify options are relevant to this fix. No global scalar or vector or per-atom quantities are stored by this fix for access by various output commands. No parameter of this fix can be used with the start/stop keywords of the run command. This fix is not invoked during energy minimization.

Restrictions:

The RDF is not computed for distances longer than the force cutoff, since processors (in parallel) don't know atom coordinates for atoms further away than that distance. If you want an RDF for larger r, you'll need to post-process a dump file.

Related commands:

pair_style

Default: none