Page MenuHomec4science

fix_adapt_fep.html
No OneTemporary

File Metadata

Created
Mon, Dec 23, 17:05

fix_adapt_fep.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 adapt/fep 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 adapt/fep 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-adapt-fep-command">
<span id="index-0"></span><h1>fix adapt/fep 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">adapt</span><span class="o">/</span><span class="n">fep</span> <span class="n">N</span> <span class="n">attribute</span> <span class="n">args</span> <span class="o">...</span> <span class="n">keyword</span> <span class="n">value</span> <span class="o">...</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>adapt/fep = style name of this fix command</li>
<li>N = adapt simulation settings every this many timesteps</li>
<li>one or more attribute/arg pairs may be appended</li>
<li>attribute = <em>pair</em> or <em>kspace</em> or <em>atom</em></li>
</ul>
<pre class="literal-block">
<em>pair</em> args = pstyle pparam I J v_name
pstyle = pair style name, e.g. lj/cut
pparam = parameter to adapt over time
I,J = type pair(s) to set parameter for
v_name = variable with name that calculates value of pparam
<em>kspace</em> arg = v_name
v_name = variable with name that calculates scale factor on K-space terms
<em>atom</em> args = aparam v_name
aparam = parameter to adapt over time
I = type(s) to set parameter for
v_name = variable with name that calculates value of aparam
</pre>
<ul class="simple">
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>scale</em> or <em>reset</em> or <em>after</em></li>
</ul>
<pre class="literal-block">
<em>scale</em> value = <em>no</em> or <em>yes</em>
<em>no</em> = the variable value is the new setting
<em>yes</em> = the variable value multiplies the original setting
<em>reset</em> value = <em>no</em> or <em>yes</em>
<em>no</em> = values will remain altered at the end of a run
<em>yes</em> = reset altered values to their original values at the end
of a run
<em>after</em> value = <em>no</em> or <em>yes</em>
<em>no</em> = parameters are adapted at timestep N
<em>yes</em> = parameters are adapted one timestep after N
</pre>
</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">adapt</span><span class="o">/</span><span class="n">fep</span> <span class="mi">1</span> <span class="n">pair</span> <span class="n">soft</span> <span class="n">a</span> <span class="mi">1</span> <span class="mi">1</span> <span class="n">v_prefactor</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">adapt</span><span class="o">/</span><span class="n">fep</span> <span class="mi">1</span> <span class="n">pair</span> <span class="n">soft</span> <span class="n">a</span> <span class="mi">2</span><span class="o">*</span> <span class="mi">3</span> <span class="n">v_prefactor</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">adapt</span><span class="o">/</span><span class="n">fep</span> <span class="mi">1</span> <span class="n">pair</span> <span class="n">lj</span><span class="o">/</span><span class="n">cut</span> <span class="n">epsilon</span> <span class="o">*</span> <span class="o">*</span> <span class="n">v_scale1</span> <span class="n">coul</span><span class="o">/</span><span class="n">cut</span> <span class="n">scale</span> <span class="mi">3</span> <span class="mi">3</span> <span class="n">v_scale2</span> <span class="n">scale</span> <span class="n">yes</span> <span class="n">reset</span> <span class="n">yes</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">adapt</span><span class="o">/</span><span class="n">fep</span> <span class="mi">10</span> <span class="n">atom</span> <span class="n">diameter</span> <span class="mi">1</span> <span class="n">v_size</span>
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>Change or adapt one or more specific simulation attributes or settings
over time as a simulation runs.</p>
<p>This is an enhanced version of the <a class="reference internal" href="fix_adapt.html"><span class="doc">fix adapt</span></a> command
with two differences,</p>
<ul class="simple">
<li>It is possible to modify the charges of chosen atom types only,
instead of scaling all the charges in the system.</li>
<li>There is a new option <em>after</em> for better compatibility with &#8220;fix
ave/time&#8221;.</li>
</ul>
<p>This version is suited for free energy calculations using
<a class="reference internal" href="compute_ti.html"><span class="doc">compute ti</span></a> or <a class="reference internal" href="compute_fep.html"><span class="doc">compute fep</span></a>.</p>
<p>If <em>N</em> is specified as 0, the specified attributes are only changed
once, before the simulation begins. This is all that is needed if the
associated variables are not time-dependent. If <em>N</em> &gt; 0, then changes
are made every <em>N</em> steps during the simulation, presumably with a
variable that is time-dependent.</p>
<p>Depending on the value of the <em>reset</em> keyword, attributes changed by
this fix will or will not be reset back to their original values at
the end of a simulation. Even if <em>reset</em> is specified as <em>yes</em>, a
restart file written during a simulation will contain the modified
settings.</p>
<p>If the <em>scale</em> keyword is set to <em>no</em>, then the value the parameter is
set to will be whatever the variable generates. If the <em>scale</em>
keyword is set to <em>yes</em>, then the value of the altered parameter will
be the initial value of that parameter multiplied by whatever the
variable generates. I.e. the variable is now a &#8220;scale factor&#8221; applied
in (presumably) a time-varying fashion to the parameter. Internally,
the parameters themselves are actually altered; make sure you use the
<em>reset yes</em> option if you want the parameters to be restored to their
initial values after the run.</p>
<p>If the <em>after</em> keyword is set to <em>yes</em>, then the parameters are
changed one timestep after the multiple of N. In this manner, if a fix
such as &#8220;fix ave/time&#8221; is used to calculate averages at every N
timesteps, all the contributions to the average will be obtained with
the same values of the parameters.</p>
<hr class="docutils" />
<p>The <em>pair</em> keyword enables various parameters of potentials defined by
the <a class="reference internal" href="pair_style.html"><span class="doc">pair_style</span></a> command to be changed, if the pair
style supports it. Note that the <a class="reference internal" href="pair_style.html"><span class="doc">pair_style</span></a> and
<a class="reference internal" href="pair_coeff.html"><span class="doc">pair_coeff</span></a> commands must be used in the usual manner
to specify these parameters initially; the fix adapt command simply
overrides the parameters.</p>
<p>The <em>pstyle</em> argument is the name of the pair style. If <a class="reference internal" href="pair_hybrid.html"><span class="doc">pair_style hybrid or hybrid/overlay</span></a> is used, <em>pstyle</em> should be
a sub-style name. For example, <em>pstyle</em> could be specified as &#8220;soft&#8221;
or &#8220;lubricate&#8221;. The <em>pparam</em> argument is the name of the parameter to
change. This is the current list of pair styles and parameters that
can be varied by this fix. See the doc pages for individual pair
styles and their energy formulas for the meaning of these parameters:</p>
<table border="1" class="docutils">
<colgroup>
<col width="51%" />
<col width="31%" />
<col width="18%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="pair_born.html"><span class="doc">born</span></a></td>
<td>a,b,c</td>
<td>type pairs</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_buck.html"><span class="doc">buck</span></a></td>
<td>a,c</td>
<td>type pairs</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_coul.html"><span class="doc">coul/cut</span></a></td>
<td>scale</td>
<td>type pairs</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_coul.html"><span class="doc">coul/debye</span></a></td>
<td>scale</td>
<td>type pairs</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_coul.html"><span class="doc">coul/long</span></a></td>
<td>scale</td>
<td>type pairs</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_lj.html"><span class="doc">lj/cut</span></a></td>
<td>epsilon,sigma</td>
<td>type pairs</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_lj_expand.html"><span class="doc">lj/expand</span></a></td>
<td>epsilon,sigma,delta</td>
<td>type pairs</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_lubricate.html"><span class="doc">lubricate</span></a></td>
<td>mu</td>
<td>global</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="pair_gauss.html"><span class="doc">gauss</span></a></td>
<td>a</td>
<td>type pairs</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="pair_soft.html"><span class="doc">soft</span></a></td>
<td>a</td>
<td>type pairs</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">It is easy to add new potentials and their parameters to this
list. All it typically takes is adding an extract() method to the
pair_*.cpp file associated with the potential.</p>
</div>
<p>Some parameters are global settings for the pair style, e.g. the
viscosity setting &#8220;mu&#8221; for <a class="reference internal" href="pair_lubricate.html"><span class="doc">pair_style lubricate</span></a>.
Other parameters apply to atom type pairs within the pair style,
e.g. the prefactor &#8220;a&#8221; for <a class="reference internal" href="pair_soft.html"><span class="doc">pair_style soft</span></a>.</p>
<p>Note that for many of the potentials, the parameter that can be varied
is effectively a prefactor on the entire energy expression for the
potential, e.g. the lj/cut epsilon. The parameters listed as &#8220;scale&#8221;
are exactly that, since the energy expression for the
<a class="reference internal" href="pair_coul.html"><span class="doc">coul/cut</span></a> potential (for example) has no labeled
prefactor in its formula. To apply an effective prefactor to some
potentials, multiple parameters need to be altered. For example, the
<a class="reference internal" href="pair_buck.html"><span class="doc">Buckingham potential</span></a> needs both the A and C terms
altered together. To scale the Buckingham potential, you should thus
list the pair style twice, once for A and once for C.</p>
<p>If a type pair parameter is specified, the <em>I</em> and <em>J</em> settings should
be specified to indicate which type pairs to apply it to. If a global
parameter is specified, the <em>I</em> and <em>J</em> settings still need to be
specified, but are ignored.</p>
<p>Similar to the <a class="reference internal" href="pair_coeff.html"><span class="doc">pair_coeff command</span></a>, I and J can be
specified in one of two ways. Explicit numeric values can be used for
each, as in the 1st example above. I &lt;= J is required. LAMMPS sets
the coefficients for the symmetric J,I interaction to the same values.</p>
<p>A wild-card asterisk can be used in place of or in conjunction with
the I,J arguments to set the coefficients for multiple pairs of atom
types. This takes the form &#8220;*&#8221; or &#8220;<em>n&#8221; or &#8220;n</em>&#8221; or &#8220;m*n&#8221;. If N = the
number of atom types, then an asterisk with no numeric values means
all types from 1 to N. A leading asterisk means all types from 1 to n
(inclusive). A trailing asterisk means all types from n to N
(inclusive). A middle asterisk means all types from m to n
(inclusive). Note that only type pairs with I &lt;= J are considered; if
asterisks imply type pairs where J &lt; I, they are ignored.</p>
<p>IMPROTANT NOTE: If <a class="reference internal" href="pair_hybrid.html"><span class="doc">pair_style hybrid or hybrid/overlay</span></a> is being used, then the <em>pstyle</em> will
be a sub-style name. You must specify I,J arguments that correspond
to type pair values defined (via the <a class="reference internal" href="pair_coeff.html"><span class="doc">pair_coeff</span></a>
command) for that sub-style.</p>
<p>The <em>v_name</em> argument for keyword <em>pair</em> is the name of an
<a class="reference internal" href="variable.html"><span class="doc">equal-style variable</span></a> which will be evaluated each time
this fix is invoked to set the parameter to a new value. It should be
specified as v_name, where name is the variable name. Equal-style
variables can specify formulas with various mathematical functions,
and include <a class="reference internal" href="thermo_style.html"><span class="doc">thermo_style</span></a> command keywords for the
simulation box parameters and timestep and elapsed time. Thus it is
easy to specify parameters that change as a function of time or span
consecutive runs in a continuous fashion. For the latter, see the
<em>start</em> and <em>stop</em> keywords of the <a class="reference internal" href="run.html"><span class="doc">run</span></a> command and the
<em>elaplong</em> keyword of <a class="reference internal" href="thermo_style.html"><span class="doc">thermo_style custom</span></a> for
details.</p>
<p>For example, these commands would change the prefactor coefficient of
the <a class="reference internal" href="pair_soft.html"><span class="doc">pair_style soft</span></a> potential from 10.0 to 30.0 in a
linear fashion over the course of a simulation:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">variable</span> <span class="n">prefactor</span> <span class="n">equal</span> <span class="n">ramp</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span><span class="mi">30</span><span class="p">)</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">adapt</span> <span class="mi">1</span> <span class="n">pair</span> <span class="n">soft</span> <span class="n">a</span> <span class="o">*</span> <span class="o">*</span> <span class="n">v_prefactor</span>
</pre></div>
</div>
<hr class="docutils" />
<p>The <em>kspace</em> keyword used the specified variable as a scale factor on
the energy, forces, virial calculated by whatever K-Space solver is
defined by the <a class="reference internal" href="kspace_style.html"><span class="doc">kspace_style</span></a> command. If the
variable has a value of 1.0, then the solver is unaltered.</p>
<p>The <em>kspace</em> keyword works this way whether the <em>scale</em> keyword
is set to <em>no</em> or <em>yes</em>.</p>
<hr class="docutils" />
<p>The <em>atom</em> keyword enables various atom properties to be changed. The
<em>aparam</em> argument is the name of the parameter to change. This is the
current list of atom parameters that can be varied by this fix:</p>
<ul class="simple">
<li>charge = charge on particle</li>
<li>diameter = diameter of particle</li>
</ul>
<p>The <em>I</em> argument indicates which atom types are affected. A wild-card
asterisk can be used in place of or in conjunction with the I argument
to set the coefficients for multiple atom types.</p>
<p>The <em>v_name</em> argument of the <em>atom</em> keyword is the name of an
<a class="reference internal" href="variable.html"><span class="doc">equal-style variable</span></a> which will be evaluated each time
this fix is invoked to set the parameter to a new value. It should be
specified as v_name, where name is the variable name. See the
discussion above describing the formulas associated with equal-style
variables. The new value is assigned to the corresponding attribute
for all atoms in the fix group.</p>
<p>If the atom parameter is <em>diameter</em> and per-atom density and per-atom
mass are defined for particles (e.g. <a class="reference internal" href="atom_style.html"><span class="doc">atom_style granular</span></a>), then the mass of each particle is also
changed when the diameter changes (density is assumed to stay
constant).</p>
<p>For example, these commands would shrink the diameter of all granular
particles in the &#8220;center&#8221; group from 1.0 to 0.1 in a linear fashion
over the course of a 1000-step simulation:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">variable</span> <span class="n">size</span> <span class="n">equal</span> <span class="n">ramp</span><span class="p">(</span><span class="mf">1.0</span><span class="p">,</span><span class="mf">0.1</span><span class="p">)</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="n">center</span> <span class="n">adapt</span> <span class="mi">10</span> <span class="n">atom</span> <span class="n">diameter</span> <span class="o">*</span> <span class="n">v_size</span>
</pre></div>
</div>
<p>For <a class="reference internal" href="run_style.html"><span class="doc">rRESPA time integration</span></a>, this fix changes
parameters on the outermost rRESPA level.</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</h2>
<p>No information about this fix is written to <a class="reference internal" href="restart.html"><span class="doc">binary restart files</span></a>. None of the <a class="reference internal" href="fix_modify.html"><span class="doc">fix_modify</span></a> options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various <a class="reference internal" href="Section_howto.html#howto-15"><span class="std std-ref">output commands</span></a>. 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>
<blockquote>
<div>none</div></blockquote>
</div>
<div class="section" id="related-commands">
<h2>Related commands</h2>
<p><a class="reference internal" href="compute_fep.html"><span class="doc">compute fep</span></a>, <a class="reference internal" href="fix_adapt.html"><span class="doc">fix adapt</span></a>, <a class="reference internal" href="compute_ti.html"><span class="doc">compute ti</span></a></p>
</div>
<div class="section" id="default">
<h2>Default</h2>
<p>The option defaults are scale = no, reset = no, after = no.</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>

Event Timeline