forked from lijiext/lammps
357 lines
17 KiB
HTML
357 lines
17 KiB
HTML
|
|
|
|
<!DOCTYPE html>
|
|
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
|
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
|
<head>
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<title>fix bond/swap command — LAMMPS documentation</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="_static/sphinxcontrib-images/LightBox2/lightbox2/css/lightbox.css" type="text/css" />
|
|
|
|
|
|
|
|
<link rel="top" title="LAMMPS documentation" href="index.html"/>
|
|
|
|
|
|
<script src="_static/js/modernizr.min.js"></script>
|
|
|
|
</head>
|
|
|
|
<body class="wy-body-for-nav" role="document">
|
|
|
|
<div class="wy-grid-for-nav">
|
|
|
|
|
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
<div class="wy-side-nav-search">
|
|
|
|
|
|
|
|
<a href="Manual.html" class="icon icon-home"> LAMMPS
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<div role="search">
|
|
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
|
<input type="text" name="q" placeholder="Search docs" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
|
|
|
|
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">3. Commands</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">4. Packages</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_accelerate.html">5. Accelerating LAMMPS performance</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">6. How-to discussions</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_example.html">7. Example problems</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_perf.html">8. Performance & scalability</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_tools.html">9. Additional tools</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">10. Modifying & extending LAMMPS</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">11. Python interface to LAMMPS</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">12. Errors</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="Section_history.html">13. Future and history</a></li>
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
|
|
|
|
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
<a href="Manual.html">LAMMPS</a>
|
|
</nav>
|
|
|
|
|
|
|
|
<div class="wy-nav-content">
|
|
<div class="rst-content">
|
|
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
<ul class="wy-breadcrumbs">
|
|
<li><a href="Manual.html">Docs</a> »</li>
|
|
|
|
<li>fix bond/swap command</li>
|
|
<li class="wy-breadcrumbs-aside">
|
|
|
|
|
|
<a href="http://lammps.sandia.gov">Website</a>
|
|
<a href="Section_commands.html#comm">Commands</a>
|
|
|
|
</li>
|
|
</ul>
|
|
<hr/>
|
|
|
|
</div>
|
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
<div itemprop="articleBody">
|
|
|
|
<div class="section" id="fix-bond-swap-command">
|
|
<span id="index-0"></span><h1>fix bond/swap command</h1>
|
|
<div class="section" id="syntax">
|
|
<h2>Syntax</h2>
|
|
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">fix</span> <span class="n">ID</span> <span class="n">group</span><span class="o">-</span><span class="n">ID</span> <span class="n">bond</span><span class="o">/</span><span class="n">swap</span> <span class="n">Nevery</span> <span class="n">fraction</span> <span class="n">cutoff</span> <span class="n">seed</span>
|
|
</pre></div>
|
|
</div>
|
|
<ul class="simple">
|
|
<li>ID, group-ID are documented in <a class="reference internal" href="fix.html"><span class="doc">fix</span></a> command</li>
|
|
<li>bond/swap = style name of this fix command</li>
|
|
<li>Nevery = attempt bond swapping every this many steps</li>
|
|
<li>fraction = fraction of group atoms to consider for swapping</li>
|
|
<li>cutoff = distance at which swapping will be considered (distance units)</li>
|
|
<li>seed = random # seed (positive integer)</li>
|
|
</ul>
|
|
</div>
|
|
<div class="section" id="examples">
|
|
<h2>Examples</h2>
|
|
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">bond</span><span class="o">/</span><span class="n">swap</span> <span class="mi">50</span> <span class="mf">0.5</span> <span class="mf">1.3</span> <span class="mi">598934</span>
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="description">
|
|
<h2>Description</h2>
|
|
<p>In a simulation of polymer chains, this command attempts to swap bonds
|
|
between two different chains, effectively grafting the end of one
|
|
chain onto another chain and vice versa. This is done via Monte Carlo
|
|
rules using the Boltzmann acceptance criterion. The purpose is to
|
|
equilibrate the polymer chain conformations more rapidly than dynamics
|
|
alone would do it, by enabling instantaneous large conformational
|
|
changes in a dense polymer melt. The polymer chains should thus more
|
|
rapidly converge to the proper end-to-end distances and radii of
|
|
gyration. It is designed for use with systems of
|
|
<a class="reference internal" href="bond_fene.html"><span class="doc">FENE</span></a> or <a class="reference internal" href="bond_harmonic.html"><span class="doc">harmonic</span></a> bead-spring
|
|
polymer chains where each polymer is a linear chain of monomers, but
|
|
LAMMPS does not enforce this requirement, i.e. any
|
|
<a class="reference internal" href="bond_style.html"><span class="doc">bond_style</span></a> can be used.</p>
|
|
<p>A schematic of the kinds of bond swaps that can occur is shown here:</p>
|
|
<img alt="_images/bondswap.jpg" class="align-center" src="_images/bondswap.jpg" />
|
|
<p>On the left, the red and blue chains have two monomers A1 and B1 close
|
|
to each other, which are currently bonded to monomers A2 and B2
|
|
respectively within their own chains. The bond swap operation will
|
|
attempt to delete the A1-A2 and B1-B2 bonds and replace them with
|
|
A1-B2 and B1-A2 bonds. If the swap is energetically favorable, the
|
|
two chains on the right are the result and each polymer chain has
|
|
undergone a dramatic conformational change. This reference,
|
|
<a class="reference internal" href="#sides"><span class="std std-ref">(Sides)</span></a> provides more details on how the algorithm works and
|
|
its application:</p>
|
|
<p>The bond swapping operation is invoked every <em>Nevery</em> timesteps. If
|
|
any bond is swapped, a re-build of the neighbor lists is triggered,
|
|
since a swap alters the list of which neighbors are considered for
|
|
pairwise interaction. At each invocation, each processor considers a
|
|
random specified <em>fraction</em> of its atoms as potential swapping
|
|
monomers for this timestep. Choosing a small <em>fraction</em> value can
|
|
reduce the likelihood of a reverse swap occurring soon after an
|
|
initial swap.</p>
|
|
<p>For each monomer A1, its neighbors are examined to find a possible B1
|
|
monomer. Both A1 and B1 must be in the fix group, their separation
|
|
must be less than the specified <em>cutoff</em>, and the molecule IDs of A1
|
|
and B1 must be the same (see below). If a suitable partner is found,
|
|
the energy change due to swapping the 2 bonds is computed. This
|
|
includes changes in pairwise, bond, and angle energies due to the
|
|
altered connectivity of the 2 chains. Dihedral and improper
|
|
interactions are not allowed to be defined when this fix is used.</p>
|
|
<p>If the energy decreases due to the swap operation, the bond swap is
|
|
accepted. If the energy increases it is accepted with probability
|
|
exp(-delta/kT) where delta is the increase in energy, k is the
|
|
Boltzmann constant, and T is the current temperature of the system.
|
|
Whether the swap is accepted or rejected, no other swaps are attempted
|
|
by this processor on this timestep.</p>
|
|
<p>The criterion for matching molecule IDs is how bond swaps performed by
|
|
this fix conserve chain length. To use this features you must setup
|
|
the molecule IDs for your polymer chains in a certain way, typically
|
|
in the data file, read by the <a class="reference internal" href="read_data.html"><span class="doc">read_data</span></a> comand.
|
|
Consider a system of 6-mer chains. You have 2 choices. If the
|
|
molecule IDs for monomers on each chain are set to 1,2,3,4,5,6 then
|
|
swaps will conserve chain length. For a particular momoner there will
|
|
be only one other monomer on another chain which is a potential swap
|
|
partner. If the molecule IDs for monomers on each chain are set to
|
|
1,2,3,3,2,1 then swaps will conserve chain length but swaps will be
|
|
able to occur at either end of a chain. Thus for a particular monomer
|
|
there will be 2 possible swap partners on another chain. In this
|
|
scenario, swaps can also occur within a single chain, i.e. the two
|
|
ends of a chain swap with each other.</p>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">If your simulation uses molecule IDs in the usual way, where all
|
|
monomers on a single chain are assigned the same ID (different for
|
|
each chain), then swaps will only occur within the same chain. If you
|
|
assign the same molecule ID to all monomers in all chains then
|
|
inter-chain swaps will occur, but they will not conserve chain length.
|
|
Neither of these scenarios is probably what you want for this fix.</p>
|
|
</div>
|
|
<div class="admonition note">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">When a bond swap occurs the image flags of monomers in the new
|
|
polymer chains can become inconsistent. See the <a class="reference internal" href="dump.html"><span class="doc">dump</span></a>
|
|
command for a discussion of image flags. This is not an issue for
|
|
running dynamics, but can affect calculation of some diagnostic
|
|
quantities or the printing of unwrapped coordinates to a dump file.</p>
|
|
</div>
|
|
<hr class="docutils" />
|
|
<p>This fix computes a temperature each time it is invoked for use by the
|
|
Boltzmann criterion. To do this, the fix creates its own compute of
|
|
style <em>temp</em>, as if this command had been issued:</p>
|
|
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">fix</span><span class="o">-</span><span class="n">ID_temp</span> <span class="nb">all</span> <span class="n">temp</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>See the <a class="reference internal" href="compute_temp.html"><span class="doc">compute temp</span></a> command for details. Note
|
|
that the ID of the new compute is the fix-ID with underscore + “temp”
|
|
appended and the group for the new compute is “all”, so that the
|
|
temperature of the entire system is used.</p>
|
|
<p>Note that this is NOT the compute used by thermodynamic output (see
|
|
the <a class="reference internal" href="thermo_style.html"><span class="doc">thermo_style</span></a> command) with ID = <em>thermo_temp</em>.
|
|
This means you can change the attributes of this fix’s temperature
|
|
(e.g. its degrees-of-freedom) via the
|
|
<a class="reference internal" href="compute_modify.html"><span class="doc">compute_modify</span></a> command or print this temperature
|
|
during thermodyanmic output via the <a class="reference internal" href="thermo_style.html"><span class="doc">thermo_style custom</span></a> command using the appropriate compute-ID.
|
|
It also means that changing attributes of <em>thermo_temp</em> will have no
|
|
effect on this fix.</p>
|
|
<hr class="docutils" />
|
|
<p><strong>Restart, fix_modify, thermo output, run start/stop, minimize info:</strong></p>
|
|
<p>No information about this fix is written to <a class="reference internal" href="restart.html"><span class="doc">binary restart files</span></a>. Because the state of the random number generator
|
|
is not saved in restart files, this means you cannot do “exact”
|
|
restarts with this fix, where the simulation continues on the same as
|
|
if no restart had taken place. However, in a statistical sense, a
|
|
restarted simulation should produce the same behavior. Also note that
|
|
each processor generates possible swaps independently of other
|
|
processors. Thus if you repeat the same simulation on a different number
|
|
of processors, the specific swaps performed will be different.</p>
|
|
<p>The <a class="reference internal" href="fix_modify.html"><span class="doc">fix_modify</span></a> <em>temp</em> option is supported by this
|
|
fix. You can use it to assign a <a class="reference internal" href="compute.html"><span class="doc">compute</span></a> you have
|
|
defined to this fix which will be used to compute the temperature for
|
|
the Boltzmann criterion.</p>
|
|
<p>This fix computes two statistical quantities as a global 2-vector of
|
|
output, which can be accessed by various <a class="reference internal" href="Section_howto.html#howto-15"><span class="std std-ref">output commands</span></a>. The first component of the
|
|
vector is the cummulative number of swaps performed by all processors.
|
|
The second component of the vector is the cummulative number of swaps
|
|
attempted (whether accepted or rejected). Note that a swap “attempt”
|
|
only occurs when swap partners meeting the criteria described above
|
|
are found on a particular timestep. The vector values calculated by
|
|
this fix are “intensive”.</p>
|
|
<p>No parameter of this fix can be used with the <em>start/stop</em> keywords of
|
|
the <a class="reference internal" href="run.html"><span class="doc">run</span></a> command. This fix is not invoked during <a class="reference internal" href="minimize.html"><span class="doc">energy minimization</span></a>.</p>
|
|
</div>
|
|
<div class="section" id="restrictions">
|
|
<h2>Restrictions</h2>
|
|
<p>This fix is part of the MC package. It is only enabled if LAMMPS was
|
|
built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span class="std std-ref">Making LAMMPS</span></a> section for more info.</p>
|
|
<p>The setings of the “special_bond” command must be 0,1,1 in order to
|
|
use this fix, which is typical of bead-spring chains with FENE or
|
|
harmonic bonds. This means that pairwise interactions between bonded
|
|
atoms are turned off, but are turned on between atoms two or three
|
|
hops away along the chain backbone.</p>
|
|
<p>Currently, energy changes in dihedral and improper interactions due to
|
|
a bond swap are not considered. Thus a simulation that uses this fix
|
|
cannot use a dihedral or improper potential.</p>
|
|
</div>
|
|
<div class="section" id="related-commands">
|
|
<h2>Related commands</h2>
|
|
<p><a class="reference internal" href="fix_atom_swap.html"><span class="doc">fix atom/swap</span></a></p>
|
|
<p><strong>Default:</strong> none</p>
|
|
<hr class="docutils" />
|
|
<p id="sides"><strong>(Sides)</strong> Sides, Grest, Stevens, Plimpton, J Polymer Science B, 42,
|
|
199-208 (2004).</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<footer>
|
|
|
|
|
|
<hr/>
|
|
|
|
<div role="contentinfo">
|
|
<p>
|
|
© Copyright 2013 Sandia Corporation.
|
|
</p>
|
|
</div>
|
|
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT:'./',
|
|
VERSION:'',
|
|
COLLAPSE_INDEX:false,
|
|
FILE_SUFFIX:'.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
|
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/jquery-1.11.0.min.js"></script>
|
|
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2/js/lightbox.min.js"></script>
|
|
<script type="text/javascript" src="_static/sphinxcontrib-images/LightBox2/lightbox2-customize/jquery-noconflict.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="_static/js/theme.js"></script>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
jQuery(function () {
|
|
SphinxRtdTheme.StickyNav.enable();
|
|
});
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html> |