Merge remote-tracking branch 'lammps-ro/master' into lammps-icms
This commit is contained in:
@ -151,8 +151,15 @@ style = <em>bin/1d</em> or <em>bin/2d</em> or <em>bin/3d</em> or <em>bin/sphere<
|
||||
delta = thickness of spatial bins in dim (distance units)
|
||||
<em>bin/sphere</em> args = xorig yorig zorig rmin rmax nrbin
|
||||
xorig,yorig,zorig = center point of sphere
|
||||
rmin,rmax = bin from radius rmin to rmax
|
||||
nrbin = # of bins between rmin and rmax
|
||||
srmin,srmax = bin from sphere radius rmin to rmax
|
||||
nsbin = # of bins between rmin and rmax
|
||||
<em>bin/cylinder</em> args = dim origin delta c1 c2 rmin rmax nrbin
|
||||
dim = <em>x</em> or <em>y</em> or <em>z</em> = axis of cylinder axis
|
||||
origin = <em>lower</em> or <em>center</em> or <em>upper</em> or coordinate value (distance units)
|
||||
delta = thickness of spatial bins in dim (distance units)
|
||||
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
|
||||
crmin,crmax = bin from cylinder radius rmin to rmax (distance units)
|
||||
ncbin = # of bins between rmin and rmax
|
||||
<em>type</em> args = none
|
||||
<em>molecule</em> args = none
|
||||
<em>compute/fix/variable</em> = c_ID, c_ID[I], f_ID, f_ID[I], v_name with no args
|
||||
@ -200,6 +207,8 @@ style = <em>bin/1d</em> or <em>bin/2d</em> or <em>bin/3d</em> or <em>bin/sphere<
|
||||
compute 1 all chunk/atom bin/1d z lower 0.02 units reduced
|
||||
compute 1 all chunk/atom bin/2d z lower 1.0 y 0.0 2.5
|
||||
compute 1 all chunk/atom molecule region sphere nchunk once ids once compress yes
|
||||
compute 1 all chunk/atom bin/sphere 5 5 5 2.0 5.0 5 discard yes
|
||||
compute 1 all chunk/atom bin/cylinder z lower 2 10 10 2.0 5.0 3 discard yes
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -279,11 +288,39 @@ box and an <em>origin</em> of 1.0 means to start layers at the upper “b
|
||||
cross “c” face of the box. A <em>delta</em> value of 0.1 in <em>reduced</em> units
|
||||
means there will be 10 layers from 0.0 to 1.0, regardless of the
|
||||
current size or shape of the simulation box.</p>
|
||||
<p>The <em>bin/sphere</em> style defines a set of spherical shells around the
|
||||
origin (<em>xorig</em>,*yorig*,*zorig*), using <em>nsbin</em> shells with radii
|
||||
equally spaced between <em>srmin</em> and <em>srmax</em>, for effectively a 1d
|
||||
vector of bins. For example, if <em>srmin</em> = 1.0 and <em>srmax</em> = 10.0 and
|
||||
<em>nsbin</em> = 9, then the first bin spans 1.0 < r < 2.0, and the last bin
|
||||
spans 9.0 < r 10.0. The geometry of the bins is the same whether the
|
||||
simulation box is orthogonal or triclinic; i.e. the spherical shells
|
||||
are not tilted or scaled differently in different dimensions to
|
||||
transform them into ellipsoidal shells.</p>
|
||||
<p>The <em>bin/cylinder</em> style defines bins for a cylinder oriented along
|
||||
the axis <em>dim</em> with the axis position in the other two radial
|
||||
dimensions at (<em>c1</em>,*c2*). For dim = x, c1/c2 = y/z; for dim = y,
|
||||
c1/c2 = x/z; for dim = z, c1/c2 = x/y. These can be thought of as a
|
||||
2d array of bins, each of which is a pie-shaped wedge (radial
|
||||
dimensions) of finite height (along the cylinder axis). The bin size
|
||||
and positions along the cylinder axis are specified by the <em>origin</em>
|
||||
and <em>delta</em> values, the same as for the <em>bin/1d</em>, <em>bin/2d</em>, and
|
||||
<em>bin/3d</em> styles. There are <em>ncbin</em> concentric circles in the radial
|
||||
direction from the cylinder axis with radii equally spaced between
|
||||
<em>crmin</em> and <em>crmax</em>. For example, if <em>crmin</em> = 1.0 and <em>crmax</em> = 10.0
|
||||
and <em>ncbin</em> = 9, then the first bin spans 1.0 < r < 2.0, and the last
|
||||
bin spans 9.0 < r 10.0. The geometry of the bins in the radial
|
||||
dimensions is the same whether the simulation box is orthogonal or
|
||||
triclinic; i.e. the circles are not tilted or scaled differently in
|
||||
the two different dimensions to transform them into ellipses.</p>
|
||||
<p>The created bins (and hence the chunk IDs) are numbered consecutively
|
||||
from 1 to the number of bins = <em>Nchunk</em>. For 2d and 3d bins, the
|
||||
numbering varies most rapidly in the first dimension (which could be
|
||||
x, y, or z), next rapidly in the 2nd dimension, and most slowly in the
|
||||
3rd dimension.</p>
|
||||
3rd dimension. For spherical 1d bins, the innermost shell is chunk 1
|
||||
and the outermost shell is chunk Nchunk = <em>nsbin</em>. For cylindrical
|
||||
2d bins, the numbering varies most rapidly in the dimension along the
|
||||
cylinder axis and most slowly in the radial direction.</p>
|
||||
<p>Each time this compute is invoked, each atom is mapped to a bin based
|
||||
on its current position. Note that between reneighboring timesteps,
|
||||
atoms can move outside the current simulation box. If the box is
|
||||
@ -518,12 +555,13 @@ the default, then every “discard” atom has its chunk ID set to 0. I
|
||||
<em>Nchunk</em>. I.e. it becomes part of the last chunk.</p>
|
||||
<p>The <em>binning</em> styles use the <em>discard</em> keyword to decide whether to
|
||||
discard atoms outside the spatial domain covered by bins, or to assign
|
||||
them to the bin they are nearest to. Details are as follows.</p>
|
||||
<p>If <em>discard</em> is set to <em>yes</em>, an out-of-domain atom will have its
|
||||
chunk ID set to 0. If <em>discard</em> is set to <em>no</em>, the atom will have
|
||||
its chunk ID set to the first or last bin in that dimension. If
|
||||
(discard* is set to <em>mixed</em>, which is the default, it will only have
|
||||
its chunk ID set to the first or last bin if bins extend to the
|
||||
them to the bin they are nearest to.</p>
|
||||
<p>For the <em>bin/1d</em>, <em>bin/2d</em>, <em>bin/3d</em> styles the details are as
|
||||
follows. If <em>discard</em> is set to <em>yes</em>, an out-of-domain atom will
|
||||
have its chunk ID set to 0. If <em>discard</em> is set to <em>no</em>, the atom
|
||||
will have its chunk ID set to the first or last bin in that dimension.
|
||||
If <em>discard</em> is set to <em>mixed</em>, which is the default, it will only
|
||||
have its chunk ID set to the first or last bin if bins extend to the
|
||||
simulation box boundary in that dimension. This is the case if the
|
||||
<em>bound</em> keyword settings are <em>lower</em> and <em>upper</em>, which is the
|
||||
default. If the <em>bound</em> keyword settings are numeric values, then the
|
||||
@ -533,24 +571,62 @@ last bin extends beyond the numeric <em>bounds</em> settings, depending on
|
||||
the specified <em>origin</em>. If this is the case, the chunk ID of the atom
|
||||
is only set to 0 if it is outside the first or last bin, not if it is
|
||||
simply outside the numeric <em>bounds</em> setting.</p>
|
||||
<p>For the <em>bin/sphere</em> style the details are as follows. If <em>discard</em>
|
||||
is set to <em>yes</em>, an out-of-domain atom will have its chunk ID set to
|
||||
0. If <em>discard</em> is set to <em>no</em> or <em>mixed</em>, the atom will have its
|
||||
chunk ID set to the first or last bin, i.e. the innermost or outermost
|
||||
spherical shell. If the distance of the atom from the origin is less
|
||||
than <em>rmin</em>, it will be assigned to the first bin. If the distance of
|
||||
the atom from the origin is greater than <em>rmax</em>, it will be assigned
|
||||
to the last bin.</p>
|
||||
<p>For the <em>bin/cylinder</em> style the details are as follows. If <em>discard</em>
|
||||
is set to <em>yes</em>, an out-of-domain atom will have its chunk ID set to
|
||||
0. If <em>discard</em> is set to <em>no</em>, the atom will have its chunk ID set
|
||||
to the first or last bin in both the radial and axis dimensions. If
|
||||
<em>discard</em> is set to <em>mixed</em>, which is the default, the the radial
|
||||
dimension is treated the same as for <em>discard</em> = no. But for the axis
|
||||
dimensinon, it will only have its chunk ID set to the first or last
|
||||
bin if bins extend to the simulation box boundary in the axis
|
||||
dimension. This is the case if the <em>bound</em> keyword settings are
|
||||
<em>lower</em> and <em>upper</em>, which is the default. If the <em>bound</em> keyword
|
||||
settings are numeric values, then the atom will have its chunk ID set
|
||||
to 0 if it is outside the bounds of any bin. Note that in this case,
|
||||
it is possible that the first or last bin extends beyond the numeric
|
||||
<em>bounds</em> settings, depending on the specified <em>origin</em>. If this is
|
||||
the case, the chunk ID of the atom is only set to 0 if it is outside
|
||||
the first or last bin, not if it is simply outside the numeric
|
||||
<em>bounds</em> setting.</p>
|
||||
<p>If <em>discard</em> is set to <em>no</em> or <em>mixed</em>, the atom will have its
|
||||
chunk ID set to the first or last bin, i.e. the innermost or outermost
|
||||
spherical shell. If the distance of the atom from the origin is less
|
||||
than <em>rmin</em>, it will be assigned to the first bin. If the distance of
|
||||
the atom from the origin is greater than <em>rmax</em>, it will be assigned
|
||||
to the last bin.</p>
|
||||
<hr class="docutils" />
|
||||
<p>The <em>bound</em> keyword only applies to the <em>binning</em> styles; otherwise it
|
||||
is ignored. It can be used one or more times to limit the extent of
|
||||
bin coverage in a specified dimension, i.e. to only bin a portion of
|
||||
the box. If the <em>lo</em> setting is <em>lower</em> or the <em>hi</em> setting is
|
||||
<em>upper</em>, the bin extent in that direction extends to the box boundary.
|
||||
If a numeric value is used for <em>lo</em> and/or <em>hi</em>, then the bin extent
|
||||
in the <em>lo</em> or <em>hi</em> direction extends only to that value, which is
|
||||
assumed to be inside (or at least near) the simulation box boundaries,
|
||||
though LAMMPS does not check for this. Note that using the <em>bound</em>
|
||||
keyword typically reduces the total number of bins and thus the number
|
||||
of chunks <em>Nchunk</em>.</p>
|
||||
<p>The <em>bound</em> keyword only applies to the <em>bin/1d</em>, <em>bin/2d</em>, <em>bin/3d</em>
|
||||
styles and to the axis dimension of the <em>bin/cylinder</em> style;
|
||||
otherwise it is ignored. It can be used one or more times to limit
|
||||
the extent of bin coverage in a specified dimension, i.e. to only bin
|
||||
a portion of the box. If the <em>lo</em> setting is <em>lower</em> or the <em>hi</em>
|
||||
setting is <em>upper</em>, the bin extent in that direction extends to the
|
||||
box boundary. If a numeric value is used for <em>lo</em> and/or <em>hi</em>, then
|
||||
the bin extent in the <em>lo</em> or <em>hi</em> direction extends only to that
|
||||
value, which is assumed to be inside (or at least near) the simulation
|
||||
box boundaries, though LAMMPS does not check for this. Note that
|
||||
using the <em>bound</em> keyword typically reduces the total number of bins
|
||||
and thus the number of chunks <em>Nchunk</em>.</p>
|
||||
<p>The <em>units</em> keyword only applies to the <em>binning</em> styles; otherwise it
|
||||
is ignored. It determines the meaning of the distance units used for
|
||||
the bin sizes <em>delta</em> and for <em>origin</em> and <em>bounds</em> values if they are
|
||||
coordinate values. For orthogonal simulation boxes, any of the 3
|
||||
options may be used. For non-orthogonal (triclinic) simulation boxes,
|
||||
only the <em>reduced</em> option may be used.</p>
|
||||
is ignored. For the <em>bin/1d</em>, <em>bin/2d</em>, <em>bin/3d</em> styles, it
|
||||
determines the meaning of the distance units used for the bin sizes
|
||||
<em>delta</em> and for <em>origin</em> and <em>bounds</em> values if they are coordinate
|
||||
values. For the <em>bin/sphere</em> style it determines the meaning of the
|
||||
distance units used for <em>xorig</em>,*yorig*,*zorig* and the radii <em>srmin</em>
|
||||
and <em>srmax</em>. For the <em>bin/cylinder</em> style it determines the meaning
|
||||
of the distance units used for <em>delta</em>,*c1*,*c2* and the radii <em>crmin</em>
|
||||
and <em>crmax</em>.</p>
|
||||
<p>For orthogonal simulation boxes, any of the 3 options may
|
||||
be used. For non-orthogonal (triclinic) simulation boxes, only the
|
||||
<em>reduced</em> option may be used.</p>
|
||||
<p>A <em>box</em> value selects standard distance units as defined by the
|
||||
<a class="reference internal" href="units.html"><em>units</em></a> command, e.g. Angstroms for units = real or metal.
|
||||
A <em>lattice</em> value means the distance units are in lattice spacings.
|
||||
@ -560,6 +636,13 @@ unitless values between 0 and 1, which represent the lower and upper
|
||||
faces of the simulation box respectively. Thus an <em>origin</em> value of
|
||||
0.5 means the center of the box in any dimension. A <em>delta</em> value of
|
||||
0.1 means 10 bins span the box in that dimension.</p>
|
||||
<p>Note that for the <em>bin/sphere</em> style, the radii <em>srmin</em> and <em>srmax</em> are
|
||||
scaled by the lattice spacing or reduced value of the <em>x</em> dimension.</p>
|
||||
<p>Note that for the <em>bin/cylinder</em> style, the radii <em>crmin</em> and <em>crmax</em>
|
||||
are scaled by the lattice spacing or reduced value of the 1st
|
||||
dimension perpendicular to the cylinder axis. E.g. y for an x-axis
|
||||
cylinder, x for a y-axis cylinder, and x for a z-axis cylinder.</p>
|
||||
<hr class="docutils" />
|
||||
<p><strong>Output info:</strong></p>
|
||||
<p>This compute calculates a per-atom vector, which can be accessed by
|
||||
any command that uses per-atom values from a compute as input. See
|
||||
@ -586,18 +669,18 @@ the restarted simulation begins.</p>
|
||||
<p>The option defaults are as follows:</p>
|
||||
<ul class="simple">
|
||||
<li>region = none</li>
|
||||
<li>nchunk = every if compress is yes, overriding other defaults listed here</li>
|
||||
<li>nchunk = once for type style</li>
|
||||
<li>nchunk = once for mol style if region is none</li>
|
||||
<li>nchunk = every for mol style if region is set</li>
|
||||
<li>nchunk = once for binning style if the simulation box size is static or units = reduced</li>
|
||||
<li>nchunk = every for binning style if the simulation box size is dynamic and units is lattice or box</li>
|
||||
<li>nchunk = every for compute/fix/variable style</li>
|
||||
<li>nchunk = every, if compress is yes, overriding other defaults listed here</li>
|
||||
<li>nchunk = once, for type style</li>
|
||||
<li>nchunk = once, for mol style if region is none</li>
|
||||
<li>nchunk = every, for mol style if region is set</li>
|
||||
<li>nchunk = once, for binning style if the simulation box size is static or units = reduced</li>
|
||||
<li>nchunk = every, for binning style if the simulation box size is dynamic and units is lattice or box</li>
|
||||
<li>nchunk = every, for compute/fix/variable style</li>
|
||||
<li>limit = 0</li>
|
||||
<li>ids = every</li>
|
||||
<li>compress = no</li>
|
||||
<li>discard = yes for all styles except binning</li>
|
||||
<li>discard = mixed for binning styles</li>
|
||||
<li>discard = yes, for all styles except binning</li>
|
||||
<li>discard = mixed, for binning styles</li>
|
||||
<li>bound = lower and upper in all dimensions</li>
|
||||
<li>units = lattice</li>
|
||||
</ul>
|
||||
|
||||
@ -29,8 +29,15 @@ style = {bin/1d} or {bin/2d} or {bin/3d} or {bin/sphere} or {type} or {molecule}
|
||||
delta = thickness of spatial bins in dim (distance units)
|
||||
{bin/sphere} args = xorig yorig zorig rmin rmax nrbin
|
||||
xorig,yorig,zorig = center point of sphere
|
||||
rmin,rmax = bin from radius rmin to rmax
|
||||
nrbin = # of bins between rmin and rmax
|
||||
srmin,srmax = bin from sphere radius rmin to rmax
|
||||
nsbin = # of bins between rmin and rmax
|
||||
{bin/cylinder} args = dim origin delta c1 c2 rmin rmax nrbin
|
||||
dim = {x} or {y} or {z} = axis of cylinder axis
|
||||
origin = {lower} or {center} or {upper} or coordinate value (distance units)
|
||||
delta = thickness of spatial bins in dim (distance units)
|
||||
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
|
||||
crmin,crmax = bin from cylinder radius rmin to rmax (distance units)
|
||||
ncbin = # of bins between rmin and rmax
|
||||
{type} args = none
|
||||
{molecule} args = none
|
||||
{compute/fix/variable} = c_ID, c_ID\[I\], f_ID, f_ID\[I\], v_name with no args
|
||||
@ -74,7 +81,9 @@ keyword = {region} or {nchunk} or {static} or {compress} or {bound} or {discard}
|
||||
compute 1 all chunk/atom type
|
||||
compute 1 all chunk/atom bin/1d z lower 0.02 units reduced
|
||||
compute 1 all chunk/atom bin/2d z lower 1.0 y 0.0 2.5
|
||||
compute 1 all chunk/atom molecule region sphere nchunk once ids once compress yes :pre
|
||||
compute 1 all chunk/atom molecule region sphere nchunk once ids once compress yes
|
||||
compute 1 all chunk/atom bin/sphere 5 5 5 2.0 5.0 5 discard yes
|
||||
compute 1 all chunk/atom bin/cylinder z lower 2 10 10 2.0 5.0 3 discard yes :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
@ -174,11 +183,41 @@ cross "c" face of the box. A {delta} value of 0.1 in {reduced} units
|
||||
means there will be 10 layers from 0.0 to 1.0, regardless of the
|
||||
current size or shape of the simulation box.
|
||||
|
||||
The {bin/sphere} style defines a set of spherical shells around the
|
||||
origin ({xorig},{yorig},{zorig}), using {nsbin} shells with radii
|
||||
equally spaced between {srmin} and {srmax}, for effectively a 1d
|
||||
vector of bins. For example, if {srmin} = 1.0 and {srmax} = 10.0 and
|
||||
{nsbin} = 9, then the first bin spans 1.0 < r < 2.0, and the last bin
|
||||
spans 9.0 < r 10.0. The geometry of the bins is the same whether the
|
||||
simulation box is orthogonal or triclinic; i.e. the spherical shells
|
||||
are not tilted or scaled differently in different dimensions to
|
||||
transform them into ellipsoidal shells.
|
||||
|
||||
The {bin/cylinder} style defines bins for a cylinder oriented along
|
||||
the axis {dim} with the axis position in the other two radial
|
||||
dimensions at ({c1},{c2}). For dim = x, c1/c2 = y/z; for dim = y,
|
||||
c1/c2 = x/z; for dim = z, c1/c2 = x/y. These can be thought of as a
|
||||
2d array of bins, each of which is a pie-shaped wedge (radial
|
||||
dimensions) of finite height (along the cylinder axis). The bin size
|
||||
and positions along the cylinder axis are specified by the {origin}
|
||||
and {delta} values, the same as for the {bin/1d}, {bin/2d}, and
|
||||
{bin/3d} styles. There are {ncbin} concentric circles in the radial
|
||||
direction from the cylinder axis with radii equally spaced between
|
||||
{crmin} and {crmax}. For example, if {crmin} = 1.0 and {crmax} = 10.0
|
||||
and {ncbin} = 9, then the first bin spans 1.0 < r < 2.0, and the last
|
||||
bin spans 9.0 < r 10.0. The geometry of the bins in the radial
|
||||
dimensions is the same whether the simulation box is orthogonal or
|
||||
triclinic; i.e. the circles are not tilted or scaled differently in
|
||||
the two different dimensions to transform them into ellipses.
|
||||
|
||||
The created bins (and hence the chunk IDs) are numbered consecutively
|
||||
from 1 to the number of bins = {Nchunk}. For 2d and 3d bins, the
|
||||
numbering varies most rapidly in the first dimension (which could be
|
||||
x, y, or z), next rapidly in the 2nd dimension, and most slowly in the
|
||||
3rd dimension.
|
||||
3rd dimension. For spherical 1d bins, the innermost shell is chunk 1
|
||||
and the outermost shell is chunk Nchunk = {nsbin}. For cylindrical
|
||||
2d bins, the numbering varies most rapidly in the dimension along the
|
||||
cylinder axis and most slowly in the radial direction.
|
||||
|
||||
Each time this compute is invoked, each atom is mapped to a bin based
|
||||
on its current position. Note that between reneighboring timesteps,
|
||||
@ -463,13 +502,14 @@ the default, then every "discard" atom has its chunk ID set to 0. If
|
||||
|
||||
The {binning} styles use the {discard} keyword to decide whether to
|
||||
discard atoms outside the spatial domain covered by bins, or to assign
|
||||
them to the bin they are nearest to. Details are as follows.
|
||||
them to the bin they are nearest to.
|
||||
|
||||
If {discard} is set to {yes}, an out-of-domain atom will have its
|
||||
chunk ID set to 0. If {discard} is set to {no}, the atom will have
|
||||
its chunk ID set to the first or last bin in that dimension. If
|
||||
(discard} is set to {mixed}, which is the default, it will only have
|
||||
its chunk ID set to the first or last bin if bins extend to the
|
||||
For the {bin/1d}, {bin/2d}, {bin/3d} styles the details are as
|
||||
follows. If {discard} is set to {yes}, an out-of-domain atom will
|
||||
have its chunk ID set to 0. If {discard} is set to {no}, the atom
|
||||
will have its chunk ID set to the first or last bin in that dimension.
|
||||
If {discard} is set to {mixed}, which is the default, it will only
|
||||
have its chunk ID set to the first or last bin if bins extend to the
|
||||
simulation box boundary in that dimension. This is the case if the
|
||||
{bound} keyword settings are {lower} and {upper}, which is the
|
||||
default. If the {bound} keyword settings are numeric values, then the
|
||||
@ -480,26 +520,68 @@ the specified {origin}. If this is the case, the chunk ID of the atom
|
||||
is only set to 0 if it is outside the first or last bin, not if it is
|
||||
simply outside the numeric {bounds} setting.
|
||||
|
||||
For the {bin/sphere} style the details are as follows. If {discard}
|
||||
is set to {yes}, an out-of-domain atom will have its chunk ID set to
|
||||
0. If {discard} is set to {no} or {mixed}, the atom will have its
|
||||
chunk ID set to the first or last bin, i.e. the innermost or outermost
|
||||
spherical shell. If the distance of the atom from the origin is less
|
||||
than {rmin}, it will be assigned to the first bin. If the distance of
|
||||
the atom from the origin is greater than {rmax}, it will be assigned
|
||||
to the last bin.
|
||||
|
||||
For the {bin/cylinder} style the details are as follows. If {discard}
|
||||
is set to {yes}, an out-of-domain atom will have its chunk ID set to
|
||||
0. If {discard} is set to {no}, the atom will have its chunk ID set
|
||||
to the first or last bin in both the radial and axis dimensions. If
|
||||
{discard} is set to {mixed}, which is the default, the the radial
|
||||
dimension is treated the same as for {discard} = no. But for the axis
|
||||
dimensinon, it will only have its chunk ID set to the first or last
|
||||
bin if bins extend to the simulation box boundary in the axis
|
||||
dimension. This is the case if the {bound} keyword settings are
|
||||
{lower} and {upper}, which is the default. If the {bound} keyword
|
||||
settings are numeric values, then the atom will have its chunk ID set
|
||||
to 0 if it is outside the bounds of any bin. Note that in this case,
|
||||
it is possible that the first or last bin extends beyond the numeric
|
||||
{bounds} settings, depending on the specified {origin}. If this is
|
||||
the case, the chunk ID of the atom is only set to 0 if it is outside
|
||||
the first or last bin, not if it is simply outside the numeric
|
||||
{bounds} setting.
|
||||
|
||||
If {discard} is set to {no} or {mixed}, the atom will have its
|
||||
chunk ID set to the first or last bin, i.e. the innermost or outermost
|
||||
spherical shell. If the distance of the atom from the origin is less
|
||||
than {rmin}, it will be assigned to the first bin. If the distance of
|
||||
the atom from the origin is greater than {rmax}, it will be assigned
|
||||
to the last bin.
|
||||
|
||||
:line
|
||||
|
||||
The {bound} keyword only applies to the {binning} styles; otherwise it
|
||||
is ignored. It can be used one or more times to limit the extent of
|
||||
bin coverage in a specified dimension, i.e. to only bin a portion of
|
||||
the box. If the {lo} setting is {lower} or the {hi} setting is
|
||||
{upper}, the bin extent in that direction extends to the box boundary.
|
||||
If a numeric value is used for {lo} and/or {hi}, then the bin extent
|
||||
in the {lo} or {hi} direction extends only to that value, which is
|
||||
assumed to be inside (or at least near) the simulation box boundaries,
|
||||
though LAMMPS does not check for this. Note that using the {bound}
|
||||
keyword typically reduces the total number of bins and thus the number
|
||||
of chunks {Nchunk}.
|
||||
The {bound} keyword only applies to the {bin/1d}, {bin/2d}, {bin/3d}
|
||||
styles and to the axis dimension of the {bin/cylinder} style;
|
||||
otherwise it is ignored. It can be used one or more times to limit
|
||||
the extent of bin coverage in a specified dimension, i.e. to only bin
|
||||
a portion of the box. If the {lo} setting is {lower} or the {hi}
|
||||
setting is {upper}, the bin extent in that direction extends to the
|
||||
box boundary. If a numeric value is used for {lo} and/or {hi}, then
|
||||
the bin extent in the {lo} or {hi} direction extends only to that
|
||||
value, which is assumed to be inside (or at least near) the simulation
|
||||
box boundaries, though LAMMPS does not check for this. Note that
|
||||
using the {bound} keyword typically reduces the total number of bins
|
||||
and thus the number of chunks {Nchunk}.
|
||||
|
||||
The {units} keyword only applies to the {binning} styles; otherwise it
|
||||
is ignored. It determines the meaning of the distance units used for
|
||||
the bin sizes {delta} and for {origin} and {bounds} values if they are
|
||||
coordinate values. For orthogonal simulation boxes, any of the 3
|
||||
options may be used. For non-orthogonal (triclinic) simulation boxes,
|
||||
only the {reduced} option may be used.
|
||||
is ignored. For the {bin/1d}, {bin/2d}, {bin/3d} styles, it
|
||||
determines the meaning of the distance units used for the bin sizes
|
||||
{delta} and for {origin} and {bounds} values if they are coordinate
|
||||
values. For the {bin/sphere} style it determines the meaning of the
|
||||
distance units used for {xorig},{yorig},{zorig} and the radii {srmin}
|
||||
and {srmax}. For the {bin/cylinder} style it determines the meaning
|
||||
of the distance units used for {delta},{c1},{c2} and the radii {crmin}
|
||||
and {crmax}.
|
||||
|
||||
For orthogonal simulation boxes, any of the 3 options may
|
||||
be used. For non-orthogonal (triclinic) simulation boxes, only the
|
||||
{reduced} option may be used.
|
||||
|
||||
A {box} value selects standard distance units as defined by the
|
||||
"units"_units.html command, e.g. Angstroms for units = real or metal.
|
||||
@ -511,7 +593,14 @@ faces of the simulation box respectively. Thus an {origin} value of
|
||||
0.5 means the center of the box in any dimension. A {delta} value of
|
||||
0.1 means 10 bins span the box in that dimension.
|
||||
|
||||
:line
|
||||
Note that for the {bin/sphere} style, the radii {srmin} and {srmax} are
|
||||
scaled by the lattice spacing or reduced value of the {x} dimension.
|
||||
|
||||
Note that for the {bin/cylinder} style, the radii {crmin} and {crmax}
|
||||
are scaled by the lattice spacing or reduced value of the 1st
|
||||
dimension perpendicular to the cylinder axis. E.g. y for an x-axis
|
||||
cylinder, x for a y-axis cylinder, and x for a z-axis cylinder.
|
||||
|
||||
:line
|
||||
|
||||
[Output info:]
|
||||
@ -542,17 +631,17 @@ the restarted simulation begins.
|
||||
The option defaults are as follows:
|
||||
|
||||
region = none
|
||||
nchunk = every if compress is yes, overriding other defaults listed here
|
||||
nchunk = once for type style
|
||||
nchunk = once for mol style if region is none
|
||||
nchunk = every for mol style if region is set
|
||||
nchunk = once for binning style if the simulation box size is static or units = reduced
|
||||
nchunk = every for binning style if the simulation box size is dynamic and units is lattice or box
|
||||
nchunk = every for compute/fix/variable style
|
||||
nchunk = every, if compress is yes, overriding other defaults listed here
|
||||
nchunk = once, for type style
|
||||
nchunk = once, for mol style if region is none
|
||||
nchunk = every, for mol style if region is set
|
||||
nchunk = once, for binning style if the simulation box size is static or units = reduced
|
||||
nchunk = every, for binning style if the simulation box size is dynamic and units is lattice or box
|
||||
nchunk = every, for compute/fix/variable style
|
||||
limit = 0
|
||||
ids = every
|
||||
compress = no
|
||||
discard = yes for all styles except binning
|
||||
discard = mixed for binning styles
|
||||
discard = yes, for all styles except binning
|
||||
discard = mixed, for binning styles
|
||||
bound = lower and upper in all dimensions
|
||||
units = lattice :ul
|
||||
|
||||
@ -469,11 +469,17 @@ chunk ID of 3 may correspond to an original chunk ID or molecule ID of
|
||||
<a class="reference internal" href="compute_chunk_atom.html"><em>compute chunk/atom</em></a> command. For <em>bin/1d</em>,
|
||||
<em>bin/2d</em>, and <em>bin/3d</em> styles the column values are the center point
|
||||
of the bin in the corresponding dimension. Just Coord1 is used for
|
||||
<em>bin/1d</em>, Coord2 is added for <em>bin/2d</em>, Coord3 is added for <em>bin/3d</em>.</p>
|
||||
<em>bin/1d</em>, Coord2 is added for <em>bin/2d</em>, Coord3 is added for <em>bin/3d</em>.
|
||||
For <em>bin/sphere</em>, just Coord1 is used, and it is the radial
|
||||
coordinate. For <em>bin/cylinder</em>, Coord1 and Coord2 are used. Coord1
|
||||
is the radial coordinate (away from the cylinder axis), and coord2 is
|
||||
the coordinate along the cylinder axis.</p>
|
||||
<p>Note that if the value of the <em>units</em> keyword used in the <a class="reference internal" href="compute_chunk_atom.html"><em>compute chunk/atom command</em></a> is <em>box</em> or <em>lattice</em>, the
|
||||
coordinate values will be in distance <a class="reference internal" href="units.html"><em>units</em></a>. If the
|
||||
value of the <em>units</em> keyword is <em>reduced</em>, the coordinate values will
|
||||
be in unitless reduced units (0-1).</p>
|
||||
be in unitless reduced units (0-1). This is not true for the Coord1 value
|
||||
of style <em>bin/sphere</em> or <em>bin/cylinder</em> which both represent radial
|
||||
dimensions. Those values are always in distance <a class="reference internal" href="units.html"><em>units</em></a>.</p>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="restart-fix-modify-output-run-start-stop-minimize-info">
|
||||
|
||||
@ -395,12 +395,18 @@ The CoordN columns only appear if a {binning} style was used in the
|
||||
{bin/2d}, and {bin/3d} styles the column values are the center point
|
||||
of the bin in the corresponding dimension. Just Coord1 is used for
|
||||
{bin/1d}, Coord2 is added for {bin/2d}, Coord3 is added for {bin/3d}.
|
||||
For {bin/sphere}, just Coord1 is used, and it is the radial
|
||||
coordinate. For {bin/cylinder}, Coord1 and Coord2 are used. Coord1
|
||||
is the radial coordinate (away from the cylinder axis), and coord2 is
|
||||
the coordinate along the cylinder axis.
|
||||
|
||||
Note that if the value of the {units} keyword used in the "compute
|
||||
chunk/atom command"_compute_chunk_atom.html is {box} or {lattice}, the
|
||||
coordinate values will be in distance "units"_units.html. If the
|
||||
value of the {units} keyword is {reduced}, the coordinate values will
|
||||
be in unitless reduced units (0-1).
|
||||
be in unitless reduced units (0-1). This is not true for the Coord1 value
|
||||
of style {bin/sphere} or {bin/cylinder} which both represent radial
|
||||
dimensions. Those values are always in distance "units"_units.html.
|
||||
|
||||
:line
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -392,8 +392,7 @@ void FixGCMC::init()
|
||||
(force->pair == NULL) ||
|
||||
(force->pair->single_enable == 0) ||
|
||||
(force->pair_match("hybrid",0)) ||
|
||||
(force->pair_match("eam",0)) ||
|
||||
(triclinic == 1)
|
||||
(force->pair_match("eam",0))
|
||||
) {
|
||||
full_flag = true;
|
||||
if (comm->me == 0)
|
||||
@ -643,8 +642,8 @@ void FixGCMC::pre_exchange()
|
||||
int random_int_fraction =
|
||||
static_cast<int>(random_equal->uniform()*ncycles) + 1;
|
||||
if (random_int_fraction <= nmcmoves) {
|
||||
if (random_equal->uniform() < 0.5) attempt_molecule_translation_full();
|
||||
else attempt_molecule_rotation_full();
|
||||
if (random_equal->uniform() < 0.5) attempt_molecule_translation_full();
|
||||
else attempt_molecule_rotation_full();
|
||||
} else {
|
||||
if (random_equal->uniform() < 0.5) attempt_molecule_deletion_full();
|
||||
else attempt_molecule_insertion_full();
|
||||
@ -662,12 +661,12 @@ void FixGCMC::pre_exchange()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (triclinic) domain->x2lamda(atom->nlocal);
|
||||
if (triclinic) domain->x2lamda(atom->nlocal);
|
||||
domain->pbc();
|
||||
comm->exchange();
|
||||
atom->nghost = 0;
|
||||
comm->borders();
|
||||
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@ -11,15 +11,7 @@
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
// NOTE: allow for bin center to be variables
|
||||
// is chunk_volume_vec used by other commands, e.g. fix ave/chunk
|
||||
// can't really use reduced since sphere -> ellipsoid
|
||||
// what about triclinic?
|
||||
// bound keyword should not apply, limit is also ignored
|
||||
// discard rules for spherical bins
|
||||
// fix ave/chunk needs to use vector of volumes
|
||||
// setup_sphere_bins() needs work
|
||||
// atombinsphere() needs work
|
||||
// NOTE: allow for bin center to be variables for sphere/cylinder
|
||||
|
||||
#include <mpi.h>
|
||||
#include <string.h>
|
||||
@ -46,7 +38,8 @@
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace MathConst;
|
||||
|
||||
enum{BIN1D,BIN2D,BIN3D,BINSPHERE,TYPE,MOLECULE,COMPUTE,FIX,VARIABLE};
|
||||
enum{BIN1D,BIN2D,BIN3D,BINSPHERE,BINCYLINDER,
|
||||
TYPE,MOLECULE,COMPUTE,FIX,VARIABLE};
|
||||
enum{LOWER,CENTER,UPPER,COORD};
|
||||
enum{BOX,LATTICE,REDUCED};
|
||||
enum{NODISCARD,MIXED,YESDISCARD};
|
||||
@ -103,19 +96,46 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
readdim(narg,arg,iarg+3,1);
|
||||
readdim(narg,arg,iarg+6,2);
|
||||
iarg += 9;
|
||||
|
||||
} else if (strcmp(arg[3],"bin/sphere") == 0) {
|
||||
binflag = 1;
|
||||
which = BINSPHERE;
|
||||
ncoord = 1;
|
||||
iarg = 4;
|
||||
if (iarg+6 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
|
||||
sorigin[0] = force->numeric(FLERR,arg[iarg]);
|
||||
sorigin[1] = force->numeric(FLERR,arg[iarg+1]);
|
||||
sorigin[2] = force->numeric(FLERR,arg[iarg+2]);
|
||||
sradmin = force->numeric(FLERR,arg[iarg+3]);
|
||||
sradmax = force->numeric(FLERR,arg[iarg+4]);
|
||||
nsphere = force->inumeric(FLERR,arg[iarg+5]);
|
||||
sorigin_user[0] = force->numeric(FLERR,arg[iarg]);
|
||||
sorigin_user[1] = force->numeric(FLERR,arg[iarg+1]);
|
||||
sorigin_user[2] = force->numeric(FLERR,arg[iarg+2]);
|
||||
sradmin_user = force->numeric(FLERR,arg[iarg+3]);
|
||||
sradmax_user = force->numeric(FLERR,arg[iarg+4]);
|
||||
nsbin = force->inumeric(FLERR,arg[iarg+5]);
|
||||
iarg += 6;
|
||||
} else if (strcmp(arg[3],"bin/cylinder") == 0) {
|
||||
binflag = 1;
|
||||
which = BINCYLINDER;
|
||||
ncoord = 2;
|
||||
iarg = 4;
|
||||
readdim(narg,arg,iarg,0);
|
||||
iarg += 3;
|
||||
if (dim[0] == 0) {
|
||||
cdim1 = 1;
|
||||
cdim2 = 2;
|
||||
} else if (dim[0] == 1) {
|
||||
cdim1 = 0;
|
||||
cdim2 = 2;
|
||||
} else {
|
||||
cdim1 = 0;
|
||||
cdim2 = 1;
|
||||
}
|
||||
if (iarg+5 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
|
||||
corigin_user[dim[0]] = 0.0;
|
||||
corigin_user[cdim1] = force->numeric(FLERR,arg[iarg]);
|
||||
corigin_user[cdim2] = force->numeric(FLERR,arg[iarg+1]);
|
||||
cradmin_user = force->numeric(FLERR,arg[iarg+2]);
|
||||
cradmax_user = force->numeric(FLERR,arg[iarg+3]);
|
||||
|
||||
ncbin = force->inumeric(FLERR,arg[iarg+4]);
|
||||
iarg += 5;
|
||||
|
||||
} else if (strcmp(arg[3],"type") == 0) {
|
||||
which = TYPE;
|
||||
@ -290,17 +310,24 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
(delta[0] <= 0.0 || delta[1] <= 0.0 || delta[2] <= 0.0))
|
||||
error->all(FLERR,"Illegal compute chunk/atom command");
|
||||
if (which == BINSPHERE) {
|
||||
if (domain->dimension == 2 && sorigin[2] != 0.0)
|
||||
error->all(FLERR,"Sphere z origin must be 0.0 for 2d in "
|
||||
"compute chunk/atom command");
|
||||
if (sradmin <= 0.0 || sradmin >= sradmax || nsphere < 1)
|
||||
if (domain->dimension == 2 && sorigin_user[2] != 0.0)
|
||||
error->all(FLERR,"Compute chunk/atom sphere z origin must be 0.0 for 2d");
|
||||
if (sradmin_user < 0.0 || sradmin_user >= sradmax_user || nsbin < 1)
|
||||
error->all(FLERR,"Illegal compute chunk/atom command");
|
||||
}
|
||||
if (which == BINCYLINDER) {
|
||||
if (delta[0] <= 0.0)
|
||||
error->all(FLERR,"Illegal compute chunk/atom command");
|
||||
if (domain->dimension == 2 && dim[0] != 2)
|
||||
error->all(FLERR,"Compute chunk/atom cylinder axis must be z for 2d");
|
||||
if (cradmin_user < 0.0 || cradmin_user >= cradmax_user || ncbin < 1)
|
||||
error->all(FLERR,"Illegal compute chunk/atom command");
|
||||
}
|
||||
|
||||
if (which == COMPUTE) {
|
||||
int icompute = modify->find_compute(cfvid);
|
||||
if (icompute < 0)
|
||||
error->all(FLERR,"Compute ID for compute chunk/atom does not exist");
|
||||
error->all(FLERR,"Compute ID for compute chunk /atom does not exist");
|
||||
if (modify->compute[icompute]->peratom_flag == 0)
|
||||
error->all(FLERR,
|
||||
"Compute chunk/atom compute does not calculate "
|
||||
@ -358,12 +385,13 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
zscale = domain->lattice->zlattice;
|
||||
} else xscale = yscale = zscale = 1.0;
|
||||
|
||||
// apply scaling factors
|
||||
// apply scaling factors and cylinder dims orthogonal to axis
|
||||
|
||||
if (binflag) {
|
||||
double scale;
|
||||
if (which == BIN1D || which == BIN2D || which == BIN3D) {
|
||||
if (which == BIN1D) ndim = 1;
|
||||
if (which == BIN1D || which == BIN2D || which == BIN3D ||
|
||||
which == BINCYLINDER) {
|
||||
if (which == BIN1D || BINCYLINDER) ndim = 1;
|
||||
if (which == BIN2D) ndim = 2;
|
||||
if (which == BIN3D) ndim = 3;
|
||||
for (int idim = 0; idim < ndim; idim++) {
|
||||
@ -377,11 +405,28 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (maxflag[idim] == COORD) maxvalue[idim] *= scale;
|
||||
}
|
||||
} else if (which == BINSPHERE) {
|
||||
sorigin[0] *= xscale;
|
||||
sorigin[1] *= yscale;
|
||||
sorigin[2] *= zscale;
|
||||
sradmin *= xscale; // radii are scaled by xscale
|
||||
sradmax *= xscale;
|
||||
sorigin_user[0] *= xscale;
|
||||
sorigin_user[1] *= yscale;
|
||||
sorigin_user[2] *= zscale;
|
||||
sradmin_user *= xscale; // radii are scaled by xscale
|
||||
sradmax_user *= xscale;
|
||||
} else if (which == BINCYLINDER) {
|
||||
if (dim[0] == 0) {
|
||||
corigin_user[cdim1] *= yscale;
|
||||
corigin_user[cdim2] *= zscale;
|
||||
cradmin_user *= yscale; // radii are scaled by first non-axis dim
|
||||
cradmax_user *= yscale;
|
||||
} else if (dim[0] == 1) {
|
||||
corigin_user[cdim1] *= xscale;
|
||||
corigin_user[cdim2] *= zscale;
|
||||
cradmin_user *= xscale;
|
||||
cradmax_user *= xscale;
|
||||
} else {
|
||||
corigin_user[cdim1] *= xscale;
|
||||
corigin_user[cdim2] *= yscale;
|
||||
cradmin_user *= xscale;
|
||||
cradmax_user *= xscale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -768,8 +813,8 @@ int ComputeChunkAtom::setup_chunks()
|
||||
if (binflag) {
|
||||
if (which == BIN1D || which == BIN2D || which == BIN3D)
|
||||
nchunk = setup_xyz_bins();
|
||||
else if (which == BINSPHERE)
|
||||
nchunk = setup_sphere_bins();
|
||||
else if (which == BINSPHERE) nchunk = setup_sphere_bins();
|
||||
else if (which == BINCYLINDER) nchunk = setup_cylinder_bins();
|
||||
bin_volumes();
|
||||
} else {
|
||||
chunk_volume_scalar = domain->xprd * domain->yprd;
|
||||
@ -872,6 +917,7 @@ void ComputeChunkAtom::assign_chunk_ids()
|
||||
else if (which == BIN2D) atom2bin2d();
|
||||
else if (which == BIN3D) atom2bin3d();
|
||||
else if (which == BINSPHERE) atom2binsphere();
|
||||
else if (which == BINCYLINDER) atom2bincylinder();
|
||||
|
||||
} else if (which == TYPE) {
|
||||
int *type = atom->type;
|
||||
@ -1174,7 +1220,6 @@ int ComputeChunkAtom::setup_xyz_bins()
|
||||
offset[m] = lo;
|
||||
nlayers[m] = static_cast<int> ((hi-lo) * invdelta[m] + 0.5);
|
||||
nbins *= nlayers[m];
|
||||
chunk_volume_scalar *= delta[m]/prd[idim];
|
||||
}
|
||||
|
||||
// allocate and set bin coordinates
|
||||
@ -1215,52 +1260,111 @@ int ComputeChunkAtom::setup_xyz_bins()
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
setup spherical spatial bins and their extent and coordinates
|
||||
return nbins = # of bins, will become # of chunks
|
||||
setup spherical spatial bins and their single coordinate
|
||||
return nsphere = # of bins, will become # of chunks
|
||||
called from setup_chunks()
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int ComputeChunkAtom::setup_sphere_bins()
|
||||
{
|
||||
// convert sorigin_user to sorigin
|
||||
// sorigin is always in box units, for orthogonal or triclinic domains
|
||||
// lamda2x works for either orthogonal or triclinic
|
||||
|
||||
if (scaleflag == REDUCED) {
|
||||
domain->lamda2x(sorigin_user,sorigin);
|
||||
sradmin = sradmin_user * (domain->boxhi[0]-domain->boxlo[0]);
|
||||
sradmax = sradmax_user * (domain->boxhi[0]-domain->boxlo[0]);
|
||||
} else {
|
||||
sorigin[0] = sorigin_user[0];
|
||||
sorigin[1] = sorigin_user[1];
|
||||
sorigin[2] = sorigin_user[2];
|
||||
sradmin = sradmin_user;
|
||||
sradmax = sradmax_user;
|
||||
}
|
||||
|
||||
sinvrad = nsbin / (sradmax-sradmin);
|
||||
|
||||
// allocate and set bin coordinates
|
||||
// coord = midpt of radii for a spherical shell
|
||||
|
||||
memory->destroy(coord);
|
||||
memory->create(coord,nsphere,1,"chunk/atom:coord");
|
||||
memory->create(coord,nsbin,1,"chunk/atom:coord");
|
||||
|
||||
/*
|
||||
if (ndim == 1) {
|
||||
for (i = 0; i < nlayers[0]; i++)
|
||||
coord[i][0] = offset[0] + (i+0.5)*delta[0];
|
||||
} else if (ndim == 2) {
|
||||
m = 0;
|
||||
for (i = 0; i < nlayers[0]; i++) {
|
||||
coord1 = offset[0] + (i+0.5)*delta[0];
|
||||
for (j = 0; j < nlayers[1]; j++) {
|
||||
coord[m][0] = coord1;
|
||||
coord[m][1] = offset[1] + (j+0.5)*delta[1];
|
||||
m++;
|
||||
}
|
||||
}
|
||||
} else if (ndim == 3) {
|
||||
m = 0;
|
||||
for (i = 0; i < nlayers[0]; i++) {
|
||||
coord1 = offset[0] + (i+0.5)*delta[0];
|
||||
for (j = 0; j < nlayers[1]; j++) {
|
||||
coord2 = offset[1] + (j+0.5)*delta[1];
|
||||
for (k = 0; k < nlayers[2]; k++) {
|
||||
coord[m][0] = coord1;
|
||||
coord[m][1] = coord2;
|
||||
coord[m][2] = offset[2] + (k+0.5)*delta[2];
|
||||
m++;
|
||||
}
|
||||
}
|
||||
}
|
||||
double rlo,rhi;
|
||||
|
||||
for (int i = 0; i < nsbin; i++) {
|
||||
rlo = sradmin + i * (sradmax-sradmin) / nsbin;
|
||||
rhi = sradmin + (i+1) * (sradmax-sradmin) / nsbin;
|
||||
if (i == nsbin-1) rhi = sradmax;
|
||||
coord[i][0] = 0.5 * (rlo+rhi);
|
||||
}
|
||||
*/
|
||||
|
||||
// have to set sinvdelta
|
||||
return nsbin;
|
||||
}
|
||||
|
||||
return nsphere;
|
||||
/* ----------------------------------------------------------------------
|
||||
setup cylindrical spatial bins and their single coordinate
|
||||
return nsphere = # of bins, will become # of chunks
|
||||
called from setup_chunks()
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int ComputeChunkAtom::setup_cylinder_bins()
|
||||
{
|
||||
// setup bins along cylinder axis
|
||||
// ncplane = # of axis bins
|
||||
|
||||
ncplane = setup_xyz_bins();
|
||||
|
||||
// convert corigin_user to corigin
|
||||
// corigin is always in box units, for orthogonal or triclinic domains
|
||||
// lamda2x works for either orthogonal or triclinic
|
||||
|
||||
if (scaleflag == REDUCED) {
|
||||
domain->lamda2x(corigin_user,corigin);
|
||||
cradmin = cradmin_user * (domain->boxhi[cdim1]-domain->boxlo[cdim1]);
|
||||
cradmax = cradmax_user * (domain->boxhi[cdim1]-domain->boxlo[cdim1]);
|
||||
} else {
|
||||
corigin[cdim1] = corigin_user[cdim1];
|
||||
corigin[cdim2] = corigin_user[cdim2];
|
||||
cradmin = cradmin_user;
|
||||
cradmax = cradmax_user;
|
||||
}
|
||||
|
||||
cinvrad = ncbin / (cradmax-cradmin);
|
||||
|
||||
// allocate and set radial bin coordinates
|
||||
// radial coord = midpt of radii for a cylindrical shell
|
||||
// axiscoord = saved bin coords along cylndrical axis
|
||||
// radcoord = saved bin coords in radial direction
|
||||
|
||||
double **axiscoord = coord;
|
||||
memory->create(coord,ncbin,1,"chunk/atom:coord");
|
||||
double **radcoord = coord;
|
||||
|
||||
double rlo,rhi;
|
||||
|
||||
for (int i = 0; i < ncbin; i++) {
|
||||
rlo = cradmin + i * (cradmax-cradmin) / ncbin;
|
||||
rhi = cradmin + (i+1) * (cradmax-cradmin) / ncbin;
|
||||
if (i == ncbin-1) rhi = cradmax;
|
||||
coord[i][0] = 0.5 * (rlo+rhi);
|
||||
}
|
||||
|
||||
// create array of combined coords for all bins
|
||||
|
||||
memory->create(coord,ncbin*ncplane,2,"chunk/atom:coord");
|
||||
int m = 0;
|
||||
for (int i = 0; i < ncbin; i++)
|
||||
for (int j = 0; j < ncplane; j++) {
|
||||
coord[m][0] = radcoord[i][0];
|
||||
coord[m][1] = axiscoord[j][0];
|
||||
m++;
|
||||
}
|
||||
memory->destroy(axiscoord);
|
||||
memory->destroy(radcoord);
|
||||
|
||||
return ncbin*ncplane;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -1286,13 +1390,38 @@ void ComputeChunkAtom::bin_volumes()
|
||||
memory->create(chunk_volume_vec,nchunk,"chunk/atom:chunk_volume_vec");
|
||||
double rlo,rhi,vollo,volhi;
|
||||
for (int i = 0; i < nchunk; i++) {
|
||||
rlo = sradmin + i * (sradmax-sradmin) / nsphere;
|
||||
rhi = sradmin + (i+1) * (sradmax-sradmin) / nsphere;
|
||||
rlo = sradmin + i * (sradmax-sradmin) / nsbin;
|
||||
rhi = sradmin + (i+1) * (sradmax-sradmin) / nsbin;
|
||||
if (i == nchunk-1) rhi = sradmax;
|
||||
vollo = 4.0/3.0 * MY_PI * rlo*rlo*rlo;
|
||||
volhi = 4.0/3.0 * MY_PI * rhi*rhi*rhi;
|
||||
chunk_volume_vec[i] = volhi - vollo;
|
||||
}
|
||||
|
||||
} else if (which == BINCYLINDER) {
|
||||
memory->destroy(chunk_volume_vec);
|
||||
memory->create(chunk_volume_vec,nchunk,"chunk/atom:chunk_volume_vec");
|
||||
|
||||
// slabthick = delta of bins along cylinder axis
|
||||
|
||||
double *prd;
|
||||
if (scaleflag == REDUCED) prd = domain->prd_lamda;
|
||||
else prd = domain->prd;
|
||||
double slabthick = domain->prd[dim[0]] * delta[0]/prd[dim[0]];
|
||||
|
||||
// area lo/hi of concentric circles in radial direction
|
||||
|
||||
int iradbin;
|
||||
double rlo,rhi,arealo,areahi;
|
||||
for (int i = 0; i < nchunk; i++) {
|
||||
iradbin = i / ncplane;
|
||||
rlo = cradmin + iradbin * (cradmax-cradmin) / ncbin;
|
||||
rhi = cradmin + (iradbin+1) * (cradmax-cradmin) / ncbin;
|
||||
if (iradbin == ncbin-1) rhi = cradmax;
|
||||
arealo = MY_PI * rlo*rlo;
|
||||
areahi = MY_PI * rhi*rhi;
|
||||
chunk_volume_vec[i] = (areahi-arealo) * slabthick;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1611,7 +1740,7 @@ void ComputeChunkAtom::atom2bin3d()
|
||||
void ComputeChunkAtom::atom2binsphere()
|
||||
{
|
||||
int i,ibin;
|
||||
double dx,dy,dz,rdist;
|
||||
double dx,dy,dz,r;
|
||||
double xremap,yremap,zremap;
|
||||
|
||||
double *boxlo = domain->boxlo;
|
||||
@ -1619,7 +1748,7 @@ void ComputeChunkAtom::atom2binsphere()
|
||||
double *prd = domain->prd;
|
||||
int *periodicity = domain->periodicity;
|
||||
|
||||
// remap each atom's relevant coord back into box via PBC if necessary
|
||||
// remap each atom's relevant coords back into box via PBC if necessary
|
||||
// apply discard rule based on rmin and rmax
|
||||
|
||||
double **x = atom->x;
|
||||
@ -1647,10 +1776,10 @@ void ComputeChunkAtom::atom2binsphere()
|
||||
dx = xremap - sorigin[0];
|
||||
dy = yremap - sorigin[1];
|
||||
dz = zremap - sorigin[2];
|
||||
rdist = sqrt(dx*dx + dy*dy + dz*dz);
|
||||
r = sqrt(dx*dx + dy*dy + dz*dz);
|
||||
|
||||
ibin = static_cast<int> ((rdist - sradmin) * sinvdelta);
|
||||
if (rdist < sradmin) ibin--;
|
||||
ibin = static_cast<int> ((r - sradmin) * sinvrad);
|
||||
if (r < sradmin) ibin--;
|
||||
|
||||
if (discard == MIXED || discard == NODISCARD) {
|
||||
ibin = MAX(ibin,0);
|
||||
@ -1664,8 +1793,75 @@ void ComputeChunkAtom::atom2binsphere()
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
assign each atom to a cylindrical bin
|
||||
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeChunkAtom::atom2bincylinder()
|
||||
{
|
||||
int i,rbin,kbin;
|
||||
double d1,d2,r;
|
||||
double remap1,remap2;
|
||||
|
||||
// first use atom2bin1d() to bin all atoms along cylinder axis
|
||||
|
||||
atom2bin1d();
|
||||
|
||||
// now bin in radial direction
|
||||
// kbin = bin along cylinder axis
|
||||
// rbin = bin in radial direction
|
||||
|
||||
double *boxlo = domain->boxlo;
|
||||
double *boxhi = domain->boxhi;
|
||||
double *prd = domain->prd;
|
||||
int *periodicity = domain->periodicity;
|
||||
|
||||
// remap each atom's relevant coords back into box via PBC if necessary
|
||||
// apply discard rule based on rmin and rmax
|
||||
|
||||
double **x = atom->x;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (i = 0; i < nlocal; i++) {
|
||||
if (exclude[i]) continue;
|
||||
kbin = ichunk[i] - 1;
|
||||
|
||||
remap1 = x[i][cdim1];
|
||||
if (periodicity[cdim1]) {
|
||||
if (remap1 < boxlo[cdim1]) remap1 += prd[cdim1];
|
||||
if (remap1 >= boxhi[cdim1]) remap1 -= prd[cdim1];
|
||||
}
|
||||
remap2 = x[i][cdim2];
|
||||
if (periodicity[cdim2]) {
|
||||
if (remap2 < boxlo[cdim2]) remap2 += prd[cdim2];
|
||||
if (remap2 >= boxhi[cdim2]) remap2 -= prd[cdim2];
|
||||
}
|
||||
|
||||
d1 = remap1 - corigin[cdim1];
|
||||
d2 = remap2 - corigin[cdim2];
|
||||
r = sqrt(d1*d1 + d2*d2);
|
||||
|
||||
rbin = static_cast<int> ((r - cradmin) * cinvrad);
|
||||
if (r < cradmin) rbin--;
|
||||
|
||||
if (discard == MIXED || discard == NODISCARD) {
|
||||
rbin = MAX(rbin,0);
|
||||
rbin = MIN(rbin,ncbin-1);
|
||||
} else if (rbin < 0 || rbin >= ncbin) {
|
||||
exclude[i] = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// combine axis and radial bin indices to set ichunk
|
||||
|
||||
ichunk[i] = rbin*ncplane + kbin + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
process args for one dimension of binning info
|
||||
set dim, originflag, origin, delta
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void ComputeChunkAtom::readdim(int narg, char **arg, int iarg, int idim)
|
||||
@ -1674,6 +1870,7 @@ void ComputeChunkAtom::readdim(int narg, char **arg, int iarg, int idim)
|
||||
if (strcmp(arg[iarg],"x") == 0) dim[idim] = 0;
|
||||
else if (strcmp(arg[iarg],"y") == 0) dim[idim] = 1;
|
||||
else if (strcmp(arg[iarg],"z") == 0) dim[idim] = 2;
|
||||
else error->all(FLERR,"Illegal compute chunk/atom command");
|
||||
|
||||
if (dim[idim] == 2 && domain->dimension == 2)
|
||||
error->all(FLERR,"Cannot use compute chunk/atom bin z for 2d model");
|
||||
|
||||
@ -67,9 +67,20 @@ class ComputeChunkAtom : public Compute {
|
||||
|
||||
// spherical spatial bins
|
||||
|
||||
double sorigin_user[3];
|
||||
double sorigin[3];
|
||||
double sradmin,sradmax,sinvdelta;
|
||||
int nsphere;
|
||||
double sradmin_user,sradmax_user;
|
||||
double sradmin,sradmax,sinvrad;
|
||||
int nsbin;
|
||||
|
||||
// cylindrical spatial bins
|
||||
|
||||
double corigin_user[3];
|
||||
double corigin[3];
|
||||
double cradmin_user,cradmax_user;
|
||||
double cradmin,cradmax,cinvrad;
|
||||
int cdim1,cdim2;
|
||||
int ncbin,ncplane;
|
||||
|
||||
char *idregion;
|
||||
class Region *region;
|
||||
@ -107,11 +118,13 @@ class ComputeChunkAtom : public Compute {
|
||||
void check_molecules();
|
||||
int setup_xyz_bins();
|
||||
int setup_sphere_bins();
|
||||
int setup_cylinder_bins();
|
||||
void bin_volumes();
|
||||
void atom2bin1d();
|
||||
void atom2bin2d();
|
||||
void atom2bin3d();
|
||||
void atom2binsphere();
|
||||
void atom2bincylinder();
|
||||
void readdim(int, char **, int, int);
|
||||
};
|
||||
|
||||
|
||||
@ -599,28 +599,30 @@ void Domain::pbc()
|
||||
int Domain::inside(double* x)
|
||||
{
|
||||
double *lo,*hi;
|
||||
double delta[3];
|
||||
double lamda[3];
|
||||
|
||||
if (triclinic == 0) {
|
||||
lo = boxlo;
|
||||
hi = boxhi;
|
||||
|
||||
if (x[0] < lo[0] || x[0] >= hi[0] ||
|
||||
x[1] < lo[1] || x[1] >= hi[1] ||
|
||||
x[2] < lo[2] || x[2] >= hi[2]) return 0;
|
||||
else return 1;
|
||||
|
||||
} else {
|
||||
lo = boxlo_lamda;
|
||||
hi = boxhi_lamda;
|
||||
|
||||
delta[0] = x[0] - boxlo[0];
|
||||
delta[1] = x[1] - boxlo[1];
|
||||
delta[2] = x[2] - boxlo[2];
|
||||
x2lamda(x,lamda);
|
||||
|
||||
x[0] = h_inv[0]*delta[0] + h_inv[5]*delta[1] + h_inv[4]*delta[2];
|
||||
x[1] = h_inv[1]*delta[1] + h_inv[3]*delta[2];
|
||||
x[2] = h_inv[2]*delta[2];
|
||||
if (lamda[0] < lo[0] || lamda[0] >= hi[0] ||
|
||||
lamda[1] < lo[1] || lamda[1] >= hi[1] ||
|
||||
lamda[2] < lo[2] || lamda[2] >= hi[2]) return 0;
|
||||
else return 1;
|
||||
|
||||
}
|
||||
|
||||
if (x[0] < lo[0] || x[0] >= hi[0] ||
|
||||
x[1] < lo[1] || x[1] >= hi[1] ||
|
||||
x[2] < lo[2] || x[2] >= hi[2]) return 0;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -631,30 +633,31 @@ int Domain::inside(double* x)
|
||||
int Domain::inside_nonperiodic(double* x)
|
||||
{
|
||||
double *lo,*hi;
|
||||
double delta[3];
|
||||
double lamda[3];
|
||||
|
||||
if (xperiodic && yperiodic && zperiodic) return 1;
|
||||
|
||||
if (triclinic == 0) {
|
||||
lo = boxlo;
|
||||
hi = boxhi;
|
||||
|
||||
if (!xperiodic && (x[0] < lo[0] || x[0] >= hi[0])) return 0;
|
||||
if (!yperiodic && (x[1] < lo[1] || x[1] >= hi[1])) return 0;
|
||||
if (!zperiodic && (x[2] < lo[2] || x[2] >= hi[2])) return 0;
|
||||
return 1;
|
||||
|
||||
} else {
|
||||
lo = boxlo_lamda;
|
||||
hi = boxhi_lamda;
|
||||
|
||||
delta[0] = x[0] - boxlo[0];
|
||||
delta[1] = x[1] - boxlo[1];
|
||||
delta[2] = x[2] - boxlo[2];
|
||||
x2lamda(x,lamda);
|
||||
|
||||
x[0] = h_inv[0]*delta[0] + h_inv[5]*delta[1] + h_inv[4]*delta[2];
|
||||
x[1] = h_inv[1]*delta[1] + h_inv[3]*delta[2];
|
||||
x[2] = h_inv[2]*delta[2];
|
||||
if (!xperiodic && (lamda[0] < lo[0] || lamda[0] >= hi[0])) return 0;
|
||||
if (!yperiodic && (lamda[1] < lo[1] || lamda[1] >= hi[1])) return 0;
|
||||
if (!zperiodic && (lamda[2] < lo[2] || lamda[2] >= hi[2])) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!xperiodic && (x[0] < lo[0] || x[0] >= hi[0])) return 0;
|
||||
if (!yperiodic && (x[1] < lo[1] || x[1] >= hi[1])) return 0;
|
||||
if (!zperiodic && (x[2] < lo[2] || x[2] >= hi[2])) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -830,13 +830,20 @@ void FixAveChunk::end_of_step()
|
||||
}
|
||||
|
||||
// DENSITYs are additionally normalized by chunk volume
|
||||
// only relevant if chunks are spatial bins
|
||||
// use scalar or vector values for volume(s)
|
||||
// if chunks are not spatial bins, chunk_volume_scalar = 1.0
|
||||
|
||||
for (j = 0; j < nvalues; j++)
|
||||
if (which[j] == DENSITY_NUMBER || which[j] == DENSITY_MASS) {
|
||||
double chunk_volume = cchunk->chunk_volume_scalar;
|
||||
for (m = 0; m < nchunk; m++)
|
||||
values_sum[m][j] /= chunk_volume;
|
||||
if (cchunk->chunk_volume_vec) {
|
||||
double *chunk_volume_vec = cchunk->chunk_volume_vec;
|
||||
for (m = 0; m < nchunk; m++)
|
||||
values_sum[m][j] /= chunk_volume_vec[m];
|
||||
} else {
|
||||
double chunk_volume_scalar = cchunk->chunk_volume_scalar;
|
||||
for (m = 0; m < nchunk; m++)
|
||||
values_sum[m][j] /= chunk_volume_scalar;
|
||||
}
|
||||
}
|
||||
|
||||
// if ave = ONE, only single Nfreq timestep value is needed
|
||||
|
||||
@ -1 +1 @@
|
||||
#define LAMMPS_VERSION "9 Dec 2015"
|
||||
#define LAMMPS_VERSION "11 Dec 2015"
|
||||
|
||||
Reference in New Issue
Block a user