<p>One way to to use this command is to accumulate a vector that is
time-integrated using the <aclass="reference internal"href="variable.html"><em>variable trap()</em></a> function.
For example the velocity auto-correlation function (VACF) can be
time-integrated, to yield a diffusion coefficient, as follows:</p>
<divclass="highlight-python"><divclass="highlight"><pre>compute 2 all vacf
fix 5 all vector 1 c_2[4]
variable diff equal dt*trap(f_5)
thermo_style custom step v_diff
</pre></div>
</div>
<p>The group specified with this command is ignored. However, note that
specified values may represent calculations performed by computes and
fixes which store their own “group” definitions.</p>
<p>Each listed value can be the result of a <aclass="reference internal"href="compute.html"><em>compute</em></a> or
<aclass="reference internal"href="fix.html"><em>fix</em></a> or the evaluation of an equal-style
<aclass="reference internal"href="variable.html"><em>variable</em></a>. In each case, the compute, fix, or variable
must produce a global quantity, not a per-atom or local quantity.
And the global quantity must be a scalar, not a vector or array.</p>
<p><aclass="reference internal"href="compute.html"><em>Computes</em></a> that produce global quantities are those which
do not have the word <em>atom</em> in their style name. Only a few
<aclass="reference internal"href="fix.html"><em>fixes</em></a> produce global quantities. See the doc pages for
individual fixes for info on which ones produce such values.
<aclass="reference internal"href="variable.html"><em>Variables</em></a> of style <em>equal</em> are the only ones that can
be used with this fix. Variables of style <em>atom</em> cannot be used,
since they produce per-atom values.</p>
<p>The <em>Nevery</em> argument specifies on what timesteps the input values
will be used in order to be stored. Only timesteps that are a
multiple of <em>Nevery</em>, including timestep 0, will contribute values.</p>
<p>Note that if you perform multiple runs, using the “pre no” option of
the <aclass="reference internal"href="run.html"><em>run</em></a> command to avoid initialization on subsequent runs,
then you need to use the <em>stop</em> keyword with the first <aclass="reference internal"href="run.html"><em>run</em></a>
command with a timestep value that encompasses all the runs. This is
so that the vector or array stored by this fix can be allocated to a
sufficient size.</p>
<hrclass="docutils"/>
<p>If a value begins with “<ahref="#id1"><spanclass="problematic"id="id2">c_</span></a>”, a compute ID must follow which has been
previously defined in the input script. If no bracketed term is
appended, the global scalar calculated by the compute is used. If a
bracketed term is appended, the Ith element of the global vector
calculated by the compute is used.</p>
<p>Note that there is a <aclass="reference internal"href="compute_reduce.html"><em>compute reduce</em></a> command
which can sum per-atom quantities into a global scalar or vector which
can thus be accessed by fix vector. Or it can be a compute defined
not in your input script, but by <aclass="reference internal"href="thermo_style.html"><em>thermodynamic output</em></a> or other fixes such as <aclass="reference internal"href="fix_nh.html"><em>fix nvt</em></a>
or <aclass="reference internal"href="fix_temp_rescale.html"><em>fix temp/rescale</em></a>. See the doc pages for
these commands which give the IDs of these computes. Users can also
write code for their own compute styles and <aclass="reference internal"href="Section_modify.html"><em>add them to LAMMPS</em></a>.</p>
<p>If a value begins with “<ahref="#id3"><spanclass="problematic"id="id4">f_</span></a>”, a fix ID must follow which has been
previously defined in the input script. If no bracketed term is
appended, the global scalar calculated by the fix is used. If a
bracketed term is appended, the Ith element of the global vector
calculated by the fix is used.</p>
<p>Note that some fixes only produce their values on certain timesteps,
which must be compatible with <em>Nevery</em>, else an error will result.
Users can also write code for their own fix styles and <aclass="reference internal"href="Section_modify.html"><em>add them to LAMMPS</em></a>.</p>
<p>If a value begins with “<ahref="#id5"><spanclass="problematic"id="id6">v_</span></a>”, a variable name must follow which has
been previously defined in the input script. Only equal-style
variables can be referenced. See the <aclass="reference internal"href="variable.html"><em>variable</em></a> command
for details. Note that variables of style <em>equal</em> define a formula
which can reference individual atom properties or thermodynamic
keywords, or they can invoke other computes, fixes, or variables when
they are evaluated, so this is a very general means of specifying
<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.</p>
<p>This fix produces a global vector or global array which can be
accessed by various <aclass="reference internal"href="Section_howto.html#howto-15"><span>output commands</span></a>.
The values can only be accessed on timesteps that are multiples of
<em>Nevery</em>.</p>
<p>A vector is produced if only a single input value is specified.
An array is produced if multiple input values are specified.
The length of the vector or the number of rows in the array grows
by 1 every <em>Nevery</em> timesteps.</p>
<p>If the fix prouduces a vector, then the entire vector will be either
“intensive” or “extensive”, depending on whether the values stored in
the vector are “intensive” or “extensive”. If the fix produces an
array, then all elements in the array must be the same, either
“intensive” or “extensive”. If a compute or fix provides the value
stored, then the compute or fix determines whether the value is
intensive or extensive; see the doc page for that compute or fix for
further info. Values produced by a variable are treated as intensive.</p>
<p>This fix can allocate storage for stored values accumulated over
multiple runs, using the <em>start</em> and <em>stop</em> keywords of the
<aclass="reference internal"href="run.html"><em>run</em></a> command. See the <aclass="reference internal"href="run.html"><em>run</em></a> command for details of
how to do this. If using the <aclass="reference internal"href="run.html"><em>run pre no</em></a> command option,
this is required to allow the fix to allocate sufficient storage for
stored values.</p>
<p>This fix is not invoked during <aclass="reference internal"href="minimize.html"><em>energy minimization</em></a>.</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>.