File: compute_pressure.html

package info (click to toggle)
lammps 0~20120615.gite442279-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 128,448 kB
  • sloc: cpp: 321,874; fortran: 15,187; ansic: 11,007; python: 7,889; perl: 2,915; sh: 2,088; makefile: 924; f90: 374; objc: 238; lisp: 169; csh: 16; tcl: 6
file content (135 lines) | stat: -rw-r--r-- 5,743 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<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>
<H3>compute pressure/cuda command 
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID pressure temp-ID keyword ... 
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>pressure = style name of this compute command
<LI>temp-ID = ID of compute that calculates temperature
<LI>zero or more keywords may be appended
<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> 
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all pressure myTemp
compute 1 all pressure thermo_temp pair bond 
</PRE>
<P><B>Description:</B>
</P>
<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
of atoms via the <A HREF = "compute_reduce.html">compute reduce</A> command.
</P>
<P>The pressure is computed by the formula
</P>
<CENTER><IMG SRC = "Eqs/pressure.jpg">
</CENTER>
<P>where N is the number of atoms in the system (see discussion of DOF
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
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
(e.g. the <A HREF = "fix_shake.html">fix shake</A> command) also contribute to the
virial term.
</P>
<P>A symmetric pressure tensor, stored as a 6-element vector, is also
calculated by this compute.  The 6 components of the vector are
ordered xx, yy, zz, xy, xz, yz.  The equation for the I,J components
(where I and J = x,y,z) is similar to the above 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
calculated which include a kinetic energy (temperature) term and the
virial as the sum of pair, bond, angle, dihedral, improper, kspace
(long-range), and fix contributions to the force on each atom.  If any
extra keywords are listed, then only those components are summed to
compute temperature or ke and/or the virial.  The <I>virial</I> keyword
means include all terms except the kinetic energy <I>ke</I>.
</P>
<P>The temperature and kinetic energy tensor is not calculated by this
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.
</P>
<P>Note that the N in the first formula above is really
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
temperature</A> styles for details.
</P>
<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:
</P>
<PRE>compute thermo_press all pressure thermo_temp 
</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>
<HR>

<P>Styles with a <I>cuda</I> suffix are functionally the same as the
corresponding style without the suffix.  They have been optimized to
run faster, depending on your available hardware, as discussed in
<A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual.  The
accelerated styles take the same arguments and should produce the same
results, except for round-off and precision issues.
</P>
<P>These accelerated styles are part of the USER-CUDA package.  They are
only enabled if LAMMPS was built with that package.  See the <A HREF = "Section_start.html#start_3">Making
LAMMPS</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_7">-suffix command-line
switch</A> when you invoke LAMMPS, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
<P>See <A HREF = "Section_accelerate.html">Section_accelerate</A> of the manual for
more instructions on how to use the accelerated styles effectively.
</P>
<HR>

<P><B>Output info:</B>
</P>
<P>This compute calculates a global scalar (the pressure) and a global
vector of length 6 (pressure tensor), which can be accessed by indices
1-6.  These values can be used by any command that uses global scalar
or vector values from a compute as input.  See <A HREF = "Section_howto.html#howto_15">this
section</A> for an overview of LAMMPS output
options.
</P>
<P>The scalar and vector values calculated by this compute are
"intensive".  The scalar and vector values will be in pressure
<A HREF = "units.html">units</A>.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_temp.html">compute temp</A>, <A HREF = "compute_stress_atom.html">compute
stress/atom</A>,
<A HREF = "thermo_style.html">thermo_style</A>,
</P>
<P><B>Default:</B> none
</P>
</HTML>