1.. index:: special_bonds
2
3special_bonds command
4=====================
5
6Syntax
7""""""
8
9.. code-block:: LAMMPS
10
11   special_bonds keyword values ...
12
13* one or more keyword/value pairs may be appended
14* keyword = *amber* or *charmm* or *dreiding* or *fene* or *lj/coul* or *lj* or *coul* or *angle* or *dihedral*
15
16  .. parsed-literal::
17
18       *amber* values = none
19       *charmm* values = none
20       *dreiding* values = none
21       *fene* values = none
22       *lj/coul* values = w1,w2,w3
23         w1,w2,w3 = weights (0.0 to 1.0) on pairwise Lennard-Jones and Coulombic interactions
24       *lj* values = w1,w2,w3
25         w1,w2,w3 = weights (0.0 to 1.0) on pairwise Lennard-Jones interactions
26       *coul* values = w1,w2,w3
27         w1,w2,w3 = weights (0.0 to 1.0) on pairwise Coulombic interactions
28       *angle* value = *yes* or *no*
29       *dihedral* value = *yes* or *no*
30
31Examples
32""""""""
33
34.. code-block:: LAMMPS
35
36   special_bonds amber
37   special_bonds charmm
38   special_bonds fene dihedral no
39   special_bonds lj/coul 0.0 0.0 0.5 angle yes dihedral yes
40   special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 0.0 dihedral yes
41
42Description
43"""""""""""
44
45Set weighting coefficients for pairwise energy and force contributions
46between pairs of atoms that are also permanently bonded to each other,
47either directly or via one or two intermediate bonds.  These weighting
48factors are used by nearly all :doc:`pair styles <pair_style>` in LAMMPS
49that compute simple pairwise interactions.  Permanent bonds between
50atoms are specified by defining the bond topology in the data file
51read by the :doc:`read_data <read_data>` command.  Typically a
52:doc:`bond_style <bond_style>` command is also used to define a bond
53potential.  The rationale for using these weighting factors is that
54the interaction between a pair of bonded atoms is all (or mostly)
55specified by the bond, angle, dihedral potentials, and thus the
56non-bonded Lennard-Jones or Coulombic interaction between the pair of
57atoms should be excluded (or reduced by a weighting factor).
58
59.. note::
60
61   These weighting factors are NOT used by :doc:`pair styles <pair_style>` that compute many-body interactions, since the
62   "bonds" that result from such interactions are not permanent, but are
63   created and broken dynamically as atom conformations change.  Examples
64   of pair styles in this category are EAM, MEAM, Stillinger-Weber,
65   Tersoff, COMB, AIREBO, and ReaxFF.  In fact, it generally makes no
66   sense to define permanent bonds between atoms that interact via these
67   potentials, though such bonds may exist elsewhere in your system,
68   e.g. when using the :doc:`pair_style hybrid <pair_hybrid>` command.
69   Thus LAMMPS ignores special_bonds settings when many-body potentials
70   are calculated.  Please note, that the existence of explicit bonds
71   for atoms that are described by a many-body potential will alter the
72   neighbor list and thus can render the computation of those interactions
73   invalid, since those pairs are not only used to determine direct
74   pairwise interactions but also neighbors of neighbors and more.
75   The recommended course of action is to remove such bonds, or - if
76   that is not possible - use a special bonds setting of 1.0 1.0 1.0.
77
78.. note::
79
80   Unlike some commands in LAMMPS, you cannot use this command
81   multiple times in an incremental fashion: e.g. to first set the LJ
82   settings and then the Coulombic ones.  Each time you use this command
83   it sets all the coefficients to default values and only overrides the
84   one you specify, so you should set all the options you need each time
85   you use it.  See more details at the bottom of this page.
86
87The Coulomb factors are applied to any Coulomb (charge interaction)
88term that the potential calculates.  The LJ factors are applied to the
89remaining terms that the potential calculates, whether they represent
90LJ interactions or not.  The weighting factors are a scaling
91pre-factor on the energy and force between the pair of atoms.  A value
92of 1.0 means include the full interaction; a value of 0.0 means
93exclude it completely.
94
95The first of the 3 coefficients (LJ or Coulombic) is the weighting
96factor on 1-2 atom pairs, which are pairs of atoms directly bonded to
97each other.  The second coefficient is the weighting factor on 1-3 atom
98pairs which are those separated by 2 bonds (e.g. the two H atoms in a
99water molecule).  The third coefficient is the weighting factor on 1-4
100atom pairs which are those separated by 3 bonds (e.g. the first and fourth
101atoms in a dihedral interaction).  Thus if the 1-2 coefficient is set
102to 0.0, then the pairwise interaction is effectively turned off for
103all pairs of atoms bonded to each other.  If it is set to 1.0, then
104that interaction will be at full strength.
105
106.. note::
107
108   For purposes of computing weighted pairwise interactions, 1-3
109   and 1-4 interactions are not defined from the list of angles or
110   dihedrals used by the simulation.  Rather, they are inferred
111   topologically from the set of bonds specified when the simulation is
112   defined from a data or restart file (see :doc:`read_data <read_data>` or
113   :doc:`read_restart <read_restart>` commands).  Thus the set of
114   1-2,1-3,1-4 interactions that the weights apply to is the same whether
115   angle and dihedral potentials are computed or not, and remains the
116   same even if bonds are constrained, or turned off, or removed during a
117   simulation.
118
119The two exceptions to this rule are (a) if the *angle* or *dihedral*
120keywords are set to *yes* (see below), or (b) if the
121:doc:`delete_bonds <delete_bonds>` command is used with the *special*
122option that re-computes the 1-2,1-3,1-4 topologies after bonds are
123deleted; see the :doc:`delete_bonds <delete_bonds>` command for more
124details.
125
126The *amber* keyword sets the 3 coefficients to 0.0, 0.0, 0.5 for LJ
127interactions and to 0.0, 0.0, 0.8333 for Coulombic interactions, which
128is the default for a commonly used version of the AMBER force field,
129where the last value is really 5/6.  See :ref:`(Cornell) <Cornell>` for a
130description of the AMBER force field.
131
132The *charmm* keyword sets the 3 coefficients to 0.0, 0.0, 0.0 for both
133LJ and Coulombic interactions, which is the default for a commonly
134used version of the CHARMM force field.  Note that in pair styles
135*lj/charmm/coul/charmm* and *lj/charmm/coul/long* the 1-4 coefficients
136are defined explicitly, and these pairwise contributions are computed
137as part of the charmm dihedral style - see the
138:doc:`pair_coeff <pair_coeff>` and :doc:`dihedral_style <dihedral_style>`
139commands for more information.  See :ref:`(MacKerell) <MacKerell>` for a
140description of the CHARMM force field.
141
142The *dreiding* keyword sets the 3 coefficients to 0.0, 0.0, 1.0 for both
143LJ and Coulombic interactions, which is the default for the Dreiding
144force field, as discussed in :ref:`(Mayo) <Mayo>`.
145
146The *fene* keyword sets the 3 coefficients to 0.0, 1.0, 1.0 for both
147LJ and Coulombic interactions, which is consistent with a
148coarse-grained polymer model with :doc:`FENE bonds <bond_fene>`.  See
149:ref:`(Kremer) <Kremer>` for a description of FENE bonds.
150
151The *lj/coul*, *lj*, and *coul* keywords allow the 3 coefficients to
152be set explicitly.  The *lj/coul* keyword sets both the LJ and
153Coulombic coefficients to the same 3 values.  The *lj* and *coul*
154keywords only set either the LJ or Coulombic coefficients.  Use both
155of them if you wish to set the LJ coefficients to different values
156than the Coulombic coefficients.
157
158The *angle* keyword allows the 1-3 weighting factor to be ignored for
159individual atom pairs if they are not listed as the first and last
160atoms in any angle defined in the simulation or as 1,3 or 2,4 atoms in
161any dihedral defined in the simulation.  For example, imagine the 1-3
162weighting factor is set to 0.5 and you have a linear molecule with 4
163atoms and bonds as follows: 1-2-3-4.  If your data file defines 1-2-3
164as an angle, but does not define 2-3-4 as an angle or 1-2-3-4 as a
165dihedral, then the pairwise interaction between atoms 1 and 3 will
166always be weighted by 0.5, but different force fields use different
167rules for weighting the pairwise interaction between atoms 2 and 4.
168If the *angle* keyword is specified as *yes*, then the pairwise
169interaction between atoms 2 and 4 will be unaffected (full weighting
170of 1.0).  If the *angle* keyword is specified as *no* which is the
171default, then the 2,4 interaction will also be weighted by 0.5.
172
173The *dihedral* keyword allows the 1-4 weighting factor to be ignored
174for individual atom pairs if they are not listed as the first and last
175atoms in any dihedral defined in the simulation.  For example, imagine
176the 1-4 weighting factor is set to 0.5 and you have a linear molecule
177with 5 atoms and bonds as follows: 1-2-3-4-5.  If your data file
178defines 1-2-3-4 as a dihedral, but does not define 2-3-4-5 as a
179dihedral, then the pairwise interaction between atoms 1 and 4 will
180always be weighted by 0.5, but different force fields use different
181rules for weighting the pairwise interaction between atoms 2 and 5.
182If the *dihedral* keyword is specified as *yes*, then the pairwise
183interaction between atoms 2 and 5 will be unaffected (full weighting
184of 1.0).  If the *dihedral* keyword is specified as *no* which is the
185default, then the 2,5 interaction will also be weighted by 0.5.
186
187----------
188
189.. note::
190
191   LAMMPS stores and maintains a data structure with a list of the
192   first, second, and third neighbors of each atom (within the bond topology of
193   the system).  If new bonds are created (or molecules added containing
194   atoms with more special neighbors), the size of this list needs to
195   grow.  Note that adding a single bond always adds a new first neighbor
196   but may also induce \*many\* new second and third neighbors, depending on the
197   molecular topology of your system.  Using the *extra/special/per/atom*
198   keyword to either :doc:`read_data <read_data>` or :doc:`create_box <create_box>`
199   reserves empty space in the list for this N additional first, second, or third
200   neighbors to be added.  If you do not do this, you may get an error
201   when bonds (or molecules) are added.
202
203----------
204
205.. note::
206
207   If you reuse this command in an input script, you should set all
208   the options you need each time.  This command cannot be used a second
209   time incrementally.  E.g. these two commands:
210
211.. code-block:: LAMMPS
212
213   special_bonds lj 0.0 1.0 1.0
214   special_bonds coul 0.0 0.0 1.0
215
216are not the same as
217
218.. code-block:: LAMMPS
219
220   special_bonds lj 0.0 1.0 1.0 coul 0.0 0.0 1.0
221
222In the first case you end up with (after the second command):
223
224.. parsed-literal::
225
226   LJ: 0.0 0.0 0.0
227   Coul: 0.0 0.0 1.0
228
229while only in the second case, you get the desired settings of:
230
231.. parsed-literal::
232
233   LJ: 0.0 1.0 1.0
234   Coul: 0.0 0.0 1.0
235
236This happens because the LJ (and Coul) settings are reset to
237their default values before modifying them, each time the
238*special_bonds* command is issued.
239
240Restrictions
241""""""""""""
242none
243
244Related commands
245""""""""""""""""
246
247:doc:`delete_bonds <delete_bonds>`, :doc:`fix bond/create <fix_bond_create>`
248
249Default
250"""""""
251
252All 3 Lennard-Jones and 3 Coulombic weighting coefficients = 0.0,
253angle = no, dihedral = no.
254
255----------
256
257.. _Cornell:
258
259**(Cornell)** Cornell, Cieplak, Bayly, Gould, Merz, Ferguson,
260Spellmeyer, Fox, Caldwell, Kollman, JACS 117, 5179-5197 (1995).
261
262.. _Kremer:
263
264**(Kremer)** Kremer, Grest, J Chem Phys, 92, 5057 (1990).
265
266.. _MacKerell:
267
268**(MacKerell)** MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field,
269Fischer, Gao, Guo, Ha, et al, J Phys Chem, 102, 3586 (1998).
270
271.. _Mayo:
272
273**(Mayo)** Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909
274(1990).
275