LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

pair_coeff command

Syntax:

pair_coeff I J args 

Examples:

pair_coeff 2 2 1.0 1.0 2.5
pair_coeff 2 * 1.0 1.0 2.5
pair_coeff 3* 1*2 1.0 1.0 2.5
pair_coeff * * 1.0 1.0 2.5
pair_coeff 2 2 niu3
pair_coeff * * nialhjea 1 1 2 

Description:

Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. Pair coefficients can also be set in the data file read read_data command or in a restart file.

The one exception is that the information needed for pair style eam can only be set by the pair_coeff command. Similarly, coefficient data for pair style eam is not written to restart files (see the restart command), so a pair_coeff command must be used in the input script that reads the restart file to setup EAM potentials.

I and J can be specified in one of two ways. Explicit numeric values can be used for each, as in the 1st example above. In this case, I <= J is required. LAMMPS sets the coefficients for the symmetric J,I interaction to the same values.

A wild-card asterik can be used with the I,J arguments to set the coefficients for multiple pairs of atom types. This takes the form "*" or "*n" or "n*" or "m*n". If N = the number of atom types, then an asterik with no numeric values means all types from 1 to N. A leading asterik means all types from 1 to n (inclusive). A trailing asterik means all types from n to N (inclusive). A middle asterik means all types from m to n (inclusive). Note that only type pairs with I <= J are set; if asteriks imply type pairs where J < I, they are ignored.

Note that using 2 pair_coeff commands for the same I,J pair is perfectly valid. For example, these two commands set the coeffs for all I,J pairs, then overwrite the coeffs for just the I,J = 2,3 pair:

pair_coeff * * 1.0 1.0 2.5
pair_coeff 2 3 2.0 1.0 1.12 

A line in a data file that specifies pair coefficients uses the exact same format as the arguments of the pair_coeff command in an input script, with 2 exceptions. In a data file, wild-card asteriks cannot be used and I,J pairs are not specified. Only a single type I is specified, which sets the coefficients for type I interacting with type I. This is because in a data file, the "Pair Coeffs" section has exactly N lines, where N = the number of atom types. The coefficients for type pairs with I not equal J are inferred from the N settings by mixing rules; see the pair_modify command for a discussion. Thus in a data file, the line corresponding to the 1st example above would be listed as

2 1.0 1.0 2.5 

Here are the coefficients specified by the pair_coeff command for each pair style. Note that any cutoffs specified by these coefficients for a particular I,J pair override the global cutoff(s) specified by the pair_style command.

See the pair_style command for the formulas that use these coefficients.

For style lj/cut, specify 3 coefficients:

For style lj/cut/coul/cut, specify 3 or 4 coefficients:

The 2nd cutoff is optional. If it is not specified, cutoff1 = the LJ and Coulombic cutoff. If it is specified, cutoff1 = LJ cutoff and cutoff2 = Coulombic cutoff.

For style lj/cut/coul/long, specify 3 coefficients:

The cutoff is the LJ cutoff. You cannot specify a Coulombic cutoff for an individual I,J type pair. All type pairs use the same global Coulombic cutoff specified in the pair_style command.

For style lj/expand, specify 4 coefficients:

The delta values can be positive or negative. Note that the cutoff does not include the delta distance. I.e. the actual force cutoff is the sum of cutoff + delta.

For style soft, specify 3 coefficients:

Astart and Astop are the values of the prefactor at the start and end of the next run. At intermediate times the value of A will be ramped between these 2 values. Note that before performing a 2nd run, you will want to adjust the values of Astart and Astop for all type pairs, or switch to a new pair style.

For styles lj/charmm/coul/charmm, lj/charmm/coul/charmm/implicit, and lj/charmm/coul/long, specify 4 coefficients:

The latter 2 coefficients are optional. If they are specified, they are used in the Lennard-Jones formula between 2 atoms of these types that are first and fourth atoms in any dihedral. No cutoffs are specified because this CHARMM force field does not allow cutoffs for individual atom pairs; all pairs use the global cutoff(s) specified in the pair_style command.

For style eam, coefficients are listed in one of two forms. For single-element DYNAMO potential files, specify 1 coefficient:

The EAM fits for F, rho, phi (see the pair_style command) are read from the file and assigned to atom type(s) specified by the first two pair_coeff command arguments, for type i = j (see below for mixing discussion). Use the pair coeff command as many times as necessary to assign filenames (EAM elements) to each atom type in the LAMMPS simulation.

For multi-element DYNAMO potential files, the file contains information for M elements. These have to be mapped to LAMMPS atom types, which is done by specifying N+1 coefficients, where N is the number of atom types:

For example, the nialhjea setfl file has EAM data for 3 elements (and their alloy interactions) - Ni, Al, and H. If your LAMMPS simulation has 4 atoms types and you want the 1st 3 to be Ni, and the 4th to be Al. Then you would use the pair_coeff command:

pair_coeff * * nialhjea 1 1 1 2 

The 3 "1" values map LAMMPS atom types 1,2,3 to the 1st element (Ni) in the setfl file. The "2" value maps atom type 4 to Al. Note that you must use "* *" to cover all atom types I,J in the pair_coeff command. And you only use the pair_coeff command once to specify EAM force fields for all atom types in the LAMMPS simulation.

As these instructions imply, you cannot mix funcfl and setfl DYANMO files in the same simulation. EAM potentials are "mixed" (type I interactions with type J) by their own rules; you do not need to specify I != J interactions or use the pair_modify command's mix option.

The formats of the single-element (funcfl) and multi-element (setfl) DYNAMO files are beyond the scope of this manual. You'll have to look in the src/pair_eam.cpp file and/or the DYNAMO files themselves to figure out the format. You don't need to know what's in these files to use them, and if you intend to derive your own potentials for new materials, you'll presumably know enough about EAM potentials and DYNAMO to get started.

For styles gran/no_history, gran/history, and gran/hertzian, there are no individual atom type coefficients that can be set. All global settings are made via the pair_style command.

For style lj/cut/coul/debye, the 3 or 4 coefficients are the same as for style lj/cut/coul/cut. The kappa value specified in the pair_style command is global and is not set for individual atom type pairs.

Restrictions:

This command must come after the simulation box is defined by a read_data, read_restart, or create_box command.

Related commands:

pair_style, pair_modify, read_data, read_restart

Default: none