Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 114 additions & 88 deletions doc/src/dump_image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -828,109 +828,134 @@ x-component of velocity if the atom-attribute "vx" was specified.
The basic idea of a color map is that the atom-attribute will be
within a range of values, and that range is associated with a series
of colors (e.g. red, blue, green). An atom's specific value (vx =
-3.2) can then mapped to the series of colors (e.g. halfway between
red and blue), and a specific color is determined via an interpolation
procedure.
-3.2) can then be mapped to a specific color. The details of the
mapping procedure depend on the *style* of the color map, as explained
below.

There are many possible options for the color map, enabled by the
*amap* keyword. Here are the details.
There are many possible options for defining a color map, enabled by
the *amap* keyword. Here are the details.

The *lo* and *hi* settings determine the range of values allowed for
the atom attribute. If numeric values are used for *lo* and/or *hi*,
then values that are lower/higher than that value are set to the
value. I.e. the range is static. If *lo* is specified as *min* or
*hi* as *max* then the range is dynamic, and the lower and/or
upper bound will be calculated each time an image is drawn, based
on the set of atoms being visualized.
then individual atom values which are lower/higher than lo/hi are set
to lo/hi for purposes of determining the atom's color. I.e. the range
is static. If *lo* is specified as *min* or *hi* as *max* then the
range is dynamic. The lower and/or upper bound will be calculated
each time an image is drawn, based on the current atom values of all
the atoms being visualized.

The *style* setting is two letters, such as "ca". The first letter is
either "c" for continuous, "d" for discrete, or "s" for sequential.
The second letter is either "a" for absolute, or "f" for fractional.

A continuous color map is one in which the color changes continuously
from value to value within the range. A discrete color map is one in
which discrete colors are assigned to sub-ranges of values within the
range. A sequential color map is one in which discrete colors are
assigned to a sequence of sub-ranges of values covering the entire
range.

An absolute color map is one in which the values to which colors are
assigned are specified explicitly as values within the range. A
fractional color map is one in which the values to which colors are
assigned are specified as a fractional portion of the range. For
example if the range is from -10.0 to 10.0, and the color red is to be
assigned to atoms with a value of 5.0, then for an absolute color map
the number 5.0 would be used. But for a fractional map, the number
0.75 would be used since 5.0 is 3/4 of the way from -10.0 to 10.0.
A *continuous* color map is one in which the color of an atom changes
continuously as its attribute value increases within the range.
Colors are assigned to specific values within the range; an atom with
an attribue value between two adjacent specific values is assigned a
color interpolated between the two adjacent colors.

A *discrete* color map is one in which discrete colors are assigned to
sub-ranges of values within the overall range. Each sub-range can be
of variable width and overlap with other sub-ranges. An atom with an
attribute value is mapped to one of the sub-ranges and assigned that
color.

A *sequential* color map is similar to a discrete color map except that
all sub-ranges are of equal width and discrete colors are assigned to
each sub-range in a round-robin fashion until the overall range is
covered from *lo* to *hi*.

An *absolute* color map is one in which the numeric settings
associated with assigned colors are specified explicitly as values
within the range.

A *fractional* color map is one in which the numeric settings
associated with assigned colors are specified as a fractional position
within the range.

For a continuous color map, the numeric settings are the specific
values each color is assigned to. For a discrete color map, the
numeric settings are the bounds of each sub-range. For a sequential
color map, the numeric settings is the width of all the sub-ranges.
For example if the overall range is from -10.0 to 10.0, and the color
red is to be assigned to atoms with an attribute value of 5.0, then
for an absolute color map the numeric value of 5.0 should map to red.
But for a fractional map, the numeric value of 0.75 should map to red,
since 5.0 is 3/4 of the way from -10.0 to 10.0.

The *delta* setting must be specified for all styles, but is only used
for the sequential style; otherwise the value is ignored. It
specifies the bin size to use within the range for assigning
consecutive colors to. For example, if the range is from :math:`-10.0` to
:math:`10.0` and a *delta* of :math:`1.0` is used, then 20 colors will be
assigned to the range. The first will be from
:math:`-10.0 \le \text{color1} < -9.0`, then second from
for the *sequential* style; otherwise the setting is ignored. It
specifies the bin size of the sub-ranges of values described above,
For example, if the overall range is from :math:`-10.0` to
:math:`10.0` and a *delta* of :math:`1.0` is used, then 20 colors will
be assigned to a series of sub-ranges. The first sub-range will be
from :math:`-10.0 \le \text{color1} < -9.0`, the second from
:math:`-9.0 \le color2 < -8.0`, etc.

The *N* setting is how many entries follow. The format of the entries
depends on whether the color map style is continuous, discrete or
sequential. In all cases the *color* setting can be any of the 140
pre-defined colors (see below) or a color name defined by the
dump_modify color option.

For continuous color maps, each entry has a *value* and a *color*\ .
The *value* is either a number within the range of values or *min* or
*max*\ . The *value* of the first entry must be *min* and the *value*
of the last entry must be *max*\ . Any entries in between must have
increasing values. Note that numeric values can be specified either
as absolute numbers or as fractions (0.0 to 1.0) of the range,
depending on the "a" or "f" in the style setting for the color map.

Here is how the entries are used to determine the color of an individual
atom, given the value :math:`X` of its atom attribute. :math:`X` will
fall between 2 of the entry values. The color of the atom is linearly
interpolated (in each of the RGB values) between the 2 colors associated
with those entries. For example, if :math:`X = -5.0` and the two
surrounding entries are "red" at :math:`-10.0` and "blue" at
:math:`0.0`, then the atom's color will be halfway between "red" and
"blue", which happens to be "purple".

For discrete color maps, each entry has a *lo* and *hi* value and a
The *N* setting is how many color entries follow. The format of each
color entry depends on whether the color map style is continuous,
discrete, or sequential. For each entry, the specified *color* can be
any of the 140 pre-defined colors (see below) or a color name defined
by the dump_modify color option.

For *continuous* color maps, each entry has a *value* and a *color*\ .
The *value* is either a number within the *lo/hi* range of values or
*min* or *max*\ . The *value* for the first entry must be *min* and
the *value* for the last entry must be *max*\ . In-between entries
must have increasing numeric values. There must be 2 or more entries.
Note that numeric values are specified either as absolute numbers or
as fractions (0.0 to 1.0) of the range, depending on the "a" or "f" in
the style setting for the color map.

Here is how the *N* entries are used to determine the color of an
individual atom, based on the value :math:`X` of its atom attribute.
:math:`X` will fall between 2 of the entry values. The color of the
atom is linearly interpolated (in each of the RGB values) between the
2 colors associated with those entries. For example, if :math:`X =
-5.0` and the two surrounding entries are "red" at :math:`-10.0` and
"blue" at :math:`0.0`, then the atom's color will be halfway between
"red" and "blue", which in this case is "purple".

For *discrete* color maps, each entry has a *lo* and *hi* value and a
*color*\ . The *lo* and *hi* settings are either numbers within the
range of values or *lo* can be *min* or *hi* can be *max*\ . The *lo*
and *hi* settings of the last entry must be *min* and *max*\ . Other
range of values or *min* (for *lo) or *max* (for *hi*). The *lo* and
*hi* settings of the last entry must be *min* and *max*\ . Other
entries can have any *lo* and *hi* values and the sub-ranges of
different values can overlap. Note that numeric *lo* and *hi* values
can be specified either as absolute numbers or as fractions (0.0 to 1.0)
of the range, depending on the "a" or "f" in the style setting for the
color map.

Here is how the entries are used to determine the color of an individual
atom, given the value X of its atom attribute. The entries are scanned
from first to last. The first time that *lo* <= X <= *hi*, X is
assigned the color associated with that entry. You can think of the
last entry as assigning a default color (since it will always be matched
by X), and the earlier entries as colors that override the default.
Also note that no interpolation of a color RGB is done. All atoms will
be drawn with one of the colors in the list of entries.

For sequential color maps, each entry has only a *color*\ . Here is how
the entries are used to determine the color of an individual atom,
given the value X of its atom attribute. The range is partitioned
into N bins of width *binsize*\ . Thus X will fall in a specific bin
from 1 to N, say the Mth bin. If it falls on a boundary between 2
bins, it is considered to be in the higher of the 2 bins. Each bin is
assigned a color from the E entries. If E < N, then the colors are
repeated. For example if 2 entries with colors red and green are
specified, then the odd numbered bins will be red and the even bins
green. The color of the atom is the color of its bin. Note that the
sequential color map is really a shorthand way of defining a discrete
color map without having to specify where all the bin boundaries are.
different entries can overlap. There must be one or more entries.
Note that numeric *lo* and *hi* values are specified either as
absolute numbers or as fractions (0.0 to 1.0) of the range, depending
on the "a" or "f" in the style setting for the color map. The lo/hi
values in each sub-range must satisfy lo < hi.

Here is how the *N* entries are used to determine the color of an
individual atom, based on the value :math:`X` of its atom attribute.
The entries are scanned from first to last. The first time that *lo*
<= X <= *hi*, X is assigned the color associated with that entry.
This means can the last entry can be thought of as a default color
(since it will always be matched by X); the earlier entries override
the default. Note that for a *discrete* map, no interpolation of a
color RGB values is done. All atoms will be drawn with one of the
colors in the list of entries.

For *sequential* color maps, each entry has only a *color*\ . There
must be 1 or more entries. Here is how the *N* entries are used to
determine the color of an individual atom, given the value X of its
atom attribute. The range is overlaid with M bins of width *delta*\ ,
the last of which may extend beyond the *hi* boundary of the range.
Thus X will fall in a specific bin from 1 to M. If it falls on a
boundary between 2 bins, it is considered to be in the higher of the 2
bins (except in the case of 2 bins whose boundary is the *hi*
boundary, it is considered to be in the lower of the 2 bins). Each of
the M bins is assigned a color from the *N* entries. If M < *N*, then
the colors are repeated in a round-robin fashion. For example if 2
entries with colors red and green are specified, then the odd numbered
bins will be red and the even bins green. An atom's color is the
color of its bin.

Here is an example of using a sequential color map to color all the
atoms in individual molecules with a different color. See the
examples/pour/in.pour.2d.molecule input script for an example of how
this is used.
atoms in individual molecules with a different color based on its
molecule ID. See the examples/pour/in.pour.2d.molecule input script
for an example of how this is used.

.. code-block:: LAMMPS

Expand All @@ -942,8 +967,9 @@ this is used.
zoom 1.6 adiam 1.5
dump_modify 1 pad 5 amap 0 10 sa 1 10 ${colors}

In this case, 10 colors are defined, and molecule IDs are
mapped to one of the colors, even if there are 1000s of molecules.
In this case, the sequential color map has 10 color entries, and
molecule IDs are mapped to one of the colors, even if there are 1000s
of molecules.

----------

Expand Down
2 changes: 2 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,8 @@
/compute_rattlers_atom.h
/compute_reaxff_atom.cpp
/compute_reaxff_atom.h
/compute_rigid_atom.cpp
/compute_rigid_atom.h
/compute_rigid_local.cpp
/compute_rigid_local.h
/compute_slcsa_atom.cpp
Expand Down
5 changes: 2 additions & 3 deletions src/KOKKOS/atom_vec_sphere_kokkos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,13 +1148,12 @@ struct AtomVecSphereKokkos_PackBorderVel {
_buf(i,6) = _radius(j);
_buf(i,7) = _rmass(j);
if (DEFORM_VREMAP) {
if (_mask(i) & _deform_groupbit) {
if (_mask(j) & _deform_groupbit) {
_buf(i,8) = _v(j,0) + _dvx;
_buf(i,9) = _v(j,1) + _dvy;
_buf(i,10) = _v(j,2) + _dvz;
}
}
else {
} else {
_buf(i,8) = _v(j,0);
_buf(i,9) = _v(j,1);
_buf(i,10) = _v(j,2);
Expand Down
Loading