Page MenuHomec4science

pair_modify.html
No OneTemporary

File Metadata

Created
Tue, Nov 19, 11:26

pair_modify.html

<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>pair_modify command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>pair_modify keyword values ...
</PRE>
<UL><LI>one or more keyword/value pairs may be listed
<LI>keyword = <I>pair</I> or <I>shift</I> or <I>mix</I> or <I>table</I> or <I>table/disp</I> or <I>tabinner</I> or <I>tabinner/disp</I> or <I>tail</I> or <I>compute</I>
<PRE> <I>pair</I> values = sub-style N <I>special</I> which wt1 wt2 wt3
sub-style = sub-style of <A HREF = "pair_hybrid.html">pair hybrid</A>
N = which instance of sub-style (only if sub-style is used multiple times)
<I>special</I> which wt1 wt2 wt3 = override <I>special_bonds</I> settings (optional)
which = <I>lj/coul</I> or <I>lj</I> or <I>coul</I>
w1,w2,w3 = 1-2, 1-3, and 1-4 weights from 0.0 to 1.0 inclusive
<I>mix</I> value = <I>geometric</I> or <I>arithmetic</I> or <I>sixthpower</I>
<I>shift</I> value = <I>yes</I> or <I>no</I>
<I>table</I> value = N
2^N = # of values in table
<I>table/disp</I> value = N
2^N = # of values in table
<I>tabinner</I> value = cutoff
cutoff = inner cutoff at which to begin table (distance units)
<I>tabinner/disp</I> value = cutoff
cutoff = inner cutoff at which to begin table (distance units)
<I>tail</I> value = <I>yes</I> or <I>no</I>
<I>compute</I> value = <I>yes</I> or <I>no</I>
</PRE>
</UL>
<P><B>Examples:</B>
</P>
<P>pair_modify shift yes mix geometric
pair_modify tail yes
pair_modify table 12
pair_modify pair lj/cut compute no
pair_modify pair lj/cut/coul/long 1 special lj/coul 0.0 0.0 0.0:pre
</P>
<P><B>Description:</B>
</P>
<P>Modify the parameters of the currently defined pair style. Not all
parameters are relevant to all pair styles.
</P>
<P>If used, the <I>pair</I> keyword must appear first in the list of keywords.
It can only be used with the <A HREF = "pair_hybrid.html">hybrid and
hybrid/overlay</A> pair styles. It means that all the
following parameters will only be modified for the specified
sub-style. If the sub-style is defined multiple times, then an
additional numeric argument <I>N</I> must also be specified, which is a
number from 1 to M where M is the number of times the sub-style was
listed in the <A HREF = "pair_hybrid.html">pair_style hybrid</A> command. The extra
number indicates which instance of the sub-style the remaining
keywords will be applied to. Note that if the <I>pair</I> keyword is not
used, and the pair style is <I>hybrid</I> or <I>hybrid/overlay</I>, then all the
specified keywords will be applied to all sub-styles.
</P>
<P>The <I>special</I> keyword can only be used in conjunction with the <I>pair</I>
keyword and must directly follow it. It allows to override the
<A HREF = "special_bonds.html">special_bonds</A> settings for the specified sub-style.
More details are given below.
</P>
<P>The <I>mix</I> keyword affects pair coefficients for interactions between
atoms of type I and J, when I != J and the coefficients are not
explicitly set in the input script. Note that coefficients for I = J
must be set explicitly, either in the input script via the
"pair_coeff" command or in the "Pair Coeffs" section of the <A HREF = "read_data.html">data
file</A>. For some pair styles it is not necessary to
specify coefficients when I != J, since a "mixing" rule will create
them from the I,I and J,J settings. The pair_modify <I>mix</I> value
determines what formulas are used to compute the mixed coefficients.
In each case, the cutoff distance is mixed the same way as sigma.
</P>
<P>Note that not all pair styles support mixing. Also, some mix options
are not available for certain pair styles. See the doc page for
individual pair styles for those restrictions. Note also that the
<A HREF = "pair_coeff.html">pair_coeff</A> command also can be to directly set
coefficients for a specific I != J pairing, in which case no mixing is
performed.
</P>
<P>mix <I>geometric</I>
</P>
<PRE>epsilon_ij = sqrt(epsilon_i * epsilon_j)
sigma_ij = sqrt(sigma_i * sigma_j)
</PRE>
<P>mix <I>arithmetic</I>
</P>
<PRE>epsilon_ij = sqrt(epsilon_i * epsilon_j)
sigma_ij = (sigma_i + sigma_j) / 2
</PRE>
<P>mix <I>sixthpower</I>
</P>
<PRE>epsilon_ij = (2 * sqrt(epsilon_i*epsilon_j) * sigma_i^3 * sigma_j^3) /
(sigma_i^6 + sigma_j^6)
sigma_ij = ((sigma_i**6 + sigma_j**6) / 2) ^ (1/6)
</PRE>
<P>The <I>shift</I> keyword determines whether a Lennard-Jones potential is
shifted at its cutoff to 0.0. If so, this adds an energy term to each
pairwise interaction which will be included in the thermodynamic
output, but does not affect pair forces or atom trajectories. See the
doc page for individual pair styles to see which ones support this
option.
</P>
<P>The <I>table</I> and <I>table/disp</I> keywords apply to pair styles with a
long-range Coulombic term or long-range dispersion term respectively;
see the doc page for individual styles to see which potentials support
these options. If N is non-zero, a table of length 2^N is
pre-computed for forces and energies, which can shrink their
computational cost by up to a factor of 2. The table is indexed via a
bit-mapping technique <A HREF = "#Wolff">(Wolff)</A> and a linear interpolation is
performed between adjacent table values. In our experiments with
different table styles (lookup, linear, spline), this method typically
gave the best performance in terms of speed and accuracy.
</P>
<P>The choice of table length is a tradeoff in accuracy versus speed. A
larger N yields more accurate force computations, but requires more
memory which can slow down the computation due to cache misses. A
reasonable value of N is between 8 and 16. The default value of 12
(table of length 4096) gives approximately the same accuracy as the
no-table (N = 0) option. For N = 0, forces and energies are computed
directly, using a polynomial fit for the needed erfc() function
evaluation, which is what earlier versions of LAMMPS did. Values
greater than 16 typically slow down the simulation and will not
improve accuracy; values from 1 to 8 give unreliable results.
</P>
<P>The <I>tabinner</I> and <I>tabinner/disp</I> keywords set an inner cutoff above
which the pairwise computation is done by table lookup (if tables are
invoked), for the corresponding Coulombic and dispersion tables
discussed with the <I>table</I> and <I>table/disp</I> keywords. The smaller the
cutoff is set, the less accurate the table becomes (for a given number
of table values), which can require use of larger tables. The default
cutoff value is sqrt(2.0) distance units which means nearly all
pairwise interactions are computed via table lookup for simulations
with "real" units, but some close pairs may be computed directly
(non-table) for simulations with "lj" units.
</P>
<P>When the <I>tail</I> keyword is set to <I>yes</I>, certain pair styles will add
a long-range VanderWaals tail "correction" to the energy and pressure.
These corrections are bookkeeping terms which do not affect dynamics,
unless a constant-pressure simulation is being performed. See the doc
page for individual styles to see which support this option. These
corrections are included in the calculation and printing of
thermodynamic quantities (see the <A HREF = "thermo_style.html">thermo_style</A>
command). Their effect will also be included in constant NPT or NPH
simulations where the pressure influences the simulation box
dimensions (e.g. the <A HREF = "fix_nh.html">fix npt</A> and <A HREF = "fix_nh.html">fix nph</A>
commands). The formulas used for the long-range corrections come from
equation 5 of <A HREF = "#Sun">(Sun)</A>.
</P>
<P>IMPORTANT NOTE: The tail correction terms are computed at the
beginning of each run, using the current atom counts of each atom
type. If atoms are deleted (or lost) or created during a simulation,
e.g. via the <A HREF = "fix_gcmc.html">fix gcmc</A> command, the correction factors
are not re-computed. If you expect the counts to change dramatically,
you can break a run into a series of shorter runs so that the
correction factors are re-computed more frequently.
</P>
<P>Several additional assumptions are inherent in using tail corrections,
including the following:
</P>
<UL><LI>The simulated system is a 3d bulk homogeneous liquid. This option
should not be used for systems that are non-liquid, 2d, have a slab
geometry (only 2d periodic), or inhomogeneous.
<LI>G(r), the radial distribution function (rdf), is unity beyond the
cutoff, so a fairly large cutoff should be used (i.e. 2.5 sigma for an
LJ fluid), and it is probably a good idea to verify this assumption by
checking the rdf. The rdf is not exactly unity beyond the cutoff for
each pair of interaction types, so the tail correction is necessarily
an approximation.
<P>The tail corrections are computed at the beginning of each simulation
run. If the number of atoms changes during the run, e.g. due to atoms
leaving the simulation domain, or use of the <A HREF = "fix_gcmc.html">fix gcmc</A>
command, then the corrections are not updates to relect the changed
atom count. If this is a large effect in your simulation, you should
break the long run into several short runs, so that the correction
factors are re-computed multiple times.
</P>
<LI>Thermophysical properties obtained from calculations with this option
enabled will not be thermodynamically consistent with the truncated
force-field that was used. In other words, atoms do not feel any LJ
pair interactions beyond the cutoff, but the energy and pressure
reported by the simulation include an estimated contribution from
those interactions.
</UL>
<P>The <I>compute</I> keyword allows pairwise computations to be turned off,
even though a <A HREF = "pair_style.html">pair_style</A> is defined. This is not
useful for running a real simulation, but can be useful for debugging
purposes or for performing a <A HREF = "rerun.html">rerun</A> simulation, when you
only wish to compute partial forces that do not include the pairwise
contribution.
</P>
<P>Two examples are as follows. First, this option allows you to perform
a simulation with <A HREF = "pair_hybrid.html">pair_style hybrid</A> with only a
subset of the hybrid sub-styles enabled. Second, this option allows
you to perform a simulation with only long-range interactions but no
short-range pairwise interactions. Doing this by simply not defining
a pair style will not work, because the
<A HREF = "kspace_style.html">kspace_style</A> command requires a Kspace-compatible
pair style be defined.
</P>
<HR>
<H5>Use of <I>special</I> keyword
</H5>
<P>The <I>special</I> keyword allows to override the 1-2, 1-3, and 1-4
exclusion settings for individual sub-styles of a
<A HREF = "pair_hybrid.html">hybrid pair style</A>. It requires 4 arguments similar
to the <A HREF = "special_bonds.html">special_bonds</A> command, <I>which</I> and
wt1,wt2,wt3. The <I>which</I> argument can be <I>lj</I> to change the
Lennard-Jones settings, <I>coul</I> to change the Coulombic settings,
or <I>lj/coul</I> to change both to the same set of 3 values. The wt1,wt2,wt3
values are numeric weights from 0.0 to 1.0 inclusive, for the 1-2,
1-3, and 1-4 bond topology neighbors, respectively. The <I>special</I>
keyword can only be used in conjunction with the <I>pair</I> keyword
and has to directly follow it.
</P>
<P>IMPORTANT NOTE: The global settings specified by the
<A HREF = "special_bonds.html">special_bonds</A> command affect the construction of
neighbor lists. Weights of 0.0 (for 1-2, 1-3, or 1-4 neighbors)
exclude those pairs from the neighbor list entirely. Weights of 1.0
store the neighbor with no weighting applied. Thus only global values
different from exactly 0.0 or 1.0 can be overridden and an error
is generated if the requested setting is not compatible with the
global setting. Substituting 1.0e-10 for 0.0 and 0.9999999999 for
1.0 is usually a sufficient workaround in this case without causing
a significant error.
</P>
<HR>
<P><B>Restrictions:</B> none
</P>
<P>You cannot use <I>shift</I> yes with <I>tail</I> yes, since those are
conflicting options. You cannot use <I>tail</I> yes with 2d simulations.
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "pair_style.html">pair_style</A>, <A HREF = "pair_coeff.html">pair_coeff</A>,
<A HREF = "thermo_style.html">thermo_style</A>
</P>
<P><B>Default:</B>
</P>
<P>The option defaults are mix = geometric, shift = no, table = 12,
tabinner = sqrt(2.0), tail = no, and compute = yes.
</P>
<P>Note that some pair styles perform mixing, but only a certain style of
mixing. See the doc pages for individual pair styles for details.
</P>
<HR>
<A NAME = "Wolff"></A>
<P><B>(Wolff)</B> Wolff and Rudd, Comp Phys Comm, 120, 200-32 (1999).
</P>
<A NAME = "Sun"></A>
<P><B>(Sun)</B> Sun, J Phys Chem B, 102, 7338-7364 (1998).
</P>
</HTML>

Event Timeline