<h2>Description<aclass="headerlink"href="#description"title="Permalink to this headline">¶</a></h2>
<p>Change or adapt one or more specific simulation attributes or settings
over time as a simulation runs. Pair potential and K-space and atom
attributes which can be varied by this fix are discussed below. Many
other fixes can also be used to time-vary simulation parameters,
e.g. the “fix deform” command will change the simulation box
size/shape and the “fix move” command will change atom positions and
velocities in a prescribed manner. Also note that many commands allow
variables as arguments for specific parameters, if described in that
manner on their doc pages. An equal-style variable can calculate a
time-dependent quantity, so this is another way to vary a simulation
parameter over time.</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>> 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 “scale factor” applied
in (presumably) a time-varying fashion to the parameter.</p>
<p>Note that whether scale is <em>no</em> or <em>yes</em>, internally, the parameters
themselves are actually altered by this fix. 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>
<hrclass="docutils"/>
<p>The <em>pair</em> keyword enables various parameters of potentials defined by
the <aclass="reference internal"href="pair_style.html"><em>pair_style</em></a> command to be changed, if the pair
style supports it. Note that the <aclass="reference internal"href="pair_style.html"><em>pair_style</em></a> and
<aclass="reference internal"href="pair_coeff.html"><em>pair_coeff</em></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 <aclass="reference internal"href="pair_hybrid.html"><em>pair_style hybrid or hybrid/overlay</em></a> is used, <em>pstyle</em> should be
a sub-style name. For example, <em>pstyle</em> could be specified as “soft”
or “lubricate”. 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>
<pclass="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 “mu” for <aclass="reference internal"href="pair_lubricate.html"><em>pair_style lubricate</em></a>.
Other parameters apply to atom type pairs within the pair style,
e.g. the prefactor “a” for <aclass="reference internal"href="pair_soft.html"><em>pair_style soft</em></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 “scale”
are exactly that, since the energy expression for the
<aclass="reference internal"href="pair_coul.html"><em>coul/cut</em></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
<aclass="reference internal"href="pair_buck.html"><em>Buckingham potential</em></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 <aclass="reference internal"href="pair_coeff.html"><em>pair_coeff command</em></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 <= 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 “*” or “<em>n” or “n</em>” or “m*n”. 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 <= J are considered; if
asterisks imply type pairs where J < I, they are ignored.</p>
<p>IMPROTANT NOTE: If <aclass="reference internal"href="pair_hybrid.html"><em>pair_style hybrid or hybrid/overlay</em></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 <aclass="reference internal"href="pair_coeff.html"><em>pair_coeff</em></a>
command) for that sub-style.</p>
<p>The <em>v_name</em> argument for keyword <em>pair</em> is the name of an
<aclass="reference internal"href="variable.html"><em>equal-style variable</em></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 <aclass="reference internal"href="thermo_style.html"><em>thermo_style</em></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 <aclass="reference internal"href="run.html"><em>run</em></a> command and the
<em>elaplong</em> keyword of <aclass="reference internal"href="thermo_style.html"><em>thermo_style custom</em></a> for
details.</p>
<p>For example, these commands would change the prefactor coefficient of
the <aclass="reference internal"href="pair_soft.html"><em>pair_style soft</em></a> potential from 10.0 to 30.0 in a
linear fashion over the course of a simulation:</p>
<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 <aclass="reference internal"href="kspace_style.html"><em>kspace_style</em></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>
<hrclass="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>
<ulclass="simple">
<li>charge = charge on particle</li>
<li>diameter = diameter of particle</li>
</ul>
<p>The <em>v_name</em> argument of the <em>atom</em> keyword is the name of an
<aclass="reference internal"href="variable.html"><em>equal-style variable</em></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>
<divclass="admonition warning">
<pclass="first admonition-title">Warning</p>
<pclass="last">The <em>atom</em> keyword works this way whether the <em>scale</em>
keyword is set to <em>no</em> or <em>yes</em>. I.e. the use of scale yes is not yet
supported by the <em>atom</em> keyword.</p>
</div>
<p>If the atom parameter is <em>diameter</em> and per-atom density and per-atom
mass are defined for particles (e.g. <aclass="reference internal"href="atom_style.html"><em>atom_style granular</em></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 “center” group from 1.0 to 0.1 in a linear fashion
<h2>Restart, fix_modify, output, run start/stop, minimize info<aclass="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 <aclass="reference internal"href="restart.html"><em>binary restart files</em></a>. None of the <aclass="reference internal"href="fix_modify.html"><em>fix_modify</em></a> options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various <aclass="reference internal"href="Section_howto.html#howto-15"><span>output commands</span></a>. No parameter of this fix can
be used with the <em>start/stop</em> keywords of the <aclass="reference internal"href="run.html"><em>run</em></a> command.
This fix is not invoked during <aclass="reference internal"href="minimize.html"><em>energy minimization</em></a>.</p>
<p>For <aclass="reference internal"href="run_style.html"><em>rRESPA time integration</em></a>, this fix changes
parameters on the outermost rRESPA level.</p>
</div>
<divclass="section"id="restrictions">
<h2>Restrictions<aclass="headerlink"href="#restrictions"title="Permalink to this headline">¶</a></h2>
<blockquote>
<div>none</div></blockquote>
</div>
<divclass="section"id="related-commands">
<h2>Related commands<aclass="headerlink"href="#related-commands"title="Permalink to this headline">¶</a></h2>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.