git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13100 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2015-02-13 16:54:23 +00:00
parent 8f818715f4
commit 85bae27407
42 changed files with 3976 additions and 1295 deletions

View File

@ -2155,39 +2155,49 @@ and thus extract D.
<A NAME = "howto_23"></A><H4>6.23 Using chunks to calculate system properties
</H4>
<P>In LAMMPS, chunks are collections of atoms defined by a <A HREF = "compute_chunk_atom.html">compute
chunk/atom</A> 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:
<P>In LAMMS, "chunks" are collections of atoms, as defined by the
<A HREF = "compute_chunk_atom.html">compute chunk/atom</A> command, which assigns
each atom to a chunk ID (or to no chunk at all). The number of chunks
and the assignment of chunk IDs to atoms can be static or change over
time. Examples of "chunks" are molecules or spatial bins or atoms
with similar values (e.g. coordination number or potential energy).
</P>
<P>The per-atom chunk IDs can be used as input to two other kinds of
commands, to calculate various properties of a system:
</P>
<UL><LI><A HREF = "fix_ave_chunk.html">fix ave/chunk</A>
<LI>a variety of <A HREF = "compute.html">compute */chunk</A> commands
<LI>any of the <A HREF = "compute.html">compute */chunk</A> commands
</UL>
<P>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.
overviewed. Then some examples are given of how to compute different
properties with chunk commands.
</P>
<H5><A HREF = "compute_chunk_atom.html">Compute chunk/atom</A> command
</H5>
<P>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:
<P>This compute can assign atoms to chunks of various styles. Only atoms
in the specified group and optional specified region are assigned to a
chunk. Here are some possible chunk definitions:
</P>
<DIV ALIGN=center><TABLE BORDER=1 >
<TR><TD >atoms in same molecule </TD><TD > chunk ID = molecule ID </TD></TR>
<TR><TD >atoms with same atom type -</TD><TD > chunk ID = atom type </TD></TR>
<TR><TD >atoms of same atom type </TD><TD > chunk ID = atom type </TD></TR>
<TR><TD >all atoms with same atom property (charge, radius, etc) </TD><TD > chunk ID = output of compute property/atom </TD></TR>
<TR><TD >atoms in same cluster </TD><TD > chunk ID = output of compute cluster/atom command </TD></TR>
<TR><TD >atoms in same cluster </TD><TD > chunk ID = output of <A HREF = "compute_cluster_atom.html">compute cluster/atom</A> command </TD></TR>
<TR><TD >atoms in same spatial bin </TD><TD > chunk ID = bin ID </TD></TR>
<TR><TD >atoms in same rigid body </TD><TD > chunk ID = ID of an atom in the body </TD></TR>
<TR><TD >all atoms with same local defect structure </TD><TD > chunk ID = output of compute centro/atom or coord/atom command
<TR><TD >atoms in same rigid body </TD><TD > chunk ID = molecule ID used to define rigid bodies </TD></TR>
<TR><TD >atoms with similar potential energy </TD><TD > chunk ID = output of <A HREF = "compute_pe_atom.html">compute pe/atom</A> </TD></TR>
<TR><TD >atoms with same local defect structure </TD><TD > chunk ID = output of <A HREF = "compute_centro_atom.html">compute centro/atom</A> or <A HREF = "compute_coord_atom.html">compute coord/atom</A> command
</TD></TR></TABLE></DIV>
<P>Note that chunk IDs are integer values, so for atom properties or
computes that produce a floating point value, they will be truncated
to an integer. You could also use the compute in a variable that
scales the floating point value to spread it across multiple intergers.
</P>
<P>Spatial bins can be of various kinds, e.g. 1d bins = slabs, 2d bins =
pencils, 3d bins = boxes, spherical bins, cylindrical bins.
</P>
<P>This compute also calculates the number of chunks <I>Nchunk</I> which is
<P>This compute also calculates the number of chunks <I>Nchunk</I>, which is
used by other commands to tally per-chunk data. <I>Nchunk</I> 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
@ -2197,7 +2207,7 @@ ID), or dynamic (e.g. what spatial bin an atom is in as it moves).
<A HREF = "compute.html">computes</A>, <A HREF = "fix.html">fixes</A>, and
<A HREF = "variable.html">variables</A> 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
per-atom quantity to use as chunk ID. See
<A HREF = "Section_modify.html">Section_modify</A> of the documentation for how to
do this. You can also define a <A HREF = "variable.html">per-atom variable</A> in
the input script that uses a formula to generate a chunk ID for each
@ -2206,55 +2216,55 @@ atom.
<H5><A HREF = "fix_ave_chunk_atom.html">Fix ave/chunk</A> command
</H5>
<P>This fix takes the ID of a <A HREF = "compute_chunk_atom.html">compute
chunk/atom</A> command as input. For each chunk
chunk/atom</A> 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
<A HREF = "compute.html">computes</A>, <A HREF = "fix.html">fixes</A>, and <A HREF = "variable.html">per-atom
velocity, force, charge, potential energy, kinetic energy, stress,
etc. Additional keywords are defined for per-chunk properties like
density and temperature. More generally any per-atom value generated
by other <A HREF = "compute.html">computes</A>, <A HREF = "fix.html">fixes</A>, and <A HREF = "variable.html">per-atom
variables</A>, can be summed over atoms in each chunk.
</P>
<P>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.
chunk.
</P>
<H5>Compute */chunk commands
</H5>
<P>Currently the following computes operate on chunks:
<P>Currently the following computes operate on chunks of atoms to produce
per-chunk values.
</P>
<UL><LI><A HREF = "compute_com_chunk.html">compute com/chunk</A>
<LI><A HREF = "compute_gyration_chunk.html">compute gyration/chunk</A>
<LI><A HREF = "compute_inertia_chunk.html">compute inertia/chunk</A>
<LI><A HREF = "compute_msd_chunk.html">compute msd/chunk</A>
<LI><A HREF = "compute_property_chunk.html">compute property/chunk</A>
<LI><A HREF = "compute_temp_chunk.html">compute temp/chunk</A>
<LI><A HREF = "compute_vcm_chunk.html">compute torque/chunk</A>
<LI><A HREF = "compute_vcm_chunk.html">compute vcm/chunk</A>
</UL>
<P>They each take the ID of a <A HREF = "compute_chunk_atom.html">compute
chunk/atom</A> 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 <A HREF = "compute_property_chunk.html">compute
property/chunk</A> command can be tally the
moments of inertia, mean-squared displacement, temperature, torque,
and velocity of center-of-mass for each chunk of atoms. The <A HREF = "compute_property_chunk.html">compute
property/chunk</A> command can tally the
count of atoms in each chunk and extract other per-chunk properties.
</P>
<P>The reason these various calculations are not part of the <A HREF = "fix_ave_chunk.html">fix
ave/chunk command</A>, 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.
values in each chunk. For example, many of them require calculation
of a center of mass, which requires summing mass*position over the
atoms and then dividing by summed mass.
</P>
<P>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.
output, wih one or more values per chunk. They can be used
in various ways:
</P>
<UL><LI>As input to the <A HREF = "fix_ave_time.html">fix ave/time</A> command, so the
per-chunk values output to a file it creates. The <A HREF = "fix_ave_time.html">fix
ave/time</A> command can also average the values for
each chunk over time if desired.
<UL><LI>As input to the <A HREF = "fix_ave_time.html">fix ave/time</A> command, which can
write the values to a file and optionally time average them.
<LI>As input to the <A HREF = "fix_ave_histo.html">fix ave/histo</A> command to
histogram values across chunks. E.g. a histogram of cluster sizes or
@ -2266,7 +2276,7 @@ largest cluster or fastest diffusing molecule.
</UL>
<H5>Example calculations with chunks
</H5>
<P>Here are chunk commands that can be used to calculate various
<P>Here are eaxmples using chunk commands to calculate various
properties:
</P>
<P>(1) Mimic the deprecated fix ave/spatial command, to average atom