LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

### compute attribute/atom command

Syntax:

    compute ID group-ID attribute/atom style

- ID, group-ID are documented in compute command
- attribute/atom = style name of this compute command
- style = x or y or z or xu or yu or zu or vx or vy or vz or fx or fy or fz or xyz or v or f

Examples:

    compute 1 all attribute/atom vy
    compute mine all attribute/atom xyz

Description:

Define a computation that calculates (or simply stores) one or more attributes for each atom in a group. This is useful for input to the fix ave/spatial command to do spatial averaging by layers or to the fix ave/atom command to perform time-averaging of per-atom quantities. The attribute values can also be output directly by the dump custom command, but it has keywords that output these quantities without the need to define an additional compute.

The value of the attribute will be 0.0 for atoms not in the specified compute group.

The styles x, y, z, xu, yu, zu, vx, vy, vz, fx, fy, and fz each store a single scalar value per atom.

The x, y, z keywords store atom coordinate in the appropriate distance units (Angstroms, sigma, etc) and will always be inside (or slightly outside) the simulation box. Use xu, yu, zu if you want the coordinates "unwrapped" by the image flags for each atom. Unwrapped means that if the atom has passed thru a periodic boundary one or more times, the value is printed for what the coordinate would be if it had not been wrapped back into the periodic box. Note that using xu, yu, zu means that the coordinate values may be far outside the simulation box.

Note that if you want to compute the time-averaged position of an atom coordinate that could pass thru a periodic boundary (e.g. via the fix ave/atom command), you probably want to use xu instead of x.

The styles xyz, v, and f each store a vector of 3 quantities per atom.

Note that the various commands that reference this compute use a different syntax for accessing scalar versus vector values, e.g. c_ID versus c_ID[2].

Restrictions: none

Related commands:

fix ave/atom, fix ave/spatial, dump custom

Default: none