"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 group/group command :h3

[Syntax:]

compute ID group-ID group/group group2-ID :pre

ID, group-ID are documented in "compute"_compute.html command
group/group = style name of this compute command
group2-ID = group ID of second (or same) group :ul

[Examples:]

compute 1 lower group/group upper
compute mine fluid group/group wall :pre

[Description:]

Define a computation that calculates the total energy and force
interaction between two groups of atoms: the compute group and the
specified group2.  The two groups can be the same.  The interaction
energy is defined as the pairwise energy between all pairs of atoms
where one atom in the pair is in the first group and the other is in
the second group.  Likewise, the interaction force calculated by this
compute is the force on the compute group atoms due to pairwise
interactions with atoms in the specified group2.

The energy and force are calculated by looping over a neighbor list of
pairwise interactions.  Thus it can be inefficient to compute this
quantity too frequently.

[Output info:]

This compute calculates a global scalar (the energy) and a global
vector of length 3 (force), which can be accessed by indices 1-3.
These values can be used by any command that uses global scalar or
vector values from a compute as input.  See "this
section"_Section_howto.html#4_15 for an overview of LAMMPS output
options.

Both the scalar and vector values calculated by this compute are
"extensive"., The scalar value will be in energy "units"_units.html.
The vector values will be in force "units"_units.html.

[Restrictions:]

Only pairwise interactions, as defined by the
"pair_style"_pair_style.html command, are included in this
calculation.  Bond (angle, dihedral, etc) interactions between atoms
in the two groups are not included.  Long-range interactions due to a
"kspace_style"_kspace_style.html command are also not included.  Not
all pair potentials can be evaluated in a pairwise mode as required by
this compute.  For example, 3-body potentials, such as
"Tersoff"_pair_tersoff.html and "Stillinger-Weber"_pair_sw.html cannot
be used.  "EAM"_pair_eam.html potentials for metals only include the
pair potential portion of the EAM interaction, not the embedding
term.

[Related commands:] none

[Default:] none
