lammps/doc/fix_restrain.html

355 lines
15 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 restrain command &mdash; 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 &amp; 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 &amp; 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>
&nbsp;
</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> &raquo;</li>
<li>fix restrain 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-restrain-command">
<span id="index-0"></span><h1>fix restrain command<a class="headerlink" href="#fix-restrain-command" title="Permalink to this headline"></a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline"></a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix ID group-ID restrain keyword args ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="fix.html"><em>fix</em></a> command</li>
<li>restrain = style name of this fix command</li>
<li>one or more keyword/arg pairs may be appended</li>
<li>keyword = <em>bond</em> or <em>angle</em> or <em>dihedral</em></li>
</ul>
<pre class="literal-block">
<em>bond</em> args = atom1 atom2 Kstart Kstop r0
atom1,atom2 = IDs of 2 atoms in bond
Kstart,Kstop = restraint coefficients at start/end of run (energy units)
r0 = equilibrium bond distance (distance units)
<em>angle</em> args = atom1 atom2 atom3 Kstart Kstop theta0
atom1,atom2,atom3 = IDs of 3 atoms in angle, atom2 = middle atom
Kstart,Kstop = restraint coefficients at start/end of run (energy units)
theta0 = equilibrium angle theta (degrees)
<em>dihedral</em> args = atom1 atom2 atom3 atom4 Kstart Kstop phi0
atom1,atom2,atom3,atom4 = IDs of 4 atoms in dihedral in linear order
Kstart,Kstop = restraint coefficients at start/end of run (energy units)
phi0 = equilibrium dihedral angle phi (degrees)
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix holdem all restrain bond 45 48 2000.0 2000.0 2.75
fix holdem all restrain dihedral 1 2 3 4 2000.0 2000.0 120.0
fix holdem all restrain bond 45 48 2000.0 2000.0 2.75 dihedral 1 2 3 4 2000.0 2000.0 120.0
fix texas_holdem all restrain dihedral 1 2 3 4 0.0 2000.0 120.0 dihedral 1 2 3 5 0.0 2000.0 -120.0 dihedral 1 2 3 6 0.0 2000.0 0.0
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>Restrain the motion of the specified sets of atoms by making them part
of a bond or angle or dihedral interaction whose strength can vary
over time during a simulation. This is functionally equivalent to
creating a bond or angle or dihedral for the same atoms in a data
file, as specified by the <a class="reference internal" href="read_data.html"><em>read_data</em></a> command, albeit
with a time-varying pre-factor coefficient. For the purpose of
forcefield parameter-fitting or mapping a molecular potential energy
surface, this fix reduces the hassle and risk associated with
modifying data files. In other words, use this fix to temporarily
force a molecule to adopt a particular conformation. To create a
permanent bond or angle or dihedral, you should modify the data file.</p>
<p>The group-ID specified by this fix is ignored.</p>
<p>The second example above applies a restraint to hold the dihedral
angle formed by atoms 1, 2, 3, and 4 near 120 degrees using a constant
restraint coefficient. The fourth example applies similar restraints
to multiple dihedral angles using a restraint coefficient that
increases from 0.0 to 2000.0 over the course of the run.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Adding a force to atoms implies a change in their potential
energy as they move due to the applied force field. For dynamics via
the <a class="reference internal" href="run.html"><em>run</em></a> command, this energy can be added to the system&#8217;s
potential energy for thermodynamic output (see below). For energy
minimization via the <a class="reference internal" href="minimize.html"><em>minimize</em></a> command, this energy
must be added to the system&#8217;s potential energy to formulate a
self-consistent minimization problem (see below).</p>
</div>
<p>In order for a restraint to be effective, the restraint force must
typically be significantly larger than the forces associated with
conventional forcefield terms. If the restraint is applied during a
dynamics run (as opposed to during an energy minimization), a large
restraint coefficient can significantly reduce the stable timestep
size, especially if the atoms are initially far from the preferred
conformation. You may need to experiment to determine what value of K
works best for a given application.</p>
<p>For the case of finding a minimum energy structure for a single
molecule with particular restratins (e.g. for fitting forcefield
parameters or constructing a potential energy surface), commands such
as the following may be useful:</p>
<div class="highlight-python"><div class="highlight"><pre># minimize molecule energy with restraints
velocity all create 600.0 8675309 mom yes rot yes dist gaussian
fix NVE all nve
fix TFIX all langevin 600.0 0.0 100 24601
fix REST all restrain dihedral 2 1 3 8 0.0 5000.0 ${angle1} dihedral 3 1 2 9 0.0 5000.0 ${angle2}
fix_modify REST energy yes
run 10000
fix TFIX all langevin 0.0 0.0 100 24601
fix REST all restrain dihedral 2 1 3 8 5000.0 5000.0 ${angle1} dihedral 3 1 2 9 5000.0 5000.0 ${angle2}
fix_modify REST energy yes
run 10000
# sanity check for convergence
minimize 1e-6 1e-9 1000 100000
# report unrestrained energies
unfix REST
run 0
</pre></div>
</div>
<hr class="docutils" />
<p>The <em>bond</em> keyword applies a bond restraint to the specified atoms
using the same functional form used by the <a class="reference internal" href="bond_harmonic.html"><em>bond_style harmonic</em></a> command. The potential associated with
the restraint is</p>
<img alt="_images/bond_harmonic.jpg" class="align-center" src="_images/bond_harmonic.jpg" />
<p>with the following coefficients:</p>
<ul class="simple">
<li>K (energy/distance^2)</li>
<li>r0 (distance)</li>
</ul>
<p>K and r0 are specified with the fix. Note that the usual 1/2 factor
is included in K.</p>
<hr class="docutils" />
<p>The <em>angle</em> keyword applies an angle restraint to the specified atoms
using the same functional form used by the <a class="reference internal" href="angle_harmonic.html"><em>angle_style harmonic</em></a> command. The potential associated with
the restraint is</p>
<img alt="_images/angle_harmonic.jpg" class="align-center" src="_images/angle_harmonic.jpg" />
<p>with the following coefficients:</p>
<ul class="simple">
<li>K (energy/radian^2)</li>
<li>theta0 (degrees)</li>
</ul>
<p>K and theta0 are specified with the fix. Note that the usual 1/2
factor is included in K.</p>
<hr class="docutils" />
<p>The <em>dihedral</em> keyword applies a dihedral restraint to the specified
atoms using a simplified form of the function used by the
<a class="reference internal" href="dihedral_charmm.html"><em>dihedral_style charmm</em></a> command. The potential
associated with the restraint is</p>
<img alt="_images/dihedral_charmm.jpg" class="align-center" src="_images/dihedral_charmm.jpg" />
<p>with the following coefficients:</p>
<ul class="simple">
<li>K (energy)</li>
<li>n = 1</li>
<li>d (degrees) = phi0 + 180</li>
</ul>
<p>K and phi0 are specified with the fix. Note that the value of n is
hard-wired to 1. Also note that the energy will be a minimum when the
current dihedral angle phi is equal to phi0.</p>
</div>
<hr class="docutils" />
<div class="section" id="restart-fix-modify-output-run-start-stop-minimize-info">
<h2>Restart, fix_modify, output, run start/stop, minimize info<a class="headerlink" href="#restart-fix-modify-output-run-start-stop-minimize-info" title="Permalink to this headline"></a></h2>
<p>No information about this fix is written to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>.</p>
<p>The <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a> <em>energy</em> option is supported by this
fix to add the potential energy associated with this fix to the
system&#8217;s potential energy as part of <a class="reference internal" href="thermo_style.html"><em>thermodynamic output</em></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you want the fictitious potential energy associated with the
added forces to be included in the total potential energy of the
system (the quantity being minimized), you MUST enable the
<a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a> <em>energy</em> option for this fix.</p>
</div>
<p>This fix computes a global scalar, which can be accessed by various
<a class="reference internal" href="Section_howto.html#howto-15"><span>output commands</span></a>. The scalar is the
potential energy for all the restraints as discussed above. The scalar
value calculated by this fix is &#8220;extensive&#8221;.</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"><em>run</em></a> command.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline"></a></h2>
<blockquote>
<div>none</div></blockquote>
<p><strong>Related commands:</strong> none</p>
<p><strong>Default:</strong> none</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; 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>