Syntax:
compute ID group-ID style args
Examples:
compute 1 all temp compute newtemp flow temp/partial 1 1 0 compute 3 all ke/atom
Description:
Create a computation that will be performed on a group of atoms.
In LAMMPS, a "compute" is used in several ways. Computes that calculate one or more values for the entire group of atoms can output those values via the thermo_style custom command. Or the values can be referenced in a variable equal command. Computes that calculate a temperature or pressure are used by fixes that do thermostatting or barostatting and when atom velocities are created. Computes that calculate one or more values for each atom in the group can output those values via the dump custom command.
LAMMPS creates its own computes for thermodynamic output and dumping atom snapshots. Likewise fixes that compute temperature or pressure create their own computes. These are discussed in the documentation for thermo_style, dump custom, and specific fix commands.
In all these cases, the default computes can be replaced by computes defined in the input script, as described by the thermo_modify and fix modify commands. Code for new computes can also be added to LAMMPS (see this section of the manaul) and their calculations accessed in the various ways described above.
Properties of a compute can be modified via the compute_modify command.
Compute can be deleted with the uncompute command.
Each compute style has its own doc page which describes its arguments and what it does. Here is an alphabetic list of compute styles defined in LAMMPS:
Restrictions: none
Related commands:
Default: none