diff --git a/doc/Section_howto.html b/doc/Section_howto.html
index 710f8075a4..49ae77aada 100644
--- a/doc/Section_howto.html
+++ b/doc/Section_howto.html
@@ -34,7 +34,8 @@
6.19 Library interface to LAMMPS
6.20 Calculating thermal conductivity
6.21 Calculating viscosity
-6.22 Calculating a diffusion coefficient
+6.22 Calculating a diffusion coefficient
+6.23 Using chunks to calculate system properties
The example input scripts included in the LAMMPS distribution and highlighted in Section_example also show how to @@ -2146,6 +2147,160 @@ and thus extract D.
In LAMMPS, chunks are collections of atoms defined by a compute +chunk/atom command, which assigns each atom +to a chunk (or to no chunk at all). The per-atom chunk assignments +can be used as input to two other kinds of commands, to calculate +various properties of a system: +
+Here, each of the 3 kinds of chunk-related commands is briefly +overviewed, and some examples given of how to compute +different properties with chunk commands. +
+This compute assigns atoms to chunks of various styles. Only atoms in +the specified group and optional specified region are assigned to a +chunk. Here is a list of possible chunk definitions: +
+| atoms in same molecule | chunk ID = molecule ID |
| atoms with same atom type - | chunk ID = atom type |
| all atoms with same atom property (charge, radius, etc) | chunk ID = output of compute property/atom |
| atoms in same cluster | chunk ID = output of compute cluster/atom command |
| atoms in same spatial bin | chunk ID = bin ID |
| atoms in same rigid body | chunk ID = ID of an atom in the body |
| all atoms with same local defect structure | chunk ID = output of compute centro/atom or coord/atom command + |
Spatial bins can be of various kinds, e.g. 1d bins = slabs, 2d bins = +pencils, 3d bins = boxes, spherical bins, cylindrical bins. +
+This compute also calculates the number of chunks Nchunk which is +used by other commands to tally per-chunk data. Nchunk can be a +static value or change over time (e.g. the number of clusters). The +chunk ID for an individual atom can also be static (e.g. a molecule +ID), or dynamic (e.g. what spatial bin an atom is in as it moves). +
+Note that this compute allows the per-atom output of other +computes, fixes, and +variables to be used to define chunk IDs for each +atom. This means you can write your own compute or fix to output a +per-atom quantity to use as chunk ID; See +Section_modify of the documentation for how to +do this. You can also define a per-atom variable in +the input script that uses a formula to generate a chunk ID for each +atom. +
+This fix takes the ID of a compute +chunk/atom command as input. For each chunk +it then sums one or more specified per-atom values over the atoms in +each chunk. The per-atom values can be any atom property, such as +force, charge, potential energy, kinetic energy, stress. Additional +keywords are allowed for per-chunk properties like density and +temperature. More generally any per-atom value generated by other +computes, fixes, and per-atom +variables, can be summed over atoms in each chunk. +
+Similar to other averaging fixes, this fix allows the summed per-chunk +values to be time-averaged in various ways, and output to a file. The +fix produces a global array as output with one row of values per +chunk. Global arrays or columns thereof can be used as input for +other commands, as described in the following section. +
+Currently the following computes operate on chunks: +
+They each take the ID of a compute +chunk/atom command as input. As their names +indicate, they calculate the center-of-mass, radius of gyration, +moments of inertia, mean-squared displacement, and velocity of +center-of-mass for each chunk of atoms. The compute +property/chunk command can be tally the +count of atoms in each chunk and extract other per-chunk properties. +
+The reason these various calculations are not part of the fix +ave/chunk command, is that each requires a more +complicated operation than simply summing and averaging over per-atom +values in each chunk. Most of them require calculation of a center of +mass, which requires summing mass*position over the atoms and dividing +by summed mass. +
+All of these computes produce a global vector or global array as +output, wih one or more values per chunk. Global vectors or arrays +can be used as input for other commands, e.g. +
+Here are chunk commands that can be used to calculate various +properties: +
+(1) Mimic the deprecated fix ave/spatial command, to average atom +velocity in each spatial bin: +
+Old command: +
+fix ave/spatial +
+New commands: +
+compute chunk/atom +fix ave/chunk +
+(2) Mimincing the deprecated compute msd/molecule command +to compute the mean-squared displacement of each molecule: +
+Old commands: +
+compute molecule/msd +fix ave/time file msd.molecule +
+New commands: +
+compute chunk/atom style +compute molecule/chunk +fix ave/time file msd.molecule +
+(3) print or time ave total force per molecule + average across molecules (variable special functions) +
+(4) histogram of cluster sizes (use fix ave/histo) +
+(5) count of # of atoms with each coord # + don't need chunking, just fix ave/histo on coord/atom +
+(6) ave temperature per bin +
+ bias value = bias-IDuniform or gaussian
+ bias value = bias-ID
bias-ID = ID of a temperature compute that removes a velocity bias
dof value = all or rotate
all = compute temperature of translational and rotational degrees of freedom
@@ -113,10 +113,10 @@ thermostatting.
compute that removes a "bias" velocity from each atom. This allows
compute temp/sphere to compute its thermal temperature after the
translational kinetic energy components have been altered in a
-prescribed way, e.g. to remove a velocity profile. Thermostats that
-use this compute will work with this bias term. See the doc pages for
-individual computes that calculate a temperature and the doc pages for
-fixes that perform thermostatting for more details.
+prescribed way, e.g. to remove a flow velocity profile. Thermostats
+that use this compute will work with this bias term. See the doc
+pages for individual computes that calculate a temperature and the doc
+pages for fixes that perform thermostatting for more details.
For the dof keyword, a setting of all calculates a temperature
that includes both translational and rotational degrees of freedom. A
diff --git a/doc/compute_temp_asphere.txt b/doc/compute_temp_asphere.txt
index ff4a90c610..ce0ba19532 100755
--- a/doc/compute_temp_asphere.txt
+++ b/doc/compute_temp_asphere.txt
@@ -16,7 +16,7 @@ ID, group-ID are documented in "compute"_compute.html command :ulb,l
temp/asphere = style name of this compute command :l
zero or more keyword/value pairs may be appended :l
keyword = {bias} or {dof} :l
- {bias} value = bias-ID{uniform} or {gaussian}
+ {bias} value = bias-ID
bias-ID = ID of a temperature compute that removes a velocity bias
{dof} value = {all} or {rotate}
all = compute temperature of translational and rotational degrees of freedom
@@ -105,10 +105,10 @@ For the {bias} keyword, {bias-ID} refers to the ID of a temperature
compute that removes a "bias" velocity from each atom. This allows
compute temp/sphere to compute its thermal temperature after the
translational kinetic energy components have been altered in a
-prescribed way, e.g. to remove a velocity profile. Thermostats that
-use this compute will work with this bias term. See the doc pages for
-individual computes that calculate a temperature and the doc pages for
-fixes that perform thermostatting for more details.
+prescribed way, e.g. to remove a flow velocity profile. Thermostats
+that use this compute will work with this bias term. See the doc
+pages for individual computes that calculate a temperature and the doc
+pages for fixes that perform thermostatting for more details.
For the {dof} keyword, a setting of {all} calculates a temperature
that includes both translational and rotational degrees of freedom. A
diff --git a/doc/compute_temp_region.html b/doc/compute_temp_region.html
index 21dbdf7b53..c2e2d86c8f 100644
--- a/doc/compute_temp_region.html
+++ b/doc/compute_temp_region.html
@@ -74,12 +74,13 @@ compute.
Unlike other compute styles that calculate temperature, this compute
does not subtract out degrees-of-freedom due to fixes that constrain
-molecular motion, such as fix shake and fix
+motion, such as fix shake and fix
rigid. This is because those degrees of freedom
-(e.g. a constrained bond) can straddle the region boundary, and hence
-the concept is somewhat ill-defined. If needed the number of
-subtracted degrees-of-freedom can be set explicitly using the extra
-option of the compute_modify command.
+(e.g. a constrained bond) could apply to sets of atoms that straddle
+the region boundary, and hence the concept is somewhat ill-defined.
+If needed the number of subtracted degrees-of-freedom can be set
+explicitly using the extra option of the
+compute_modify command.
See this howto section of the manual for
a discussion of different ways to compute temperature and perform
diff --git a/doc/compute_temp_region.txt b/doc/compute_temp_region.txt
index 0cf713ce12..faf95ab34f 100644
--- a/doc/compute_temp_region.txt
+++ b/doc/compute_temp_region.txt
@@ -71,12 +71,13 @@ compute.
Unlike other compute styles that calculate temperature, this compute
does not subtract out degrees-of-freedom due to fixes that constrain
-molecular motion, such as "fix shake"_fix_shake.html and "fix
+motion, such as "fix shake"_fix_shake.html and "fix
rigid"_fix_rigid.html. This is because those degrees of freedom
-(e.g. a constrained bond) can straddle the region boundary, and hence
-the concept is somewhat ill-defined. If needed the number of
-subtracted degrees-of-freedom can be set explicitly using the {extra}
-option of the "compute_modify"_compute_modify.html command.
+(e.g. a constrained bond) could apply to sets of atoms that straddle
+the region boundary, and hence the concept is somewhat ill-defined.
+If needed the number of subtracted degrees-of-freedom can be set
+explicitly using the {extra} option of the
+"compute_modify"_compute_modify.html command.
See "this howto section"_Section_howto.html#howto_16 of the manual for
a discussion of different ways to compute temperature and perform
diff --git a/doc/compute_temp_sphere.html b/doc/compute_temp_sphere.html
index 923dab5045..dcbfd9a28a 100644
--- a/doc/compute_temp_sphere.html
+++ b/doc/compute_temp_sphere.html
@@ -23,7 +23,7 @@
bias value = bias-IDuniform or gaussian
+ bias value = bias-ID
bias-ID = ID of a temperature compute that removes a velocity bias
dof value = all or rotate
all = compute temperature of translational and rotational degrees of freedom
@@ -99,10 +99,10 @@ thermostatting.
compute that removes a "bias" velocity from each atom. This allows
compute temp/sphere to compute its thermal temperature after the
translational kinetic energy components have been altered in a
-prescribed way, e.g. to remove a velocity profile. Thermostats that
-use this compute will work with this bias term. See the doc pages for
-individual computes that calculate a temperature and the doc pages for
-fixes that perform thermostatting for more details.
+prescribed way, e.g. to remove a flow velocity profile. Thermostats
+that use this compute will work with this bias term. See the doc
+pages for individual computes that calculate a temperature and the doc
+pages for fixes that perform thermostatting for more details.
For the dof keyword, a setting of all calculates a temperature
that includes both translational and rotational degrees of freedom. A
diff --git a/doc/compute_temp_sphere.txt b/doc/compute_temp_sphere.txt
index 24885e2378..ca23fca4de 100755
--- a/doc/compute_temp_sphere.txt
+++ b/doc/compute_temp_sphere.txt
@@ -16,7 +16,7 @@ ID, group-ID are documented in "compute"_compute.html command :ulb,l
temp/sphere = style name of this compute command :l
zero or more keyword/value pairs may be appended :l
keyword = {bias} or {dof} :l
- {bias} value = bias-ID{uniform} or {gaussian}
+ {bias} value = bias-ID
bias-ID = ID of a temperature compute that removes a velocity bias
{dof} value = {all} or {rotate}
all = compute temperature of translational and rotational degrees of freedom
@@ -91,10 +91,10 @@ For the {bias} keyword, {bias-ID} refers to the ID of a temperature
compute that removes a "bias" velocity from each atom. This allows
compute temp/sphere to compute its thermal temperature after the
translational kinetic energy components have been altered in a
-prescribed way, e.g. to remove a velocity profile. Thermostats that
-use this compute will work with this bias term. See the doc pages for
-individual computes that calculate a temperature and the doc pages for
-fixes that perform thermostatting for more details.
+prescribed way, e.g. to remove a flow velocity profile. Thermostats
+that use this compute will work with this bias term. See the doc
+pages for individual computes that calculate a temperature and the doc
+pages for fixes that perform thermostatting for more details.
For the {dof} keyword, a setting of {all} calculates a temperature
that includes both translational and rotational degrees of freedom. A
diff --git a/doc/dump_modify.html b/doc/dump_modify.html
index a8ab654d53..90cec61922 100644
--- a/doc/dump_modify.html
+++ b/doc/dump_modify.html
@@ -44,6 +44,8 @@
precision arg = power-of-10 value from 10 to 1000000
region arg = region-ID or "none"
scale arg = yes or no
+ sfactor arg = coordinate scaling factor (> 0.0)
+ tfactor arg = time scaling factor (> 0.0)
sort arg = off or id or N or -N
off = no sorting of per-atom lines within a snapshot
id = sort per-atom lines by atom ID
@@ -111,7 +113,7 @@
dump_modify 1 format "%d %d %20.15g %g %g" scale yes
dump_modify myDump image yes scale no flush yes
dump_modify 1 region mySphere thresh x < 0.0 thresh epair >= 3.2
-dump_modify xtcdump precision 10000
+dump_modify xtcdump precision 10000 sfactor 0.1
dump_modify 1 every 1000 nfile 20
dump_modify 1 every v_myVar
dump_modify 1 amap min max cf 0.0 3 min green 0.5 yellow max blue boxcolor red
@@ -364,6 +366,21 @@ nanometer accuracy, e.g. for N = 1000, the coordinates are written to
+The sfactor and tfactor keywords only apply to the dump xtc
+style. They allow customization of the unit conversion factors used
+when writing to XTC files. By default they are initialized for
+whatever units style is being used, to write out
+coordinates in nanometers and time in picoseconds. I.e. for real
+units, LAMMPS defines sfactor = 0.1 and tfactor = 0.001, since the
+Angstroms and fmsec used by real units are 0.1 nm and 0.001 psec
+respectively. If you are using a units system with distance and time
+units far from nm and psec, you may wish to write XTC files with
+different units, since the compression algorithm used in XTC files is
+most effective when the typical magnitude of position data is between
+10.0 and 0.1.
+
+
+
The region keyword only applies to the dump custom, cfg,
image, and movie styles. If specified, only atoms in the region
will be written to the dump file or included in the image/movie. Only
diff --git a/doc/dump_modify.txt b/doc/dump_modify.txt
index c5cbd2bff6..bb174a7386 100644
--- a/doc/dump_modify.txt
+++ b/doc/dump_modify.txt
@@ -37,6 +37,8 @@ keyword = {append} or {buffer} or {element} or {every} or {fileper} or {first} o
{precision} arg = power-of-10 value from 10 to 1000000
{region} arg = region-ID or "none"
{scale} arg = {yes} or {no}
+ {sfactor} arg = coordinate scaling factor (> 0.0)
+ {tfactor} arg = time scaling factor (> 0.0)
{sort} arg = {off} or {id} or N or -N
off = no sorting of per-atom lines within a snapshot
id = sort per-atom lines by atom ID
@@ -100,7 +102,7 @@ keyword = {acolor} or {adiam} or {amap} or {backcolor} or {bcolor} or {bdiam} or
dump_modify 1 format "%d %d %20.15g %g %g" scale yes
dump_modify myDump image yes scale no flush yes
dump_modify 1 region mySphere thresh x < 0.0 thresh epair >= 3.2
-dump_modify xtcdump precision 10000
+dump_modify xtcdump precision 10000 sfactor 0.1
dump_modify 1 every 1000 nfile 20
dump_modify 1 every v_myVar
dump_modify 1 amap min max cf 0.0 3 min green 0.5 yellow max blue boxcolor red :pre
@@ -352,6 +354,21 @@ nanometer accuracy, e.g. for N = 1000, the coordinates are written to
:line
+The {sfactor} and {tfactor} keywords only apply to the dump {xtc}
+style. They allow customization of the unit conversion factors used
+when writing to XTC files. By default they are initialized for
+whatever "units"_units.html style is being used, to write out
+coordinates in nanometers and time in picoseconds. I.e. for {real}
+units, LAMMPS defines {sfactor} = 0.1 and {tfactor} = 0.001, since the
+Angstroms and fmsec used by {real} units are 0.1 nm and 0.001 psec
+respectively. If you are using a units system with distance and time
+units far from nm and psec, you may wish to write XTC files with
+different units, since the compression algorithm used in XTC files is
+most effective when the typical magnitude of position data is between
+10.0 and 0.1.
+
+:line
+
The {region} keyword only applies to the dump {custom}, {cfg},
{image}, and {movie} styles. If specified, only atoms in the region
will be written to the dump file or included in the image/movie. Only