"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c

:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)

:line

compute property/chunk command :h3

[Syntax:]

compute ID group-ID property/chunk chunkID input1 input2 ... :pre

ID, group-ID are documented in "compute"_compute.html command :ulb,l
property/chunk = style name of this compute command :l
input = one or more attributes :l
  attributes = count, id, coord1, coord2, coord3
    count = # of atoms in chunk
    id = original chunk IDs before compression by "compute chunk/atom"_compute_chunk_atom.html
    coord123 = coordinates for spatial bins calculated by "compute chunk/atom"_compute_chunk_atom.html :pre
:ule

[Examples:]

compute 1 all property/chunk count
compute 1 all property/chunk ID coord1 :pre

[Description:]

Define a computation that stores the specified attributes of chunks of
atoms.

In LAMMPS, chunks are collections of atoms defined by a "compute
chunk/atom"_compute_chunk_atom.html 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 "compute
chunk/atom"_compute_chunk_atom.html doc page and "Section
6.23"_Section_howto.html#howto_23 for details of how chunks can be
defined and examples of how they can be used to measure properties of
a system.

This compute calculates and stores the specified attributes of chunks
as global data so they can be accessed by other "output
commands"_Section_howto.html#howto_15 and used in conjunction with
other commands that generate per-chunk data, such as "compute
com/chunk"_compute_com_chunk.html or "compute
msd/chunk"_compute_msd_chunk.html.

Note that only atoms in the specified group contribute to the
calculation of the {count} attribute.  The "compute
chunk/atom"_compute_chunk_atom.html 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.

The {count} attribute is the number of atoms in the chunk.

The {id} attribute stores the original chunk ID for each chunk.  It
can only be used if the {compress} keyword was set to {yes} for the
"compute chunk/atom"_compute_chunk_atom.html 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 compressed chunk ID of 3 may correspond to an original
chunk ID (molecule ID in this case) of 415.  The {id} attribute will
then be 415 for the 3rd chunk.

The {coordN} attributes can only be used if a {binning} style was used
in the "compute chunk/atom"_compute_chunk_atom.html command referenced
by chunkID.  For {bin/1d}, {bin/2d}, and {bin/3d} styles the attribute
is the center point of the bin in the corresponding dimension.  Style
{bin/1d} only defines a {coord1} attribute.  Style {bin/2d} adds a
{coord2} attribute.  Style {bin/3d} adds a {coord3} attribute.

Note that if the value of the {units} keyword used in the "compute
chunk/atom command"_compute_chunk_atom.html is {box} or {lattice}, the
{coordN} attributes will be in distance "units"_units.html.  If the
value of the {units} keyword is {reduced}, the {coordN} attributes
will be in unitless reduced units (0-1).

The simplest way to output the results of the compute property/chunk
calculation to a file is to use the "fix ave/time"_fix_ave_time.html
command, for example:

compute cc1 all chunk/atom molecule
compute myChunk1 all property/chunk cc1 count
compute myChunk2 all com/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk1 c_myChunk2\[*\] file tmp.out mode vector :pre

[Output info:]

This compute calculates a global vector or global array depending on
the number of input values.  The length of the vector or number of
rows in the array is the number of chunks.

This compute calculates a global vector or global array where the
number of rows = the number of chunks {Nchunk} as calculated by the
specified "compute chunk/atom"_compute_chunk_atom.html command.  If a
single input is specified, a global vector is produced.  If two or
more inputs are specified, a global array is produced where the number
of columns = the number of inputs.  The vector or array can be
accessed by any command that uses global values from a compute as
input.  See "this section"_Section_howto.html#howto_15 for an overview
of LAMMPS output options.

The vector or array values are "intensive".  The values will be
unitless or in the units discussed above.

[Restrictions:] none

[Related commands:]

"fix ave/chunk"_fix_ave_chunk.html

[Default:] none
