git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@16053 f3b2605a-c512-4ea7-a41b...
[lammps.git] / doc / src / compute_pe_atom.txt
blob8e2fd17f2444492aee885a5a9d8d742c1eaa293d
1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
4 :link(ld,Manual.html)
5 :link(lc,Section_commands.html#comm)
7 :line
9 compute pe/atom command :h3
11 [Syntax:]
13 compute ID group-ID pe/atom keyword ... :pre
15 ID, group-ID are documented in "compute"_compute.html command
16 pe/atom = style name of this compute command
17 zero or more keywords may be appended
18 keyword = {pair} or {bond} or {angle} or {dihedral} or {improper} or {kspace} or {fix} :ul
20 [Examples:]
22 compute 1 all pe/atom
23 compute 1 all pe/atom pair
24 compute 1 all pe/atom pair bond :pre
26 [Description:]
28 Define a computation that computes the per-atom potential energy for
29 each atom in a group.  See the "compute pe"_compute_pe.html command if
30 you want the potential energy of the entire system.
32 The per-atom energy is calculated by the various pair, bond, etc
33 potentials defined for the simulation.  If no extra keywords are
34 listed, then the potential energy is the sum of pair, bond, angle,
35 dihedral,improper, kspace (long-range), and fix energy.  I.e. it is as
36 if all the keywords were listed.  If any extra keywords are listed,
37 then only those components are summed to compute the potential energy.
39 Note that the energy of each atom is due to its interaction with all
40 other atoms in the simulation, not just with other atoms in the group.
42 For an energy contribution produced by a small set of atoms (e.g. 4
43 atoms in a dihedral or 3 atoms in a Tersoff 3-body interaction), that
44 energy is assigned in equal portions to each atom in the set.
45 E.g. 1/4 of the dihedral energy to each of the 4 atoms.
47 The "dihedral_style charmm"_dihedral_charmm.html style calculates
48 pairwise interactions between 1-4 atoms.  The energy contribution of
49 these terms is included in the pair energy, not the dihedral energy.
51 The KSpace contribution is calculated using the method in
52 "(Heyes)"_#Heyes for the Ewald method and a related method for PPPM,
53 as specified by the "kspace_style pppm"_kspace_style.html command.
54 For PPPM, the calcluation requires 1 extra FFT each timestep that
55 per-atom energy is calculated.  This "document"_PDF/kspace.pdf
56 describes how the long-range per-atom energy calculation is performed.
58 Various fixes can contribute to the per-atom potential energy of the
59 system if the {fix} contribution is included.  See the doc pages for
60 "individual fixes"_fix.html for details of which ones compute a
61 per-atom potential energy.
63 NOTE: The "fix_modify energy yes"_fix_modify.html command must also be
64 specified if a fix is to contribute per-atom potential energy to this
65 command.
67 As an example of per-atom potential energy compared to total potential
68 energy, these lines in an input script should yield the same result
69 in the last 2 columns of thermo output:
71 compute        peratom all pe/atom
72 compute        pe all reduce sum c_peratom
73 thermo_style   custom step temp etotal press pe c_pe :pre
75 NOTE: The per-atom energy does not include any Lennard-Jones tail
76 corrections to the energy added by the "pair_modify tail
77 yes"_pair_modify.html command, since those are contributions to the
78 global system energy.
80 [Output info:]
82 This compute calculates a per-atom vector, which can be accessed by
83 any command that uses per-atom values from a compute as input.  See
84 "Section 6.15"_Section_howto.html#howto_15 for an overview of
85 LAMMPS output options.
87 The per-atom vector values will be in energy "units"_units.html.
89 [Restrictions:]
91 [Related commands:]
93 "compute pe"_compute_pe.html, "compute
94 stress/atom"_compute_stress_atom.html
96 [Default:] none
98 :line
100 :link(Heyes)
101 [(Heyes)] Heyes, Phys Rev B 49, 755 (1994),