<li><pclass="first">file = name of data file to write out</p>
</li>
<li><pclass="first">zero or more keyword/value pairs may be appended</p>
</li>
<li><pclass="first">keyword = <em>pair</em> or <em>nocoeff</em></p>
<preclass="literal-block">
<em>nocoeff</em> = do not write out force field info
<em>pair</em> value = <em>ii</em> or <em>ij</em>
<em>ii</em> = write one line of pair coefficient info per atom type
<em>ij</em> = write one line of pair coefficient info per IJ atom type pair
</pre>
</li>
</ul>
</div>
<divclass="section"id="examples">
<h2>Examples</h2>
<preclass="literal-block">
write_data data.polymer
write_data data.*
</pre>
</div>
<divclass="section"id="description">
<h2>Description</h2>
<p>Write a data file in text format of the current state of the
simulation. Data files can be read by the <aclass="reference internal"href="read_data.html"><spanclass="doc">read data</span></a>
command to begin a simulation. The <aclass="reference internal"href="read_data.html"><spanclass="doc">read_data</span></a> command
also describes their format.</p>
<p>Similar to <aclass="reference internal"href="dump.html"><spanclass="doc">dump</span></a> files, the data filename can contain a “*”
wild-card character. The “*” is replaced with the current timestep
value.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">The write-data command is not yet fully implemented in two
respects. First, most pair styles do not yet write their coefficient
information into the data file. This means you will need to specify
that information in your input script that reads the data file, via
the <aclass="reference internal"href="pair_coeff.html"><spanclass="doc">pair_coeff</span></a> command. Second, a few of the <aclass="reference internal"href="atom_style.html"><spanclass="doc">atom styles</span></a> (body, ellipsoid, line, tri) that store
auxiliary “bonus” information about aspherical particles, do not yet
write the bonus info into the data file. Both these functionalities
will be added to the write_data command later.</p>
</div>
<p>Because a data file is in text format, if you use a data file written
out by this command to restart a simulation, the initial state of the
new run will be slightly different than the final state of the old run
(when the file was written) which was represented internally by LAMMPS
in binary format. A new simulation which reads the data file will
thus typically diverge from a simulation that continued in the
original input script.</p>
<p>If you want to do more exact restarts, using binary files, see the
<aclass="reference internal"href="restart.html"><spanclass="doc">restart</span></a>, <aclass="reference internal"href="write_restart.html"><spanclass="doc">write_restart</span></a>, and
<aclass="reference internal"href="read_restart.html"><spanclass="doc">read_restart</span></a> commands. You can also convert
binary restart files to text data files, after a simulation has run,
using the <aclass="reference internal"href="Section_start.html#start-7"><spanclass="std std-ref">-r command-line switch</span></a>.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">Only limited information about a simulation is stored in a data
file. For example, no information about atom <aclass="reference internal"href="group.html"><spanclass="doc">groups</span></a> and
<aclass="reference internal"href="fix.html"><spanclass="doc">fixes</span></a> are stored. <aclass="reference internal"href="read_restart.html"><spanclass="doc">Binary restart files</span></a>
store more information.</p>
</div>
<p>Bond interactions (angle, etc) that have been turned off by the <aclass="reference internal"href="fix_shake.html"><spanclass="doc">fix shake</span></a> or <aclass="reference internal"href="delete_bonds.html"><spanclass="doc">delete_bonds</span></a> command will
be written to a data file as if they are turned on. This means they
will need to be turned off again in a new run after the data file is
read.</p>
<p>Bonds that are broken (e.g. by a bond-breaking potential) are not
written to the data file. Thus these bonds will not exist when the
data file is read.</p>
<hrclass="docutils"/>
<p>The <em>nocoeff</em> keyword requests that no force field parameters should
be written to the data file. This can be very helpful, if one wants
to make significant changes to the force field or if the parameters
are read in separately anyway, e.g. from an include file.</p>
<p>The <em>pair</em> keyword lets you specify in what format the pair
coefficient information is written into the data file. If the value
is specified as <em>ii</em>, then one line per atom type is written, to
specify the coefficients for each of the I=J interactions. This means
that no cross-interactions for I != J will be specified in the data
file and the pair style will apply its mixing rule, as documented on
individual <aclass="reference internal"href="pair_style.html"><spanclass="doc">pair_style</span></a> doc pages. Of course this
behavior can be overridden in the input script after reading the data
file, by specifying additional <aclass="reference internal"href="pair_coeff.html"><spanclass="doc">pair_coeff</span></a> commands
for any desired I,J pairs.</p>
<p>If the value is specified as <em>ij</em>, then one line of coefficients is
written for all I,J pairs where I <= J. These coefficients will
include any specific settings made in the input script up to that
point. The presence of these I != J coefficients in the data file
will effectively turn off the default mixing rule for the pair style.
Again, the coefficient values in the data file can can be overridden
in the input script after reading the data file, by specifying
additional <aclass="reference internal"href="pair_coeff.html"><spanclass="doc">pair_coeff</span></a> commands for any desired I,J
pairs.</p>
</div>
<hrclass="docutils"/>
<divclass="section"id="restrictions">
<h2>Restrictions</h2>
<p>This command requires inter-processor communication to migrate atoms
before the data file is written. This means that your system must be
ready to perform a simulation before using this command (force fields
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>.