Commit d1442b05 authored by Steve Plimpton's avatar Steve Plimpton
Browse files

enable per-atom custom arrays in addition to vectors

parent d00807ee
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -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.

----------

+62 −55
Original line number Diff line number Diff line
@@ -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
"""""""""""
+26 −19
Original line number Diff line number Diff line
@@ -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
+142 −120

File changed.

Preview size limit exceeded, changes collapsed.

+20 −15
Original line number Diff line number Diff line
@@ -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
""""""""""""
Loading