git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@16053 f3b2605a-c512-4ea7-a41b...
[lammps.git] / doc / src / fix_bond_swap.txt
blob38c5e17c60165c6a4bc1b674031598a4e72d33de
1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
4 :link(ld,Manual.html)
5 :link(lc,Section_commands.html#comm)
7 :line
9 fix bond/swap command :h3
11 [Syntax:]
13 fix ID group-ID bond/swap Nevery fraction cutoff seed :pre
15 ID, group-ID are documented in "fix"_fix.html command
16 bond/swap = style name of this fix command
17 Nevery = attempt bond swapping every this many steps
18 fraction = fraction of group atoms to consider for swapping
19 cutoff = distance at which swapping will be considered (distance units)
20 seed = random # seed (positive integer) :ul
22 [Examples:]
24 fix 1 all bond/swap 50 0.5 1.3 598934 :pre
26 [Description:]
28 In a simulation of polymer chains, this command attempts to swap bonds
29 between two different chains, effectively grafting the end of one
30 chain onto another chain and vice versa.  This is done via Monte Carlo
31 rules using the Boltzmann acceptance criterion.  The purpose is to
32 equilibrate the polymer chain conformations more rapidly than dynamics
33 alone would do it, by enabling instantaneous large conformational
34 changes in a dense polymer melt.  The polymer chains should thus more
35 rapidly converge to the proper end-to-end distances and radii of
36 gyration.  It is designed for use with systems of
37 "FENE"_bond_fene.html or "harmonic"_bond_harmonic.html bead-spring
38 polymer chains where each polymer is a linear chain of monomers, but
39 LAMMPS does not enforce this requirement, i.e. any
40 "bond_style"_bond_style.html can be used.
42 A schematic of the kinds of bond swaps that can occur is shown here:
44 :c,image(JPG/bondswap.jpg)
46 On the left, the red and blue chains have two monomers A1 and B1 close
47 to each other, which are currently bonded to monomers A2 and B2
48 respectively within their own chains.  The bond swap operation will
49 attempt to delete the A1-A2 and B1-B2 bonds and replace them with
50 A1-B2 and B1-A2 bonds.  If the swap is energetically favorable, the
51 two chains on the right are the result and each polymer chain has
52 undergone a dramatic conformational change.  This reference,
53 "(Sides)"_#Sides provides more details on how the algorithm works and
54 its application:
56 The bond swapping operation is invoked every {Nevery} timesteps.  If
57 any bond is swapped, a re-build of the neighbor lists is triggered,
58 since a swap alters the list of which neighbors are considered for
59 pairwise interaction.  At each invocation, each processor considers a
60 random specified {fraction} of its atoms as potential swapping
61 monomers for this timestep.  Choosing a small {fraction} value can
62 reduce the likelihood of a reverse swap occurring soon after an
63 initial swap.
65 For each monomer A1, its neighbors are examined to find a possible B1
66 monomer.  Both A1 and B1 must be in the fix group, their separation
67 must be less than the specified {cutoff}, and the molecule IDs of A1
68 and B1 must be the same (see below).  If a suitable partner is found,
69 the energy change due to swapping the 2 bonds is computed.  This
70 includes changes in pairwise, bond, and angle energies due to the
71 altered connectivity of the 2 chains.  Dihedral and improper
72 interactions are not allowed to be defined when this fix is used.
74 If the energy decreases due to the swap operation, the bond swap is
75 accepted.  If the energy increases it is accepted with probability
76 exp(-delta/kT) where delta is the increase in energy, k is the
77 Boltzmann constant, and T is the current temperature of the system.
78 Whether the swap is accepted or rejected, no other swaps are attempted
79 by this processor on this timestep.
81 The criterion for matching molecule IDs is how bond swaps performed by
82 this fix conserve chain length.  To use this features you must setup
83 the molecule IDs for your polymer chains in a certain way, typically
84 in the data file, read by the "read_data"_read_data.html comand.
85 Consider a system of 6-mer chains.  You have 2 choices.  If the
86 molecule IDs for monomers on each chain are set to 1,2,3,4,5,6 then
87 swaps will conserve chain length.  For a particular momoner there will
88 be only one other monomer on another chain which is a potential swap
89 partner.  If the molecule IDs for monomers on each chain are set to
90 1,2,3,3,2,1 then swaps will conserve chain length but swaps will be
91 able to occur at either end of a chain.  Thus for a particular monomer
92 there will be 2 possible swap partners on another chain.  In this
93 scenario, swaps can also occur within a single chain, i.e. the two
94 ends of a chain swap with each other.
96 NOTE: If your simulation uses molecule IDs in the usual way, where all
97 monomers on a single chain are assigned the same ID (different for
98 each chain), then swaps will only occur within the same chain.  If you
99 assign the same molecule ID to all monomers in all chains then
100 inter-chain swaps will occur, but they will not conserve chain length.
101 Neither of these scenarios is probably what you want for this fix.
103 NOTE: When a bond swap occurs the image flags of monomers in the new
104 polymer chains can become inconsistent.  See the "dump"_dump.html
105 command for a discussion of image flags.  This is not an issue for
106 running dynamics, but can affect calculation of some diagnostic
107 quantities or the printing of unwrapped coordinates to a dump file.
109 :line
111 This fix computes a temperature each time it is invoked for use by the
112 Boltzmann criterion.  To do this, the fix creates its own compute of
113 style {temp}, as if this command had been issued:
115 compute fix-ID_temp all temp :pre
117 See the "compute temp"_compute_temp.html command for details.  Note
118 that the ID of the new compute is the fix-ID with underscore + "temp"
119 appended and the group for the new compute is "all", so that the
120 temperature of the entire system is used.
122 Note that this is NOT the compute used by thermodynamic output (see
123 the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}.
124 This means you can change the attributes of this fix's temperature
125 (e.g. its degrees-of-freedom) via the
126 "compute_modify"_compute_modify.html command or print this temperature
127 during thermodyanmic output via the "thermo_style
128 custom"_thermo_style.html command using the appropriate compute-ID.
129 It also means that changing attributes of {thermo_temp} will have no
130 effect on this fix.
132 :line
134 [Restart, fix_modify, thermo output, run start/stop, minimize info:]
136 No information about this fix is written to "binary restart
137 files"_restart.html.  Because the state of the random number generator
138 is not saved in restart files, this means you cannot do "exact"
139 restarts with this fix, where the simulation continues on the same as
140 if no restart had taken place.  However, in a statistical sense, a
141 restarted simulation should produce the same behavior.  Also note that
142 each processor generates possible swaps independently of other
143 processors.  Thus if you repeat the same simulation on a different number
144 of processors, the specific swaps performed will be different.
146 The "fix_modify"_fix_modify.html {temp} option is supported by this
147 fix.  You can use it to assign a "compute"_compute.html you have
148 defined to this fix which will be used to compute the temperature for
149 the Boltzmann criterion.
151 This fix computes two statistical quantities as a global 2-vector of
152 output, which can be accessed by various "output
153 commands"_Section_howto.html#howto_15.  The first component of the
154 vector is the cummulative number of swaps performed by all processors.
155 The second component of the vector is the cummulative number of swaps
156 attempted (whether accepted or rejected).  Note that a swap "attempt"
157 only occurs when swap partners meeting the criteria described above
158 are found on a particular timestep.  The vector values calculated by
159 this fix are "intensive".
161 No parameter of this fix can be used with the {start/stop} keywords of
162 the "run"_run.html command.  This fix is not invoked during "energy
163 minimization"_minimize.html.
165 [Restrictions:]
167 This fix is part of the MC package.  It is only enabled if LAMMPS was
168 built with that package.  See the "Making
169 LAMMPS"_Section_start.html#start_3 section for more info.
171 The setings of the "special_bond" command must be 0,1,1 in order to
172 use this fix, which is typical of bead-spring chains with FENE or
173 harmonic bonds.  This means that pairwise interactions between bonded
174 atoms are turned off, but are turned on between atoms two or three
175 hops away along the chain backbone.
177 Currently, energy changes in dihedral and improper interactions due to
178 a bond swap are not considered.  Thus a simulation that uses this fix
179 cannot use a dihedral or improper potential.
181 [Related commands:]
183 "fix atom/swap"_fix_atom_swap.html
185 [Default:] none
187 :line
189 :link(Sides)
190 [(Sides)] Sides, Grest, Stevens, Plimpton, J Polymer Science B, 42,
191 199-208 (2004).