diff --git a/doc/Section_modify.html b/doc/Section_modify.html index e3ff305147..305bbbda19 100644 --- a/doc/Section_modify.html +++ b/doc/Section_modify.html @@ -139,11 +139,12 @@ details on this at the bottom of this page.
Classes that define an atom style are derived from the AtomVec class -and managed by the Atom class. The atom style determines what -quantities are associated with an atom. A new atom style can be -created if one of the existing atom styles does not define all -the arrays you need to store and communicate with atoms. +
Classes that define an atom style are derived from +the AtomVec class and managed by the Atom class. The atom style +determines what attributes are associated with an atom. A new atom +style can be created if one of the existing atom styles does not +define all the attributes you need to store and communicate with +atoms.
Atom_vec_atomic.cpp is a simple example of an atom style.
@@ -190,6 +191,36 @@ in atom_vec.h. New atom arrays are defined in atom.cpp. Search for the word "customize" and you will find locations you will need to modify. +IMPORTANT NOTE: It is possible to add some attributes, such as a +molecule ID, to atom styles that do not have them via the fix +property/atom command. This command also +allows new custom attributes consisting of extra integer or +floating-point values to be added to atoms. See the fix +property/atom doc page for examples of cases +where this is useful and details on how to initialize, access, and +output the custom values. +
+New pair styles, fixes, or +computes can be added to LAMMPS, as discussed below. +The code for these classes can use the per-atom properties defined by +fix property/atom. The Atom class has a find_custom() method that is +useful in this context: +
+int index = find_custom(char *name, int &flag); +
+The "name" of a custom attribute, as specified in the fix +property/atom command, is checked to verify +that it exists and its index is returned. The method also sets flag = +0/1 depending on whether it is an integer or floating-point attribute. +The vector of values associated with the attribute can then be +accessed using the returned index as +
+int *ivector = atom->ivectorindex; +double *dvector = atom->dvectorindex; +
+Ivector or dvector are vectors of length Nlocal = # of owned atoms, +which store the attributes of individual atoms. +
All of the styles define point particles, except the sphere, +
IMPORTANT NOTE: It is possible to add some attributes, such as a +molecule ID, to atom styles that do not have them via the fix +property/atom command. This command also +allows new custom attributes consisting of extra integer or +floating-point values to be added to atoms. See the fix +property/atom doc page for examples of cases +where this is useful and details on how to initialize, access, and +output the custom values. +
+All of the above styles define point particles, except the sphere, ellipsoid, electron, peri, wavepacket, line, tri, and body styles, which define finite-size particles. See Section_howto 14 for an overview of using finite-size diff --git a/doc/atom_style.txt b/doc/atom_style.txt index 3ecb6027d9..44049ee8f1 100644 --- a/doc/atom_style.txt +++ b/doc/atom_style.txt @@ -73,7 +73,16 @@ quantities. {tri} | corner points, angular momentum | rigid bodies | {wavepacket} | charge, spin, eradius, etag, cs_re, cs_im | AWPMD :tb(c=3,s=|) -All of the styles define point particles, except the {sphere}, +IMPORTANT NOTE: It is possible to add some attributes, such as a +molecule ID, to atom styles that do not have them via the "fix +property/atom"_fix_property_atom.html command. This command also +allows new custom attributes consisting of extra integer or +floating-point values to be added to atoms. See the "fix +property/atom"_fix_property_atom.html doc page for examples of cases +where this is useful and details on how to initialize, access, and +output the custom values. + +All of the above styles define point particles, except the {sphere}, {ellipsoid}, {electron}, {peri}, {wavepacket}, {line}, {tri}, and {body} styles, which define finite-size particles. See "Section_howto 14"_Section_howto.html#howto_14 for an overview of using finite-size diff --git a/doc/compute_property_atom.html b/doc/compute_property_atom.html index 817cccae48..75674c3915 100644 --- a/doc/compute_property_atom.html +++ b/doc/compute_property_atom.html @@ -33,7 +33,8 @@ end1x, end1y, end1z, end2x, end2y, end2z, corner1x, corner1y, corner1z, corner2x, corner2y, corner2z, - corner3x, corner3y, corner3z + corner3x, corner3y, corner3z, + i_name, d_name
id = atom ID
mol = molecule ID
@@ -59,7 +60,9 @@
ervel = electron radial velocity
erforce = electron radial force
end12x, end12y, end12z = end points of line segment
- coner123x, corner123y, corner123z = corner points of triangle
+ coner123x, corner123y, corner123z = corner points of triangle
+ i_name = custom integer vector with name
+ d_name = custom integer vector with name
@@ -108,6 +111,12 @@ line segment particles and define the end points of each line segment.
corner2z, corner3x, corner3y, corner3z, are defined for
triangular particles and define the corner points of each triangle.
+The i_name and d_name attributes refer to custom integer and +floating-point properties that have been added to each atom via the +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. +
Output info:
This compute calculates a per-atom vector or per-atom array depending @@ -128,7 +137,8 @@ units for q, etc.
Related commands:
dump custom, compute reduce, fix -ave/atom, fix ave/spatial +ave/atom, fix ave/spatial, +fix property/atom
Default: none
diff --git a/doc/compute_property_atom.txt b/doc/compute_property_atom.txt index ba80775e45..558d72d76e 100644 --- a/doc/compute_property_atom.txt +++ b/doc/compute_property_atom.txt @@ -27,7 +27,8 @@ input = one or more atom attributes :l end1x, end1y, end1z, end2x, end2y, end2z, corner1x, corner1y, corner1z, corner2x, corner2y, corner2z, - corner3x, corner3y, corner3z :pre + corner3x, corner3y, corner3z, + i_name, d_name :pre id = atom ID mol = molecule ID type = atom type @@ -52,7 +53,9 @@ input = one or more atom attributes :l ervel = electron radial velocity erforce = electron radial force end12x, end12y, end12z = end points of line segment - coner123x, corner123y, corner123z = corner points of triangle :pre + coner123x, corner123y, corner123z = corner points of triangle + i_name = custom integer vector with name + d_name = custom integer vector with name :pre :ule [Examples:] @@ -100,6 +103,12 @@ line segment particles and define the end points of each line segment. {corner2z}, {corner3x}, {corner3y}, {corner3z}, are defined for triangular particles and define the corner points of each triangle. +The {i_name} and {d_name} attributes refer to custom integer and +floating-point properties that have been added to each atom via the +"fix property/atom"_fix_property_atom.html 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}. + [Output info:] This compute calculates a per-atom vector or per-atom array depending @@ -120,6 +129,7 @@ units for q, etc. [Related commands:] "dump custom"_dump.html, "compute reduce"_compute_reduce.html, "fix -ave/atom"_fix_ave_atom.html, "fix ave/spatial"_fix_ave_spatial.html +ave/atom"_fix_ave_atom.html, "fix ave/spatial"_fix_ave_spatial.html, +"fix property/atom"_fix_property_atom.html [Default:] none diff --git a/doc/fix_property_atom.html b/doc/fix_property_atom.html index 4f7201a749..677bc9c7b1 100644 --- a/doc/fix_property_atom.html +++ b/doc/fix_property_atom.html @@ -49,7 +49,8 @@ is ignored by this fix. properties, as explained on the atom_style and 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 ones. +is read. This fix will augment the set of properties with new custom +ones.This can be useful in at least two scenarios.
@@ -70,12 +71,12 @@ atom styles, so they can be used by atom styles that don't define them.More generally, the i_name and d_name vectors allow one or more -new 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. +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.
This is effectively a simple way to add per-atom properties to a model without needing to write code for a new atom style @@ -177,11 +178,11 @@ dump 1 all custom 100 tmp.dump id x y z c_11 c_12
This section is for users who wish to write new pair styles, -fixes, or computes that use the per-atom properties defined -by this fix. -
-Need to add some details here. +
If you wish to add new pair styles, +fixes, or computes that use the per-atom +properties defined by this fix, see Section +modify of the manual which has some details +on how the properties can be accessed from added classes.
type value = atom type
value can be an atom-style variable (see below)
@@ -82,7 +82,9 @@
meso_cv value = heat capacity of SPH particles (need units)
value can be an atom-style variable (see below)
meso_rho value = density of SPH particles (need units)
- value can be an atom-style variable (see below)
+ value can be an atom-style variable (see below)
+ i_name value = value for custom integer vector with name
+ d_name value = value for custom floating-point vector with name
@@ -349,6 +351,12 @@ capacity, and density of smmothed particle hydrodynamics (SPH)
particles. See this PDF guide to
using SPH in LAMMPS.
+Keywords i_name and d_name refer to custom integer and +floating-point properties that have been added to each atom via the +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. +
Restrictions:
You cannot set an atom attribute (e.g. mol or q or volume) if diff --git a/doc/set.txt b/doc/set.txt index cb74466bce..d901880fb6 100644 --- a/doc/set.txt +++ b/doc/set.txt @@ -21,7 +21,7 @@ keyword = {type} or {type/fraction} or {mol} or {x} or {y} or {z} or \ {length} or {tri} or {theta} or {angmom} or \ {mass} or {density} or {volume} or {image} or {bond} or {angle} or {dihedral} or {improper} or - {meso_e} or {meso_cv} or {meso_rho} :l + {meso_e} or {meso_cv} or {meso_rho} or {i_name} or {d_name} :l {type} value = atom type value can be an atom-style variable (see below) {type/fraction} values = type fraction seed @@ -79,7 +79,9 @@ keyword = {type} or {type/fraction} or {mol} or {x} or {y} or {z} or \ {meso_cv} value = heat capacity of SPH particles (need units) value can be an atom-style variable (see below) {meso_rho} value = density of SPH particles (need units) - value can be an atom-style variable (see below) :pre + value can be an atom-style variable (see below) + {i_name} value = value for custom integer vector with name + {d_name} value = value for custom floating-point vector with name :pre :ule [Examples:] @@ -345,6 +347,12 @@ capacity, and density of smmothed particle hydrodynamics (SPH) particles. See "this PDF guide"_USER/sph/SPH_LAMMPS_userguide.pdf to using SPH in LAMMPS. +Keywords {i_name} and {d_name} refer to custom integer and +floating-point properties that have been added to each atom via the +"fix property/atom"_fix_property_atom.html 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}. + [Restrictions:] You cannot set an atom attribute (e.g. {mol} or {q} or {volume}) if