<spanid="index-0"></span><h1>compute property/chunk command<aclass="headerlink"href="#compute-property-chunk-command"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="syntax">
<h2>Syntax<aclass="headerlink"href="#syntax"title="Permalink to this headline">¶</a></h2>
<divclass="highlight-python"><divclass="highlight"><pre>compute ID group-ID property/chunk chunkID input1 input2 ...
</pre></div>
</div>
<ulclass="simple">
<li>ID, group-ID are documented in <aclass="reference internal"href="compute.html"><em>compute</em></a> command</li>
<li>property/chunk = style name of this compute command</li>
<li>input = one or more attributes</li>
</ul>
<preclass="literal-block">
attributes = count, id, coord1, coord2, coord3
count = # of atoms in chunk
id = original chunk IDs before compression by <aclass="reference internal"href="compute_chunk_atom.html"><em>compute chunk/atom</em></a>
coord123 = coordinates for spatial bins calculated by <aclass="reference internal"href="compute_chunk_atom.html"><em>compute chunk/atom</em></a>
</pre>
</div>
<divclass="section"id="examples">
<h2>Examples<aclass="headerlink"href="#examples"title="Permalink to this headline">¶</a></h2>
<divclass="highlight-python"><divclass="highlight"><pre>compute 1 all property/chunk count
compute 1 all property/chunk ID coord1
</pre></div>
</div>
</div>
<divclass="section"id="description">
<h2>Description<aclass="headerlink"href="#description"title="Permalink to this headline">¶</a></h2>
<p>Define a computation that stores the specified attributes of chunks of
atoms.</p>
<p>In LAMMPS, chunks are collections of atoms defined by a <aclass="reference internal"href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command, which assigns each atom
to a single chunk (or no chunk). The ID for this command is specified
as chunkID. For example, a single chunk could be the atoms in a
molecule or atoms in a spatial bin. See the <aclass="reference internal"href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> doc page and “<aclass="reference internal"href="Section_howto.html#howto-23"><span>Section_howto 23</span></a> for details of how chunks can be
defined and examples of how they can be used to measure properties of
a system.</p>
<p>This compute calculates and stores the specified attributes of chunks
as global data so they can be accessed by other <aclass="reference internal"href="Section_howto.html#howto-15"><span>output commands</span></a> and used in conjunction with
other commands that generate per-chunk data, such as <aclass="reference internal"href="compute_com_chunk.html"><em>compute com/chunk</em></a> or <aclass="reference internal"href="compute_msd_chunk.html"><em>compute msd/chunk</em></a>.</p>
<p>Note that only atoms in the specified group contribute to the
calculation of the <em>count</em> attribute. The <aclass="reference internal"href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command defines its own group;
atoms will have a chunk ID = 0 if they are not in that group,
signifying they are not assigned to a chunk, and will thus also not
contribute to this calculation. You can specify the “all” group for
this command if you simply want to include atoms with non-zero chunk
IDs.</p>
<p>The <em>count</em> attribute is the number of atoms in the chunk.</p>
<p>The <em>id</em> attribute stores the original chunk ID for each chunk. It
can only be used if the <em>compress</em> keyword was set to <em>yes</em> for the
<aclass="reference internal"href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command referenced by
chunkID. This means that the original chunk IDs (e.g. molecule IDs)
will have been compressed to remove chunk IDs with no atoms assigned
to them. Thus a compresed chunk ID of 3 may correspond to an original
chunk ID (molecule ID in this case) of 415. The <em>id</em> attribute will
then be 415 for the 3rd chunk.</p>
<p>The <em>coordN</em> attributes can only be used if a <em>binning</em> style was used
in the <aclass="reference internal"href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command referenced
by chunkID. For <em>bin/1d</em>, <em>bin/2d</em>, and <em>bin/3d</em> styles the attribute
is the center point of the bin in the corresponding dimension. Style
<em>bin/1d</em> only defines a <em>coord1</em> attribute. Style <em>bin/2d</em> adds a
<em>coord2</em> attribute. Style <em>bin/3d</em> adds a <em>coord3</em> attribute.</p>
<p>Note that if the value of the <em>units</em> keyword used in the <aclass="reference internal"href="compute_chunk_atom.html"><em>compute chunk/atom command</em></a> is <em>box</em> or <em>lattice</em>, the
<em>coordN</em> attributes will be in distance <aclass="reference internal"href="units.html"><em>units</em></a>. If the
value of the <em>units</em> keyword is <em>reduced</em>, the <em>coordN</em> attributes
will be in unitless reduced units (0-1).</p>
<p>The simplest way to output the results of the compute property/chunk
calculation to a file is to use the <aclass="reference internal"href="fix_ave_time.html"><em>fix ave/time</em></a>
command, for example:</p>
<divclass="highlight-python"><divclass="highlight"><pre>compute cc1 all chunk/atom molecule
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>.