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 or fix ave/time 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 or the fix ave/spatial command.
LAMMPS creates its own computes for thermodynamic output. Two computes are always created, named "thermo_temp" and "thermo_pressure", as if these commands had been invoked:
compute thermo_temp all temp compute thermo_pressure all pressure thermo_temp
Additional computes are created if the thermo style requires it. See the documentation for the thermo_style command.
The dumping of atom snapshots and fixes that compute temperature or pressure also create computes as required. These are discussed in the documentation for the 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.
Properties of either a default of user-defined compute can be modified via the compute_modify command.
Computes can be deleted with the uncompute command.
Code for new computes can be added to LAMMPS (see this section of the manaul) and the results of their calculations accessed in the various ways described above.
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