enable per-atom custom arrays in addition to vectors
This commit is contained in:
@ -465,12 +465,18 @@ atom-style variables can reference the position of a particle, its
|
||||
velocity, the volume of its Voronoi cell, etc.
|
||||
|
||||
The *store* weight style does not compute a weight factor. Instead it
|
||||
stores the current accumulated weights in a custom per-atom property
|
||||
specified by *name*\ . This must be a property defined as *d_name* via
|
||||
the :doc:`fix property/atom <fix_property_atom>` command. Note that
|
||||
these custom per-atom properties can be output in a :doc:`dump <dump>`
|
||||
file, so this is a way to examine, debug, or visualize the
|
||||
per-particle weights computed during the load-balancing operation.
|
||||
stores the current accumulated weights in a custom per-atom vector
|
||||
specified by *name*\ . This must be a vector defined as *d_name* via
|
||||
the :doc:`fix property/atom <fix_property_atom>` command. This means
|
||||
the values in the vector can be read as part of a data file with the
|
||||
:doc:`read_data <read_data>` command or specified with the :doc:`set
|
||||
<set>` command. These weights can also be output in a :doc:`dump
|
||||
<dump>` file, so this is a way to examine, debug, or visualize the
|
||||
per-particle weights used during the load-balancing operation.
|
||||
|
||||
Note that the name of the custom per-atom vector is specified just
|
||||
as *name*, not as *d_name* as it is for other commands that use
|
||||
different kinds of custom atom vectors or arrays as arguments.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -20,7 +20,8 @@ Syntax
|
||||
x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz,
|
||||
vx, vy, vz, fx, fy, fz,
|
||||
q, mux, muy, muz, mu,
|
||||
sp, spx, spy, spz, fmx, fmy, fmz,
|
||||
spx, spy, spz, sp, fmx, fmy, fmz,
|
||||
nbonds,
|
||||
radius, diameter, omegax, omegay, omegaz,
|
||||
angmomx, angmomy, angmomz,
|
||||
shapex,shapey, shapez,
|
||||
@ -29,42 +30,42 @@ Syntax
|
||||
corner1x, corner1y, corner1z,
|
||||
corner2x, corner2y, corner2z,
|
||||
corner3x, corner3y, corner3z,
|
||||
nbonds,
|
||||
buckling,
|
||||
vfrac, s0,
|
||||
spin, eradius, ervel, erforce,
|
||||
rho, drho, e, de, cv,
|
||||
i_name, d_name
|
||||
i_name, d_name, i2_name[I], d2_name[I],
|
||||
vfrac, s0, spin, eradius, ervel, erforce,
|
||||
rho, drho, e, de, cv, buckling
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
id = atom ID
|
||||
mol = molecule ID
|
||||
proc = ID of processor that owns atom
|
||||
type = atom type
|
||||
mass = atom mass
|
||||
x,y,z = unscaled atom coordinates
|
||||
xs,ys,zs = scaled atom coordinates
|
||||
xu,yu,zu = unwrapped atom coordinates
|
||||
ix,iy,iz = box image that the atom is in
|
||||
vx,vy,vz = atom velocities
|
||||
fx,fy,fz = forces on atoms
|
||||
q = atom charge
|
||||
mux,muy,muz = orientation of dipole moment of atom
|
||||
mu = magnitude of dipole moment of atom
|
||||
sp = atomic magnetic spin moment
|
||||
spx, spy, spz = direction of the atomic magnetic spin
|
||||
fmx, fmy, fmz = magnetic force
|
||||
radius,diameter = radius,diameter of spherical particle
|
||||
omegax,omegay,omegaz = angular velocity of spherical particle
|
||||
angmomx,angmomy,angmomz = angular momentum of aspherical particle
|
||||
shapex,shapey,shapez = 3 diameters of aspherical particle
|
||||
quatw,quati,quatj,quatk = quaternion components for aspherical or body particles
|
||||
tqx,tqy,tqz = torque on finite-size particles
|
||||
end12x, end12y, end12z = end points of line segment
|
||||
corner123x, corner123y, corner123z = corner points of triangle
|
||||
nbonds = number of bonds assigned to an atom
|
||||
buckling = buckling flag used in mesoscopic simulation of nanotubes
|
||||
*id* = atom ID
|
||||
*mol* = molecule ID
|
||||
*proc* = ID of processor that owns atom
|
||||
*type* = atom type
|
||||
*mass* = atom mass
|
||||
*x,y,z* = unscaled atom coordinates
|
||||
*xs,ys,zs* = scaled atom coordinates
|
||||
*xu,yu,zu* = unwrapped atom coordinates
|
||||
*ix,iy,iz* = box image that the atom is in
|
||||
*vx,vy,vz* = atom velocities
|
||||
*fx,fy,fz* = forces on atoms
|
||||
*q* = atom charge
|
||||
*mux,muy,muz* = orientation of dipole moment of atom
|
||||
*mu* = magnitude of dipole moment of atom
|
||||
*spx, spy, spz* = direction of the atomic magnetic spin
|
||||
*sp* = magintude of atomic magnetic spin moment
|
||||
*fmx, fmy, fmz* = magnetic force
|
||||
*nbonds* = number of bonds assigned to an atom
|
||||
*radius,diameter* = radius,diameter of spherical particle
|
||||
*omegax,omegay,omegaz* = angular velocity of spherical particle
|
||||
*angmomx,angmomy,angmomz* = angular momentum of aspherical particle
|
||||
*shapex,shapey,shapez* = 3 diameters of aspherical particle
|
||||
*quatw,quati,quatj,quatk* = quaternion components for aspherical or body particles
|
||||
*tqx,tqy,tqz* = torque on finite-size particles
|
||||
*end12x, end12y, end12z* = end points of line segment
|
||||
*corner123x, corner123y, corner123z* = corner points of triangle
|
||||
*i_name* = custom integer vector with name
|
||||
*d_name* = custom floating point vector with name
|
||||
*i2_name[I]* = Ith column of custom integer array with name
|
||||
*d2_name[I]* = Ith column of custom floating-point array with name
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -91,9 +92,8 @@ Syntax
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
:doc:`fix property/atom <fix_property_atom>` per-atom properties:
|
||||
i_name = custom integer vector with name
|
||||
d_name = custom integer vector with name
|
||||
USER-MESONT package per-atom properties:
|
||||
buckling = buckling flag used in mesoscopic simulation of nanotubes
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
@ -104,6 +104,7 @@ Examples
|
||||
compute 2 all property/atom type
|
||||
compute 1 all property/atom ix iy iz
|
||||
compute 3 all property/atom sp spx spy spz
|
||||
compute 1 all property/atom i_myFlag d_Sxyz[1] d_Sxyz[3]
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
@ -116,20 +117,37 @@ ave/atom <fix_ave_atom>`, :doc:`fix ave/histo <fix_ave_histo>`,
|
||||
:doc:`fix ave/chunk <fix_ave_chunk>`, and :doc:`atom-style variable
|
||||
<variable>` commands.
|
||||
|
||||
The list of possible attributes is the same as that used by the
|
||||
:doc:`dump custom <dump>` command, which describes their meaning, with
|
||||
some additional quantities that are only defined for certain
|
||||
:doc:`atom styles <atom_style>`. Basically, this augmented list gives
|
||||
an input script access to any per-atom quantity stored by LAMMPS.
|
||||
The list of possible attributes is essentially the same as that used
|
||||
by the :doc:`dump custom <dump>` command, which describes their
|
||||
meaning, with some additional quantities that are only defined for
|
||||
certain :doc:`atom styles <atom_style>`. The goal of this augmented
|
||||
list gives an input script access to any per-atom quantity stored by
|
||||
LAMMPS.
|
||||
|
||||
The values are stored in a per-atom vector or array as discussed
|
||||
below. Zeroes are stored for atoms not in the specified group or for
|
||||
quantities that are not defined for a particular particle in the group
|
||||
(e.g. *shapex* if the particle is not an ellipsoid).
|
||||
|
||||
Attributes *i_name*, *d_name*, *i2_name*, *d2_name* refer to custom
|
||||
per-atom integer and floating-point vectors or arrays that have been
|
||||
added via the :doc:`fix property/atom <fix_property_atom>` command.
|
||||
When that command is used specific names are given to each attribute
|
||||
which are the "name" portion of these attributes. For arrays *i2_name*
|
||||
and *d2_name*, the column of the array must also be included following
|
||||
the name in brackets: e.g. d2_xyz[2], i2_mySpin[3].
|
||||
|
||||
The additional quantities only accessible via this command, and not
|
||||
directly via the :doc:`dump custom <dump>` command, are as follows.
|
||||
|
||||
*Nbonds* is available for all molecular atom styles and refers to the
|
||||
number of explicit bonds assigned to an atom. Note that if the
|
||||
:doc:`newton bond <newton>` command is set to *on*\ , which is the
|
||||
default, then every bond in the system is assigned to only one of the
|
||||
two atoms in the bond. Thus a bond between atoms I,J may be tallied
|
||||
for either atom I or atom J. If :doc:`newton bond off <newton>` is
|
||||
set, it will be tallied with both atom I and atom J.
|
||||
|
||||
*Shapex*\ , *shapey*\ , and *shapez* are defined for ellipsoidal particles
|
||||
and define the 3d shape of each particle.
|
||||
|
||||
@ -146,19 +164,8 @@ line segment.
|
||||
*corner2z*\ , *corner3x*\ , *corner3y*\ , *corner3z*\ , are defined for
|
||||
triangular particles and define the corner points of each triangle.
|
||||
|
||||
*Nbonds* is available for all molecular atom styles and refers to the
|
||||
number of explicit bonds assigned to an atom. Note that if the
|
||||
:doc:`newton bond <newton>` command is set to *on*\ , which is the
|
||||
default, then every bond in the system is assigned to only one of the
|
||||
two atoms in the bond. Thus a bond between atoms I,J may be tallied
|
||||
for either atom I or atom J. If :doc:`newton bond off <newton>` is
|
||||
set, it will be tallied with both atom I and atom J.
|
||||
|
||||
The *i_name* and *d_name* attributes refer to custom integer and
|
||||
floating-point properties that have been added to each atom via the
|
||||
:doc:`fix property/atom <fix_property_atom>` command. When that
|
||||
command is used specific names are given to each attribute which are
|
||||
what is specified as the "name" portion of *i_name* or *d_name*.
|
||||
In addition, the various per-atom quantities listed above for specific
|
||||
packages are only accessible by this command.
|
||||
|
||||
Output info
|
||||
"""""""""""
|
||||
|
||||
@ -78,7 +78,8 @@ Syntax
|
||||
q, mux, muy, muz, mu,
|
||||
radius, diameter, omegax, omegay, omegaz,
|
||||
angmomx, angmomy, angmomz, tqx, tqy, tqz,
|
||||
c_ID, c_ID[N], f_ID, f_ID[N], v_name
|
||||
c_ID, c_ID[I], f_ID, f_ID[I], v_name,
|
||||
i_name, d_name, i2_name[I], d2_name[I]
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -108,8 +109,10 @@ Syntax
|
||||
f_ID = per-atom vector calculated by a fix with ID
|
||||
f_ID[I] = Ith column of per-atom array calculated by a fix with ID, I can include wildcard (see below)
|
||||
v_name = per-atom vector calculated by an atom-style variable with name
|
||||
d_name = per-atom floating point vector with name, managed by fix property/atom
|
||||
i_name = per-atom integer vector with name, managed by fix property/atom
|
||||
i_name = custom integer vector with name
|
||||
d_name = custom floating point vector with name
|
||||
i2_name[I] = Ith column of custom integer array with name, I can include wildcard (see below)
|
||||
d2_name[I] = Ith column of custom floating point vector with name, I can include wildcard (see below)
|
||||
|
||||
* *local* args = list of local attributes
|
||||
|
||||
@ -134,7 +137,7 @@ Examples
|
||||
dump 2 subgroup atom 50 dump.run.mpiio.bin
|
||||
dump 4a all custom 100 dump.myforce.* id type x y vx fx
|
||||
dump 4b flow custom 100 dump.%.myforce id type c_myF[3] v_ke
|
||||
dump 4b flow custom 100 dump.%.myforce id type c_myF[\*] v_ke
|
||||
dump 4b flow custom 100 dump.%.myforce id type c_myF[*] v_ke
|
||||
dump 2 inner cfg 10 dump.snap.*.cfg mass type xs ys zs vx vy vz
|
||||
dump snap all cfg 100 dump.config.*.cfg mass type xs ys zs id type c_Stress[2]
|
||||
dump 1 all xtc 1000 file.xtc
|
||||
@ -465,16 +468,15 @@ styles.
|
||||
----------
|
||||
|
||||
Note that in the discussion which follows, for styles which can
|
||||
reference values from a compute or fix, like the *custom*\ , *cfg*\ , or
|
||||
*local* styles, the bracketed index I can be specified using a
|
||||
wildcard asterisk with the index to effectively specify multiple
|
||||
values. This takes the form "\*" or "\*n" or "n\*" or "m\*n". If N = the
|
||||
size of the vector (for *mode* = scalar) or the number of columns in
|
||||
the array (for *mode* = vector), then an asterisk with no numeric
|
||||
values means all indices from 1 to N. A leading asterisk means all
|
||||
indices from 1 to n (inclusive). A trailing asterisk means all
|
||||
indices from n to N (inclusive). A middle asterisk means all indices
|
||||
from m to n (inclusive).
|
||||
reference values from a compute or fix or custom atom property, like
|
||||
the *custom*\ , *cfg*\ , or *local* styles, the bracketed index I can
|
||||
be specified using a wildcard asterisk with the index to effectively
|
||||
specify multiple values. This takes the form "\*" or "\*n" or "n\*"
|
||||
or "m\*n". If N = the number of columns in the array, then an
|
||||
asterisk with no numeric values means all column indices from 1 to N.
|
||||
A leading asterisk means all indices from 1 to n (inclusive). A
|
||||
trailing asterisk means all indices from n to N (inclusive). A middle
|
||||
asterisk means all indices from m to n (inclusive).
|
||||
|
||||
Using a wildcard is the same as if the individual columns of the array
|
||||
had been listed one by one. E.g. these 2 dump commands are
|
||||
@ -512,8 +514,9 @@ bonds and angles.
|
||||
|
||||
Note that computes which calculate global or per-atom quantities, as
|
||||
opposed to local quantities, cannot be output in a dump local command.
|
||||
Instead, global quantities can be output by the :doc:`thermo_style custom <thermo_style>` command, and per-atom quantities can be
|
||||
output by the dump custom command.
|
||||
Instead, global quantities can be output by the :doc:`thermo_style
|
||||
custom <thermo_style>` command, and per-atom quantities can be output
|
||||
by the dump custom command.
|
||||
|
||||
If *c_ID* is used as a attribute, then the local vector calculated by
|
||||
the compute is printed. If *c_ID[I]* is used, then I must be in the
|
||||
@ -660,9 +663,13 @@ invoke other computes, fixes, or variables when they are evaluated, so
|
||||
this is a very general means of creating quantities to output to a
|
||||
dump file.
|
||||
|
||||
The *d_name* and *i_name* attributes allow to output custom per atom
|
||||
floating point or integer properties that are managed by
|
||||
:doc:`fix property/atom <fix_property_atom>`.
|
||||
The *i_name*, *d_name*, *i2_name*, *d2_name* attributes refer to
|
||||
per-atom integer and floating-point vectors or arrays that have been
|
||||
added via the :doc:`fix property/atom <fix_property_atom>` command.
|
||||
When that command is used specific names are given to each attribute
|
||||
which are the "name" portion of these keywords. For arrays *i2_name*
|
||||
and *d2_name*, the column of the array must also be included following
|
||||
the name in brackets: e.g. d2_xyz[2], i2_mySpin[3].
|
||||
|
||||
See the :doc:`Modify <Modify>` doc page for information on how to add
|
||||
new compute and fix styles to LAMMPS to calculate per-atom quantities
|
||||
|
||||
@ -11,11 +11,11 @@ Syntax
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
fix ID group-ID property/atom vec1 vec2 ... keyword value ...
|
||||
fix ID group-ID property/atom name1 name2 ... keyword value ...
|
||||
|
||||
* ID, group-ID are documented in :doc:`fix <fix>` command
|
||||
* property/atom = style name of this fix command
|
||||
* vec1,vec2,... = *mol* or *q* or *rmass* or *i_name* or *d_name*
|
||||
* name1,name2,... = *mol* or *q* or *rmass* or *i_name* or *d_name* or *i2_name* or *d2_name*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -24,6 +24,10 @@ Syntax
|
||||
*rmass* = per-atom mass
|
||||
*i_name* = new integer vector referenced by name
|
||||
*d_name* = new floating-point vector referenced by name
|
||||
*i2_name* = new integer array referenced by name
|
||||
i2_name arg = N = number of columns in the array
|
||||
*d2_name* = new floating-point array referenced by name
|
||||
d2_name arg = N = number of columns in the array
|
||||
|
||||
* zero of more keyword/value pairs may be appended
|
||||
* keyword = *ghost*
|
||||
@ -39,58 +43,64 @@ Examples
|
||||
|
||||
fix 1 all property/atom mol
|
||||
fix 1 all property/atom i_myflag1 i_myflag2
|
||||
fix 1 all property/atom d_sx d_sy d_sz
|
||||
fix 1 all property/atom d2_sxyz 3 ghost yes
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
Create one or more additional per-atom vectors to store information
|
||||
about atoms and to use during a simulation. The specified *group-ID*
|
||||
is ignored by this fix.
|
||||
Create one or more additional per-atom vectors or arrays to store
|
||||
information about atoms and to use during a simulation. The specified
|
||||
*group-ID* is ignored by this fix.
|
||||
|
||||
The atom style used for a simulation defines a set of per-atom
|
||||
properties, as explained on the :doc:`atom_style <atom_style>` and
|
||||
:doc:`read_data <read_data>` doc pages. The latter command allows these
|
||||
properties to be defined for each atom in the system when a data file
|
||||
is read. This fix will augment the set of properties with new custom
|
||||
:doc:`read_data <read_data>` doc pages. The latter command defines
|
||||
these properties for each atom in the system when a data file is read.
|
||||
This fix augments the set of per-atom properties with new custom
|
||||
ones. This can be useful in several scenarios.
|
||||
|
||||
If the atom style does not define molecule IDs, per-atom charge,
|
||||
or per-atom mass, they can be added using the *mol*\ , *q* or *rmass*
|
||||
keywords. This can be useful, e.g, to define "molecules" to use as
|
||||
rigid bodies with the :doc:`fix rigid <fix_rigid>` command, or just to
|
||||
carry around an extra flag with the atoms (stored as a molecule ID)
|
||||
that can be used to group atoms without having to use the group
|
||||
If the atom style does not define molecule IDs, per-atom charge, or
|
||||
per-atom mass, they can be added using the *mol*\ , *q* or *rmass*
|
||||
keywords. This ciykd be useful to define "molecules" to use as rigid
|
||||
bodies with the :doc:`fix rigid <fix_rigid>` command, or to carry
|
||||
around an extra flag with atoms (stored as a molecule ID) that can be
|
||||
used by various commands like :doc:`compute chunk/atom
|
||||
<compute_chunk_atom>` to group atoms without having to use the group
|
||||
command (which is limited to a total of 32 groups including *all*\ ).
|
||||
|
||||
Another application would be to use the *rmass* flag in order to have
|
||||
per-atom masses instead of per-type masses, for example this can be
|
||||
useful to study isotope effects with partial isotope substitution.
|
||||
Please :ref:`see below <isotopes>` for an example of simulating a mixture
|
||||
of light and heavy water with the TIP4P water potential.
|
||||
Another application is to use the *rmass* flag in order to have
|
||||
per-atom masses instead of per-type masses. This could be used to
|
||||
study isotope effects with partial isotope substitution. :ref:`See
|
||||
below <isotopes>` for an example of simulating a mixture of light and
|
||||
heavy water with the TIP4P water potential.
|
||||
|
||||
An alternative to using fix *property/atom* in these ways is to
|
||||
An alternative to using fix *property/atom* for these examples is to
|
||||
use an atom style that does define molecule IDs or charge or per-atom
|
||||
mass (indirectly via diameter and density) or to use a hybrid atom
|
||||
style that combines two or more atom styles
|
||||
to provide the union of all atom properties. However, this has two
|
||||
practical drawbacks: first, it typically necessitates changing the
|
||||
format of the data file, which can be tedious for large systems;
|
||||
and second, it may define additional properties that are not needed
|
||||
such as bond lists, which has some overhead when there are no bonds.
|
||||
style that combines two or more atom styles to provide the union of
|
||||
all their atom properties. However, this has two practical drawbacks:
|
||||
first, it typically necessitates changing the format of the Atoms
|
||||
section in the data file and second, it may define additional
|
||||
properties that are not needed such as bond lists, which incurs some
|
||||
overhead when there are no bonds.
|
||||
|
||||
In the future, we may add additional per-atom properties similar to
|
||||
*mol*\ , *q* or *rmass*\ , which "turn-on" specific properties defined
|
||||
by some atom styles, so they can be used by atom styles that do not
|
||||
define them.
|
||||
In the future, we may add additional existing per-atom properties to
|
||||
fix property/atom, similar to *mol*\ , *q* or *rmass*\ , which
|
||||
"turn-on" specific properties defined by some atom styles, so they can
|
||||
be easily used by atom styles that do not define them.
|
||||
|
||||
More generally, the *i_name* and *d_name* vectors allow one or more
|
||||
new custom per-atom properties to be defined. Each name must be
|
||||
unique and can use alphanumeric or underscore characters. These
|
||||
vectors can store whatever values you decide are useful in your
|
||||
simulation. As explained below there are several ways to initialize
|
||||
and access and output these values, both via input script commands and
|
||||
in new code that you add to LAMMPS.
|
||||
More generally, the *i_name* and *d_name* options allow one or more
|
||||
new custom per-atom vectors to be defined. Likewise the *i2_name* and
|
||||
*d2_name* options allow one or more custom per-atom arrays to be
|
||||
defined. The *i2_name* and *d2_name* options take an argument *N*
|
||||
which specifies the number of columns in the per-atom array, i.e. the
|
||||
number of attributes associated with each atom. *N* >= 1 is required.
|
||||
|
||||
Each name must be unique and can use alphanumeric or underscore
|
||||
characters. These vectors and arrays can store whatever values you
|
||||
decide are useful in your simulation. As explained below there are
|
||||
several ways to initialize, access, and output these values, via input
|
||||
script commands, data files, and in new code you add to LAMMPS.
|
||||
|
||||
This is effectively a simple way to add per-atom properties to a model
|
||||
without needing to write code for a new :doc:`atom style <atom_style>`
|
||||
@ -107,42 +117,38 @@ new properties are also defined for the ghost atoms.
|
||||
|
||||
.. note::
|
||||
|
||||
If you use this command with the *mol*\ , *q* or *rmass* vectors,
|
||||
then you most likely want to set *ghost* yes, since these properties
|
||||
are stored with ghost atoms if you use an :doc:`atom_style <atom_style>`
|
||||
that defines them, and many LAMMPS operations that use molecule IDs or
|
||||
charge, such as neighbor lists and pair styles, will expect ghost
|
||||
atoms to have these values. LAMMPS will issue a warning it you define
|
||||
those vectors but do not set *ghost* yes.
|
||||
If you use the *mol*\ , *q* or *rmass* names, you most likely want
|
||||
to set *ghost* yes, since these properties are stored with ghost
|
||||
atoms if you use an :doc:`atom_style <atom_style>` that defines
|
||||
them. Many LAMMPS operations that use molecule IDs or charge, such
|
||||
as neighbor lists and pair styles, will expect ghost atoms to have
|
||||
these values. LAMMPS will issue a warning it you define those
|
||||
vectors but do not set *ghost* yes.
|
||||
|
||||
.. note::
|
||||
|
||||
The properties for ghost atoms are not updated every timestep,
|
||||
but only once every few steps when neighbor lists are re-built. Thus
|
||||
the *ghost* keyword is suitable for static properties, like molecule
|
||||
IDs, but not for dynamic properties that change every step. For the
|
||||
latter, the code you add to LAMMPS to change the properties will also
|
||||
need to communicate their new values to/from ghost atoms, an operation
|
||||
that can be invoked from within a :doc:`pair style <pair_style>` or
|
||||
:doc:`fix <fix>` or :doc:`compute <compute>` that you write.
|
||||
|
||||
.. note::
|
||||
|
||||
If this fix is defined **after** the simulation box is created,
|
||||
a 'run 0' command should be issued to properly initialize the storage
|
||||
created by this fix.
|
||||
The specified properties for ghost atoms are not updated every
|
||||
timestep, but only once every few steps when neighbor lists are
|
||||
re-built. Thus the *ghost* keyword is suitable for static
|
||||
properties, like molecule IDs, but not for dynamic properties that
|
||||
change every step. For the latter, the code you add to LAMMPS to
|
||||
change the properties will also need to communicate their new
|
||||
values to/from ghost atoms, an operation that can be invoked from
|
||||
within a :doc:`pair style <pair_style>` or :doc:`fix <fix>` or
|
||||
:doc:`compute <compute>` that you write.
|
||||
|
||||
----------
|
||||
|
||||
This fix is one of a small number that can be defined in an input
|
||||
script before the simulation box is created or atoms are defined.
|
||||
This is so it can be used with the :doc:`read_data <read_data>` command
|
||||
as described below.
|
||||
This is so it can be used with the :doc:`read_data <read_data>`
|
||||
command as described next.
|
||||
|
||||
Per-atom properties that are defined by the :doc:`atom style <atom_style>` are initialized when atoms are created, e.g. by
|
||||
the :doc:`read_data <read_data>` or :doc:`create_atoms <create_atoms>`
|
||||
Per-atom properties that are defined by the :doc:`atom style
|
||||
<atom_style>` are initialized when atoms are created, e.g. by the
|
||||
:doc:`read_data <read_data>` or :doc:`create_atoms <create_atoms>`
|
||||
commands. The per-atom properties defined by this fix are not. So
|
||||
you need to initialize them explicitly. This can be done by the
|
||||
you need to initialize them explicitly. One way to do thisis
|
||||
:doc:`read_data <read_data>` command, using its *fix* keyword and
|
||||
passing it the fix-ID of this fix.
|
||||
|
||||
@ -167,15 +173,22 @@ would allow a data file to have a section like this:
|
||||
...
|
||||
N 763 4.5
|
||||
|
||||
where N is the number of atoms, and the first field on each line is
|
||||
the atom-ID, followed by a molecule-ID and a floating point value that
|
||||
will be stored in a new property called "flag". Note that the list of
|
||||
per-atom properties can be in any order.
|
||||
where N is the number of atoms, the first field on each line is the
|
||||
atom-ID, the next two are a molecule-ID and a floating point value
|
||||
that will be stored in a new property called "flag". If a per-atom
|
||||
array was specified in the fix property/atom commmand then the *N*
|
||||
values for that array must be specified consecutively for that
|
||||
property on each line.
|
||||
|
||||
Another way of initializing the new properties is via the
|
||||
:doc:`set <set>` command. For example, if you wanted molecules
|
||||
defined for every set of 10 atoms, based on their atom-IDs,
|
||||
these commands could be used:
|
||||
Note that the the lines of per-atom properties can be listed in any
|
||||
order. Also note that all the per-atom properties specified by the
|
||||
fix ID (prop in this case) must be included on each line in the
|
||||
specified data file section (Molecules in this case).
|
||||
|
||||
Another way of initializing the new properties is via the :doc:`set
|
||||
<set>` command. For example, if you wanted molecules defined for
|
||||
every set of 10 atoms, based on their atom-IDs, these commands could
|
||||
be used:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
@ -185,53 +198,59 @@ these commands could be used:
|
||||
|
||||
The :doc:`atom-style variable <variable>` will create values for atoms
|
||||
with IDs 31,32,33,...40 that are 4.0,4.1,4.2,...,4.9. When the
|
||||
:doc:`set <set>` commands assigns them to the molecule ID for each atom,
|
||||
they will be truncated to an integer value, so atoms 31-40 will all be
|
||||
assigned a molecule ID of 4.
|
||||
:doc:`set <set>` commands assigns them to the molecule ID for each
|
||||
atom, they will be truncated to an integer value, so atoms 31-40 will
|
||||
all be assigned a molecule ID of 4.
|
||||
|
||||
Note that :doc:`atomfile-style variables <variable>` can also be used in
|
||||
place of atom-style variables, which means in this case that the
|
||||
Note that :doc:`atomfile-style variables <variable>` can also be used
|
||||
in place of atom-style variables, which means in this case that the
|
||||
molecule IDs could be read-in from a separate file and assigned by the
|
||||
:doc:`set <set>` command. This allows you to initialize new per-atom
|
||||
properties in a completely general fashion.
|
||||
|
||||
----------
|
||||
|
||||
For new atom properties specified as *i_name* or *d_name*, the
|
||||
:doc:`compute property/atom <compute_property_atom>` command can access
|
||||
their values. This means that the values can be output via the :doc:`dump custom <dump>` command, accessed by fixes like :doc:`fix ave/atom <fix_ave_atom>`, accessed by other computes like :doc:`compute reduce <compute_reduce>`, or used in :doc:`atom-style variables <variable>`.
|
||||
For new atom properties specified as *i_name*, *d_name*, *i2_name*, or
|
||||
*d2_name*, the :doc:`dump custom <dump>` and :doc:`compute
|
||||
property/atom <compute_property_atom>` commands can access their
|
||||
values. This means that the values can be used accessed by fixes like
|
||||
:doc:`fix ave/atom <fix_ave_atom>`, accessed by other computes like
|
||||
:doc:`compute reduce <compute_reduce>`, or used in :doc:`atom-style
|
||||
variables <variable>`.
|
||||
|
||||
For example, these commands will output two new properties to a custom
|
||||
dump file:
|
||||
For example, these commands will output both the instantanous and
|
||||
time-averaged values of two new properties to a custom dump file:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix prop all property/atom i_flag1 d_flag2
|
||||
fix myprops all property/atom i_flag1 d_flag2
|
||||
compute 1 all property/atom i_flag1 d_flag2
|
||||
dump 1 all custom 100 tmp.dump id x y z c_1[1] c_1[2]
|
||||
fix 1 all ave/atom 10 10 100 c_1[1] c_1[2]
|
||||
dump 1 all custom 100 tmp.dump id x y z i_flag1 d_flag2 f_1[1] f_1[2]
|
||||
|
||||
----------
|
||||
|
||||
If you wish to add new :doc:`pair styles <pair_style>`,
|
||||
:doc:`fixes <fix>`, or :doc:`computes <compute>` that use the per-atom
|
||||
properties defined by this fix, see the :doc:`Modify atom <Modify_atom>`
|
||||
doc page which has details on how the properties can be accessed from
|
||||
added classes.
|
||||
If you wish to add new :doc:`pair styles <pair_style>`, :doc:`fixes
|
||||
<fix>`, or :doc:`computes <compute>` that use the per-atom properties
|
||||
defined by this fix, see the :doc:`Modify atom <Modify_atom>` doc page
|
||||
which has details on how the custom properties of this fix can be
|
||||
accessed from added classes.
|
||||
|
||||
----------
|
||||
|
||||
.. _isotopes:
|
||||
|
||||
Example for using per-atom masses with TIP4P water to
|
||||
study isotope effects. When setting up simulations with the :doc:`TIP4P pair styles <Howto_tip4p>` for water, you have to provide exactly
|
||||
one atom type each to identify the water oxygen and hydrogen
|
||||
atoms. Since the atom mass is normally tied to the atom type, this
|
||||
makes it impossible to study multiple isotopes in the same simulation.
|
||||
With *fix property/atom rmass* however, the per-type masses are
|
||||
replaced by per-atom masses. Asumming you have a working input deck
|
||||
for regular TIP4P water, where water oxygen is atom type 1 and water
|
||||
hydrogen is atom type 2, the following lines of input script convert
|
||||
this to using per-atom masses:
|
||||
Here is an example of using per-atom masses with TIP4P water to study
|
||||
isotope effects. When setting up simulations with the :doc:`TIP4P pair
|
||||
styles <Howto_tip4p>` for water, you have to provide exactly one atom
|
||||
type each to identify the water oxygen and hydrogen atoms. Since the
|
||||
atom mass is normally tied to the atom type, this makes it impossible
|
||||
to study multiple isotopes in the same simulation. With *fix
|
||||
property/atom rmass* however, the per-type masses are replaced by
|
||||
per-atom masses. Asumming you have a working input deck for regular
|
||||
TIP4P water, where water oxygen is atom type 1 and water hydrogen is
|
||||
atom type 2, the following lines of input script convert this to using
|
||||
per-atom masses:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
@ -239,22 +258,22 @@ this to using per-atom masses:
|
||||
set type 1 mass 15.9994
|
||||
set type 2 mass 1.008
|
||||
|
||||
When writing out the system data with the :doc:`write_data <write_data>`
|
||||
command, there will be a new section named with the fix-ID
|
||||
(i.e. *Isotopes* in this case). Alternatively, you can take an
|
||||
existing data file and just add this *Isotopes* section with
|
||||
one line per atom containing atom-ID and mass. Either way, the
|
||||
extended data file can be read back with:
|
||||
When writing out the system data with the :doc:`write_data
|
||||
<write_data>` command, there will be a new section named with the
|
||||
fix-ID (i.e. *Isotopes* in this case). Alternatively, you can take an
|
||||
existing data file and just add this *Isotopes* section with one line
|
||||
per atom containing atom-ID and mass. Either way, the extended data
|
||||
file can be read back with:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix Isotopes all property/atom rmass ghost yes
|
||||
read_data tip4p-isotopes.data fix Isotopes NULL Isotopes
|
||||
|
||||
Please note that the first *Isotopes* refers to the fix-ID
|
||||
and the second to the name of the section. The following input
|
||||
script code will now change the first 100 water molecules in this
|
||||
example to heavy water:
|
||||
Please note that the first *Isotopes* refers to the fix-ID and the
|
||||
second to the name of the section. The following input script code
|
||||
will now change the first 100 water molecules in this example to heavy
|
||||
water:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
@ -271,17 +290,19 @@ example to heavy water:
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This fix writes the per-atom values it stores to :doc:`binary restart files <restart>`, so that the values can be restored when a
|
||||
simulation is restarted. See the :doc:`read_restart <read_restart>`
|
||||
command for info on how to re-specify a fix in an input script that
|
||||
reads a restart file, so that the operation of the fix continues in an
|
||||
This fix writes the per-atom values it stores to :doc:`binary restart
|
||||
files <restart>`, so that the values can be restored when a simulation
|
||||
is restarted. See the :doc:`read_restart <read_restart>` command for
|
||||
info on how to re-specify a fix in an input script that reads a
|
||||
restart file, so that the operation of the fix continues in an
|
||||
uninterrupted fashion.
|
||||
|
||||
None of the :doc:`fix_modify <fix_modify>` options are relevant to this
|
||||
fix. No global or per-atom quantities are stored by this fix for
|
||||
None of the :doc:`fix_modify <fix_modify>` options are relevant to
|
||||
this fix. No global or per-atom quantities are stored by this fix for
|
||||
access by various :doc:`output commands <Howto_output>`. No parameter
|
||||
of this fix can be used with the *start/stop* keywords of the
|
||||
:doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
:doc:`run <run>` command. This fix is not invoked during :doc:`energy
|
||||
minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
@ -290,9 +311,10 @@ Restrictions
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`read_data <read_data>`, :doc:`set <set>`, :doc:`compute property/atom <compute_property_atom>`
|
||||
:doc:`read_data <read_data>`, :doc:`set <set>`,
|
||||
:doc:`compute property/atom <compute_property_atom>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
The default keyword values are ghost = no.
|
||||
The default keyword value is ghost = no.
|
||||
|
||||
@ -23,8 +23,8 @@ Syntax
|
||||
q, mux, muy, muz, mu,
|
||||
radius, diameter, omegax, omegay, omegaz,
|
||||
angmomx, angmomy, angmomz, tqx, tqy, tqz,
|
||||
c_ID, c_ID[N], f_ID, f_ID[N], v_name,
|
||||
d_name, i_name
|
||||
c_ID, c_ID[I], f_ID, f_ID[I], v_name,
|
||||
d_name, i_name, i2_name[I], d2_name[I],
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -46,13 +46,15 @@ Syntax
|
||||
omegax,omegay,omegaz = angular velocity of spherical particle
|
||||
angmomx,angmomy,angmomz = angular momentum of aspherical particle
|
||||
tqx,tqy,tqz = torque on finite-size particles
|
||||
c_ID = per-atom vector calculated by a compute with ID
|
||||
c_ID[I] = Ith column of per-atom array calculated by a compute with ID
|
||||
f_ID = per-atom vector calculated by a fix with ID
|
||||
f_ID[I] = Ith column of per-atom array calculated by a fix with ID
|
||||
v_name = per-atom vector calculated by an atom-style variable with name
|
||||
d_name = per-atom floating point vector name, managed by fix property/atom
|
||||
i_name = per-atom integer vector name, managed by fix property/atom
|
||||
*c_ID* = per-atom vector calculated by a compute with ID
|
||||
*c_ID[I]* = Ith column of per-atom array calculated by a compute with ID
|
||||
*f_ID* = per-atom vector calculated by a fix with ID
|
||||
*f_ID[I]* = Ith column of per-atom array calculated by a fix with ID
|
||||
*v_name* = per-atom vector calculated by an atom-style variable with name
|
||||
*i_name* = custom integer vector with name
|
||||
*d_name* = custom floating point vector with name
|
||||
*i2_name[I]* = Ith column of custom integer array with name
|
||||
*d2_name[I]* = Ith column of custom floating-point array with name
|
||||
|
||||
* zero or more keyword/value pairs may be appended
|
||||
* keyword = *com*
|
||||
@ -92,7 +94,8 @@ steps.
|
||||
those attributes may require quantities that are not defined in
|
||||
between runs.
|
||||
|
||||
The list of possible attributes is the same as that used by the :doc:`dump custom <dump>` command, which describes their meaning.
|
||||
The list of possible attributes is the same as that used by the
|
||||
:doc:`dump custom <dump>` command, which describes their meaning.
|
||||
|
||||
If the *com* keyword is set to *yes* then the *xu*\ , *yu*\ , and *zu*
|
||||
inputs store the position of each atom relative to the center-of-mass
|
||||
@ -105,10 +108,11 @@ group.
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This fix writes the per-atom values it stores to :doc:`binary restart files <restart>`, so that the values can be restored when a
|
||||
simulation is restarted. See the :doc:`read_restart <read_restart>`
|
||||
command for info on how to re-specify a fix in an input script that
|
||||
reads a restart file, so that the operation of the fix continues in an
|
||||
This fix writes the per-atom values it stores to :doc:`binary restart
|
||||
files <restart>`, so that the values can be restored when a simulation
|
||||
is restarted. See the :doc:`read_restart <read_restart>` command for
|
||||
info on how to re-specify a fix in an input script that reads a
|
||||
restart file, so that the operation of the fix continues in an
|
||||
uninterrupted fashion.
|
||||
|
||||
None of the :doc:`fix_modify <fix_modify>` options are relevant to this
|
||||
@ -121,7 +125,8 @@ can be accessed by various :doc:`output commands <Howto_output>`. The
|
||||
per-atom values be accessed on any timestep.
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
the :doc:`run <run>` command. This fix is not invoked during
|
||||
:doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -41,7 +41,7 @@ Syntax
|
||||
keyword = *region* or *var* or *every*
|
||||
*region* value = region-ID
|
||||
*var* value = name of variable
|
||||
*property* value = name of per-atom property
|
||||
*property* value = name of custom integer or floating point vector
|
||||
*every* value = N = update group every this many timesteps
|
||||
*static* = no args
|
||||
|
||||
@ -226,18 +226,33 @@ simulation runs. This is in contrast to static groups where atoms are
|
||||
permanently assigned to the group. The way the assignment occurs is
|
||||
as follows. Only atoms in the group specified as the parent group via
|
||||
the parent-ID are assigned to the dynamic group before the following
|
||||
conditions are applied. If the *region* keyword is used, atoms not in
|
||||
the specified region are removed from the dynamic group. If the *var*
|
||||
keyword is used, the variable name must be an atom-style or
|
||||
atomfile-style variable. The variable is evaluated and atoms whose
|
||||
per-atom values are 0.0, are removed from the dynamic group. If the *property*
|
||||
keyword is used, the per-atom property name must be a previously defined
|
||||
per-atom property. The per-atom property is evaluated and atoms whose
|
||||
values are 0.0 are removed from the dynamic group.
|
||||
conditions are applied.
|
||||
|
||||
If the *region* keyword is used, atoms not in the specified region are
|
||||
removed from the dynamic group.
|
||||
|
||||
If the *var* keyword is used, the variable name must be an atom-style
|
||||
or atomfile-style variable. The variable is evaluated and atoms whose
|
||||
per-atom values are 0.0, are removed from the dynamic group.
|
||||
|
||||
If the *property* keyword is used, the name refers to a custom integer
|
||||
or floating point per-atom vector defined via the :doc:`fix
|
||||
property/atom <fix_property_atom>` command. This means the values in
|
||||
the vector can be read as part of a data file with the :doc:`read_data
|
||||
<read_data>` command or specified with the :doc:`set <set>` command.
|
||||
Or accessed and changed via the :doc:`library interface to LAMMPS
|
||||
<Howto_library>`, or by styles you add to LAMMPS (pair, fix, compute,
|
||||
etc) which access the custom vector and modify its values. Which
|
||||
means the values can be modified between or during simulations. Atoms
|
||||
whose values in the custom vector are zero are removed from the
|
||||
dynamic group. Note that the name of the custom per-atom vector is
|
||||
specified just as *name*, not as *i_name* or *d_name* as it is for
|
||||
other commands that use different kinds of custom atom vectors or
|
||||
arrays as arguments.
|
||||
|
||||
The assignment of atoms to a dynamic group is done at the beginning of
|
||||
each run and on every timestep that is a multiple of *N*\ , which is the
|
||||
argument for the *every* keyword (N = 1 is the default). For an
|
||||
each run and on every timestep that is a multiple of *N*\ , which is
|
||||
the argument for the *every* keyword (N = 1 is the default). For an
|
||||
energy minimization, via the :doc:`minimize <minimize>` command, an
|
||||
assignment is made at the beginning of the minimization, but not
|
||||
during the iterations of the minimizer.
|
||||
|
||||
@ -13,7 +13,17 @@ Syntax
|
||||
* style = *atom* or *type* or *mol* or *group* or *region*
|
||||
* ID = atom ID range or type range or mol ID range or group ID or region ID
|
||||
* one or more keyword/value pairs may be appended
|
||||
* keyword = *type* or *type/fraction* or *type/ratio* or *type/subset* or *mol* or *x* or *y* or *z* or *charge* or *dipole* or *dipole/random* or *quat* or *spin* or *spin/random* or *quat* or *quat/random* or *diameter* or *shape* or *length* or *tri* or *theta* or *theta/random* or *angmom* or *omega* or *mass* or *density* or *density/disc* or *volume* or *image* or *bond* or *angle* or *dihedral* or *improper* or *sph/e* or *sph/cv* or *sph/rho* or *smd/contact/radius* or *smd/mass/density* or *dpd/theta* or *edpd/temp* or *edpd/cv* or *cc* or *i_name* or *d_name*
|
||||
* keyword = *type* or *type/fraction* or *type/ratio* or *type/subset*
|
||||
or *mol* or *x* or *y* or *z* or *charge* or *dipole* or
|
||||
*dipole/random* or *quat* or *spin* or *spin/random* or
|
||||
*quat* or *quat/random* or *diameter* or *shape* or
|
||||
*length* or *tri* or *theta* or *theta/random* or *angmom* or
|
||||
*omega* or *mass* or *density* or *density/disc* or
|
||||
*volume* or *image* or *bond* or *angle* or *dihedral* or
|
||||
*improper* or *sph/e* or *sph/cv* or *sph/rho* or
|
||||
*smd/contact/radius* or *smd/mass/density* or *dpd/theta* or
|
||||
*edpd/temp* or *edpd/cv* or *cc* or
|
||||
*i_name* or *d_name* or *i2_name* or *d2_name*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -114,8 +124,12 @@ Syntax
|
||||
*cc* values = index cc
|
||||
index = index of a chemical species (1 to Nspecies)
|
||||
cc = chemical concentration of tDPD particles for a species (mole/volume units)
|
||||
*i_name* value = value for custom integer vector with name
|
||||
*d_name* value = value for custom floating-point vector with name
|
||||
*i_name* value = custom integer vector with name
|
||||
*d_name* value = custom floating-point vector with name
|
||||
*i2_name* value = column of a custom integer array with name
|
||||
column specified as i2_name[N] where N is 1 to Ncol
|
||||
*d2_name* value = column of a custom floating-point array with name
|
||||
column specified as d2_name[N] where N is 1 to Ncol
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
@ -132,6 +146,8 @@ Examples
|
||||
set atom 100*200 x 0.5 y 1.0
|
||||
set atom 100 vx 0.0 vy 0.0 vz -1.0
|
||||
set atom 1492 type 3
|
||||
set atom * i_myVal 5
|
||||
set atom * d2_Sxyz[1] 6.4
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
@ -473,11 +489,13 @@ attribute. An integer for "index" selects a chemical species (1 to
|
||||
Nspecies) where Nspecies is set by the atom_style command. The value
|
||||
for the chemical concentration must be >= 0.0.
|
||||
|
||||
Keywords *i_name* and *d_name* refer to custom integer and
|
||||
floating-point properties that have been added to each atom via the
|
||||
:doc:`fix property/atom <fix_property_atom>` command. When that command
|
||||
is used specific names are given to each attribute which are what is
|
||||
specified as the "name" portion of *i_name* or *d_name*.
|
||||
Keywords *i_name*, *d_name*, *i2_name*, *d2_name* refer to custom
|
||||
per-atom integer and floating-point vectors or arrays that have been
|
||||
added via the :doc:`fix property/atom <fix_property_atom>` command.
|
||||
When that command is used specific names are given to each attribute
|
||||
which are the "name" portion of these keywords. For arrays *i2_name*
|
||||
and *d2_name*, the column of the array must also be included following
|
||||
the name in brackets: e.g. d2_xyz[2], i2_mySpin[3].
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
Reference in New Issue
Block a user