2008-02-20 23:00:04 +08:00
|
|
|
"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 reduce command :h3
|
2009-04-28 22:56:27 +08:00
|
|
|
compute reduce/region command :h3
|
2008-02-20 23:00:04 +08:00
|
|
|
|
|
|
|
[Syntax:]
|
|
|
|
|
2009-04-28 22:56:27 +08:00
|
|
|
compute ID group-ID style arg mode input1 input2 ... :pre
|
2008-02-20 23:00:04 +08:00
|
|
|
|
|
|
|
ID, group-ID are documented in "compute"_compute.html command :ulb,l
|
2009-04-28 22:56:27 +08:00
|
|
|
style = {reduce} or {reduce/region} :l
|
|
|
|
{reduce} arg = none
|
|
|
|
{reduce/region} arg = region-ID
|
|
|
|
region-ID = ID of region to use for choosing atoms :pre
|
2008-02-20 23:00:04 +08:00
|
|
|
mode = {sum} or {min} or {max} :l
|
|
|
|
one or more inputs can be listed :l
|
|
|
|
input = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :l
|
|
|
|
x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component)
|
|
|
|
c_ID = per-atom scalar value calculated by a compute with ID
|
|
|
|
c_ID\[N\] = Nth component of per-atom vector calculated by a compute with ID
|
|
|
|
f_ID = per-atom scalar value calculated by a fix with ID
|
|
|
|
f_ID\[N\] = Nth component of per-atom vector calculated by a fix with ID
|
|
|
|
v_name = per-atom value calculated by an atom-style variable with name :pre
|
|
|
|
:ule
|
|
|
|
|
|
|
|
[Examples:]
|
|
|
|
|
|
|
|
compute 1 all reduce sum c_force
|
2009-04-28 22:56:27 +08:00
|
|
|
compute 1 all reduce/region subbox sum c_force
|
2008-02-20 23:00:04 +08:00
|
|
|
compute 2 all reduce min c_press[2] f_ave v_myKE :pre
|
|
|
|
|
|
|
|
[Description:]
|
|
|
|
|
|
|
|
Define a calculation that "reduces" one or more per-atom inputs across
|
|
|
|
all atoms in the group to yield a single global scalar for each listed
|
2009-04-28 22:56:27 +08:00
|
|
|
input. If the compute reduce/region command is used, the selection of
|
|
|
|
atoms is limited to atoms in the region as well as in the group. The
|
|
|
|
resulting value(s) can be accessed by any command that uses global
|
|
|
|
computes, e.g. the "thermo custom"_therml_style.html command or "fix
|
|
|
|
ave/time"_fix_ave_time.html command or by a "variable"_variable.html
|
|
|
|
command. See "this section"_Section_howto.html#4_15 of the
|
|
|
|
documentation for an overview of output options.
|
2008-02-20 23:00:04 +08:00
|
|
|
|
|
|
|
The reduction operation is specified by the {mode} setting. The {sum}
|
|
|
|
option adds the per-atom quantities into a global total. The {min} or
|
|
|
|
{max} options find the minimum or maximum value across all per-atom
|
|
|
|
quantities.
|
|
|
|
|
|
|
|
Each listed input is operated on independently. The group specified
|
|
|
|
with the command means only atoms within the group contribute to the
|
2009-04-28 22:56:27 +08:00
|
|
|
result. If the compute reduce/region command is used, the atoms must
|
|
|
|
also be within the region. Note that the input that produces the
|
|
|
|
per-atom quantities may define its own group which affects the
|
|
|
|
quantities it returns. For example, if a per-atom compute is used as
|
|
|
|
an input, it will generate values of 0.0 for atoms that are not in the
|
|
|
|
group specified for that compute.
|
2008-02-20 23:00:04 +08:00
|
|
|
|
|
|
|
Each listed input can be an atom attribute (position, velocity, force
|
|
|
|
component) or can be the result of a "compute"_compute.html or
|
|
|
|
"fix"_fix.html or the evaluation of an atom-style
|
|
|
|
"variable"_variable.html. In the latter cases, the compute, fix, or
|
|
|
|
variable must produce per-atom quantities, not a global quantity.
|
|
|
|
|
|
|
|
"Computes"_compute.html that produce per-atom quantities are those
|
|
|
|
which have the word {atom} in their style name. See the doc pages for
|
|
|
|
individual "fixes"_fix.html to determine which ones produce per-atom
|
|
|
|
quantities. "Variables"_variable.html of style {atom} are the only
|
|
|
|
ones that can be used with this compute since all other variable
|
|
|
|
styles produce global quantities.
|
|
|
|
|
|
|
|
If a single input is specified this compute produces a global scalar
|
|
|
|
value. If multiple inputs are specified, this compute produces a
|
|
|
|
vector of global values, the length of which is equal to the number of
|
|
|
|
inputs specified.
|
|
|
|
|
2008-02-20 23:42:58 +08:00
|
|
|
As discussed below, for {sum} mode, the value(s) produced by this
|
|
|
|
compute are all "extensive", meaning their value scales linearly with
|
|
|
|
the number of atoms involved. If normalized values are desired, this
|
|
|
|
compute can be accessed by the "thermo_style custom"_thermo_style.html
|
|
|
|
command with "thermo_modify norm yes"_thermo_modify.html set as an
|
|
|
|
option. Or it can be accessed by a "variable"_variable.html that
|
|
|
|
divides by the appropriate atom count.
|
2008-02-20 23:00:04 +08:00
|
|
|
|
|
|
|
[Output info:]
|
|
|
|
|
2008-02-20 23:42:58 +08:00
|
|
|
For {sum} mode, the scalar and vector values calculated by this
|
|
|
|
compute are "extensive", meaning they scale with the number of atoms
|
|
|
|
in the simulation. For {min} and {max} modes, the value(s) are
|
|
|
|
intensive.
|
2008-02-20 23:00:04 +08:00
|
|
|
|
|
|
|
[Restrictions:] none
|
|
|
|
|
|
|
|
[Related commands:]
|
|
|
|
|
|
|
|
"compute"_compute.html, "fix"_fix.html, "variable"_variable.html
|
|
|
|
|
|
|
|
[Default:] none
|