2007-02-10 05:40:32 +08:00
< HTML >
< CENTER > < A HREF = "http://lammps.sandia.gov" > LAMMPS WWW Site< / A > - < A HREF = "Manual.html" > LAMMPS Documentation< / A > - < A HREF = "Section_commands.html#comm" > LAMMPS Commands< / A >
< / CENTER >
< HR >
< H3 > compute pressure command
< / H3 >
< P > < B > Syntax:< / B >
< / P >
2007-12-01 07:16:45 +08:00
< PRE > compute ID group-ID pressure temp-ID keyword ...
2007-02-10 05:40:32 +08:00
< / PRE >
< UL > < LI > ID, group-ID are documented in < A HREF = "compute.html" > compute< / A > command
< LI > pressure = style name of this compute command
2007-12-01 07:16:45 +08:00
< LI > temp-ID = ID of compute that calculates temperature
< LI > zero or more keywords may be appended
2009-03-06 05:17:05 +08:00
< LI > keyword = < I > ke< / I > or < I > pair< / I > or < I > bond< / I > or < I > angle< / I > or < I > dihedral< / I > or < I > improper< / I > or < I > kspace< / I > or < I > fix< / I > or < I > virial< / I >
2007-02-10 05:40:32 +08:00
< / UL >
< P > < B > Examples:< / B >
< / P >
2007-12-01 07:16:45 +08:00
< PRE > compute 1 all pressure myTemp
compute 1 all pressure thermo_temp pair bond
2007-02-10 05:40:32 +08:00
< / PRE >
< P > < B > Description:< / B >
< / P >
2007-11-02 00:46:50 +08:00
< P > Define a computation that calculates the pressure of the entire system
of atoms. The specified group must be "all". See the < A HREF = "compute_stress_atom.html" > compute
stress/atom< / A > command if you want per-atom
pressure (stress). These per-atom values could be summed for a group
2008-02-26 00:06:38 +08:00
of atoms via the < A HREF = "compute_reduce.html" > compute reduce< / A > command.
2007-02-10 05:40:32 +08:00
< / P >
2007-11-02 00:46:50 +08:00
< P > The pressure is computed by the formula
2007-02-10 05:40:32 +08:00
< / P >
< CENTER > < IMG SRC = "Eqs/pressure.jpg" >
< / CENTER >
< P > where N is the number of atoms in the system (see discussion of DOF
2007-07-04 03:54:12 +08:00
below), Kb is the Boltzmann constant, T is the temperature, d is the
dimensionality of the system (2 or 3 for 2d/3d), V is the system
volume (or area in 2d), and the second term is the virial, computed
2007-12-01 07:16:45 +08:00
within LAMMPS for all pairwise as well as 2-body, 3-body, and 4-body,
and long-range interactions. < A HREF = "fix.html" > Fixes< / A > that impose constraints
2007-07-04 03:54:12 +08:00
(e.g. the < A HREF = "fix_shake.html" > fix shake< / A > command) also contribute to the
virial term.
2007-02-10 05:40:32 +08:00
< / P >
2009-03-04 01:00:10 +08:00
< P > A 6-component symmetric pressure tensor is also calculated by this
compute whose components can be output by the < A HREF = "thermo_style.html" > thermo_style
2007-12-01 07:16:45 +08:00
custom< / A > command or accessed by other
2009-03-04 01:10:43 +08:00
< A HREF = "compute.html" > compute< / A > and < A HREF = "fix.html" > fix< / A > commands. The equation for
the I,J components (where I and J = x,y,z) is similar to the above
2009-03-04 01:00:10 +08:00
formula, except that the first term uses components of the kinetic
energy tensor and the second term uses components of the virial
tensor:
< / P >
< CENTER > < IMG SRC = "Eqs/pressure_tensor.jpg" >
< / CENTER >
< P > If no extra keywords are listed, the entire equations above are
2009-03-06 05:17:05 +08:00
calculated which include a kinetic energy (temperature) term and the
virial as the sum of pair, bond, angle, dihedral, improper, kspace
2009-03-04 01:00:10 +08:00
(long-range), and fix contributions to the force on each atom. If any
extra keywords are listed, then only those components are summed to
2009-03-06 05:17:05 +08:00
compute temperature or ke and/or the virial. The < I > virial< / I > keyword
means include all terms except the kinetic energy < I > ke< / I > .
2007-02-10 05:40:32 +08:00
< / P >
< P > The temperature and kinetic energy tensor is not calculated by this
2007-12-01 07:16:45 +08:00
compute, but rather by the temperature compute specified with the
command. Normally this compute should calculate the temperature of
all atoms for consistency with the virial term, but any compute style
that calculates temperature can be used, e.g. one that excludes frozen
atoms or other degrees of freedom.
2007-02-10 05:40:32 +08:00
< / P >
2009-03-04 01:00:10 +08:00
< P > Note that the N in the first formula above is really
2009-03-04 01:03:38 +08:00
degrees-of-freedom divided by d = dimensionality, where the DOF value
is calcluated by the temperature compute. See the various < A HREF = "compute.html" > compute
2009-03-04 01:00:10 +08:00
temperature< / A > styles for details.
2007-02-10 05:40:32 +08:00
< / P >
2008-01-18 07:46:30 +08:00
< P > A compute of this style with the ID of "thermo_press" is created when
LAMMPS starts up, as if this command were in the input script:
2007-11-02 00:46:50 +08:00
< / P >
2008-01-18 07:46:30 +08:00
< PRE > compute thermo_press all pressure thermo_temp
2007-11-02 00:46:50 +08:00
< / PRE >
< P > where "thermo_temp" is the ID of a similarly defined compute of style
"temp". See the "thermo_style" command for more details.
< / P >
2008-01-03 03:25:15 +08:00
< P > < B > Output info:< / B >
< / P >
2009-03-04 01:10:43 +08:00
< P > The scalar and vector values calculated by this compute are
"intensive", meaning they are independent of the number of atoms in
the simulation. The 6 components of the vector are ordered xx, yy,
zz, xy, xz, yz.
2008-01-03 03:25:15 +08:00
< / P >
2007-02-10 05:40:32 +08:00
< P > < B > Restrictions:< / B > none
< / P >
< P > < B > Related commands:< / B >
< / P >
2007-12-01 07:16:45 +08:00
< P > < A HREF = "compute_temp.html" > compute temp< / A > , < A HREF = "compute_stress_atom.html" > compute
stress/atom< / A > ,
2008-03-01 09:13:20 +08:00
< A HREF = "thermo_style.html" > thermo_style< / A > ,
2007-02-10 05:40:32 +08:00
< / P >
< P > < B > Default:< / B > none
< / P >
< / HTML >