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

[Syntax:]

compute ID group-ID pe keyword ... :pre

ID, group-ID are documented in "compute"_compute.html command
pe = style name of this compute command
zero or more keywords may be appended
keyword = {pair} or {bond} or {angle} or {dihedral} or {improper} or {kspace} or {fix} :ul

[Examples:]

compute 1 all pe
compute molPE all pe bond angle dihedral improper :pre

[Description:]

Define a computation that calculates the potential energy of the
entire system of atoms.  The specified group must be "all".  See the
"compute pe/atom"_compute_pe_atom.html command if you want per-atom
energies.  These per-atom values could be summed for a group of atoms
via the "compute reduce"_compute_reduce.html command.

The energy is calculated by the various pair, bond, etc potentials
defined for the simulation.  If no extra keywords are listed, then the
potential energy is the sum of pair, bond, angle, dihedral, improper,
kspace (long-range), and fix energy.  I.e. it is as if all the
keywords were listed.  If any extra keywords are listed, then only
those components are summed to compute the potential energy.

The Kspace contribution requires 1 extra FFT each timestep the energy
is calculated, if using the PPPM solver via the "kspace_style
pppm"_kspace_style.html command.  Thus it can increase the cost of the
PPPM calculation if it is needed on a large fraction of the simulation
timesteps.

Various fixes can contribute to the total potential energy of the
system if the {fix} contribution is included.  See the doc pages for
"individual fixes"_fix.html for details of which ones compute a
potential energy.

NOTE: The "fix_modify energy yes"_fix_modify.html command must also be
specified if a fix is to contribute potential energy to this command.

A compute of this style with the ID of "thermo_pe" is created when
LAMMPS starts up, as if this command were in the input script:

compute thermo_pe all pe :pre

See the "thermo_style" command for more details.

:line

[Output info:]

This compute calculates a global scalar (the potential energy).  This
value can be used by any command that uses a global scalar value from
a compute as input.  See "Section
6.15"_Section_howto.html#howto_15 for an overview of LAMMPS output
options.

The scalar value calculated by this compute is "extensive".  The
scalar value will be in energy "units"_units.html.

[Restrictions:] none

[Related commands:]

"compute pe/atom"_compute_pe_atom.html

[Default:] none
