forked from lijiext/lammps
new doc edits for refactored AtomVec styles
This commit is contained in:
parent
950300c86a
commit
986e5b746e
|
@ -10,7 +10,6 @@ If you add a new feature to LAMMPS and think it will be of interest to
|
|||
general users, we encourage you to submit it for inclusion in LAMMPS
|
||||
as a pull request on our `GitHub site <https://github.com/lammps/lammps>`_, after reading the :doc:`Modify contribute <Modify_contribute>` doc page.
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
|
@ -33,8 +32,3 @@ as a pull request on our `GitHub site <https://github.com/lammps/lammps>`_, afte
|
|||
Modify_body
|
||||
Modify_thermo
|
||||
Modify_variable
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
|
|
|
@ -3,122 +3,168 @@ Atom styles
|
|||
|
||||
Classes that define an :doc:`atom style <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.
|
||||
determines what attributes are associated with an atom and
|
||||
communicated when it is a ghost atom or migrates to a new processor.
|
||||
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.
|
||||
Atom\_vec\_atomic.cpp is the simplest example of an atom style.
|
||||
Examining the code for others will make these instructions more clear.
|
||||
|
||||
Here is a brief description of methods you define in your new derived
|
||||
class. See atom\_vec.h for details.
|
||||
Note that the :doc:`atom style hybrid <atom_style>` command can be
|
||||
used to define atoms or particles which have the union of properties
|
||||
of individual styles. Also the :doc:`fix property/atom <fix
|
||||
property>` command can be used to add a single property (e.g. charge
|
||||
or a molecule ID) to a style that does not have it. It can also be
|
||||
used to add custom properties to an atom, with options to communicate
|
||||
them with ghost atoms or read them from a data file. Other LAMMPS
|
||||
commands can access these custom properties, as can new pair, fix,
|
||||
compute styles that are written to work with these properties. For
|
||||
example, the :doc:`set <set>` command can be used to set the values of
|
||||
custom per-atom properties from an input script. All of these methods
|
||||
are less work than writing code for a new atom style.
|
||||
|
||||
If you follow these directions your new style will automatically work
|
||||
in tandem with others via the :doc:`atom_style hybrid <atom_style>`
|
||||
command.
|
||||
|
||||
The first step is to define a set of strings in the constructor of the
|
||||
new derived class. Each string will have zero or more space-separated
|
||||
variable names which are identical to those used in the atom.h header
|
||||
file for per-atom properties. Note that some represent per-atom
|
||||
vectors (q, molecule) while other are per-atom arrays (x,v). For all
|
||||
but the last 2 strings you do not need to specify any of
|
||||
(id,type,x,v,f). Those are included automatically as needed in the
|
||||
other strings.
|
||||
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| init | one time setup (optional) |
|
||||
| fields\_grow | full list of properties which is allocated and stored |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| grow | re-allocate atom arrays to longer lengths (required) |
|
||||
| fields\_copy | list of properties to copy atoms are rearranged on-processor |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| grow\_reset | make array pointers in Atom and AtomVec classes consistent (required) |
|
||||
| fields\_comm | list of properties communicated to ghost atoms every step |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| copy | copy info for one atom to another atom's array locations (required) |
|
||||
| fields\_comm\_vel | additional properties communicated if :doc:`comm_modify vel <atom_style>` is used |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| pack\_comm | store an atom's info in a buffer communicated every timestep (required) |
|
||||
| fields\_reverse | list of properties summed from ghost atoms every step |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| pack\_comm\_vel | add velocity info to communication buffer (required) |
|
||||
| fields\_border | list of properties communicated with ghost atoms every reneighboring step |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| pack\_comm\_hybrid | store extra info unique to this atom style (optional) |
|
||||
| fields\_border\_vel | additional properties communicated if :doc:`comm_modify vel <atom_style>` is used |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| unpack\_comm | retrieve an atom's info from the buffer (required) |
|
||||
| fields\_exchange | list of properties communicated when an atom migrates to another processor |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| unpack\_comm\_vel | also retrieve velocity info (required) |
|
||||
| fields\_restart | list of properties written/read to/from a restart file |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| unpack\_comm\_hybrid | retrieve extra info unique to this atom style (optional) |
|
||||
| fields\_create | list of properties defined when an atom is created by :doc:`create_atoms <create_atoms>` |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| pack\_reverse | store an atom's info in a buffer communicating partial forces (required) |
|
||||
| fields\_data\_atom | list of properties (in order) in the Atoms section of a data file, as read by :doc:`read_data <read_data>` |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| pack\_reverse\_hybrid | store extra info unique to this atom style (optional) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| unpack\_reverse | retrieve an atom's info from the buffer (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| unpack\_reverse\_hybrid | retrieve extra info unique to this atom style (optional) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| pack\_border | store an atom's info in a buffer communicated on neighbor re-builds (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| pack\_border\_vel | add velocity info to buffer (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| pack\_border\_hybrid | store extra info unique to this atom style (optional) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| unpack\_border | retrieve an atom's info from the buffer (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| unpack\_border\_vel | also retrieve velocity info (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| unpack\_border\_hybrid | retrieve extra info unique to this atom style (optional) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| pack\_exchange | store all an atom's info to migrate to another processor (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| unpack\_exchange | retrieve an atom's info from the buffer (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| size\_restart | number of restart quantities associated with proc's atoms (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| pack\_restart | pack atom quantities into a buffer (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| unpack\_restart | unpack atom quantities from a buffer (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| create\_atom | create an individual atom of this style (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| data\_atom | parse an atom line from the data file (required) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| data\_atom\_hybrid | parse additional atom info unique to this atom style (optional) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| data\_vel | parse one line of velocity information from data file (optional) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| data\_vel\_hybrid | parse additional velocity data unique to this atom style (optional) |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| memory\_usage | tally memory allocated by atom arrays (required) |
|
||||
| fields\_data\_vel | list of properties (in order) in the Velocities section of a data file, as read by :doc:`read_data <read_data>` |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
|
||||
The constructor of the derived class sets values for several variables
|
||||
that you must set when defining a new atom style, which are documented
|
||||
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.
|
||||
In these strings you can list variable names which LAMMPS already
|
||||
defines (in some other atom style), or you can create new variable
|
||||
names. You should not re-use a LAMMPS variable for something with
|
||||
different meaning in your atom style. If the meaning is related, but
|
||||
interpreted differently by your atom style, then using the same
|
||||
variable name means a user should not use your style and the other
|
||||
style together in a :doc:`atom_style hybrid <atom_style>` command.
|
||||
Because there will only be one value of the variable and different
|
||||
parts of LAMMPS will then likely use it differently. LAMMPS has
|
||||
no way of checking for this.
|
||||
|
||||
.. note::
|
||||
If you are defining new variable names then make them descriptive and
|
||||
unique to your new atom style. For example choosing "e" for energy is
|
||||
a bad choice; it is too generic. A better choice would be "e\_foo",
|
||||
where "foo" is specific to your style.
|
||||
|
||||
It is possible to add some attributes, such as a molecule ID, to
|
||||
atom styles that do not have them via the :doc:`fix property/atom <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 :doc:`fix property/atom <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.
|
||||
If any of the variable names in your new atom style do not exist in
|
||||
LAMMPS, you need to add them to the src/atom.h and atom.cpp files.
|
||||
|
||||
New :doc:`pair styles <pair_style>`, :doc:`fixes <fix>`, or
|
||||
:doc:`computes <compute>` 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:
|
||||
Search for the word "customize" or "customization" in these 2 files to
|
||||
see where to add your variable. Adding a flag to the 2nd
|
||||
customization section in atom.h is only necessary if your code (e.g. a
|
||||
pair style) needs to check that a per-atom property is defined. These
|
||||
flags should also be set in the constructor of the atom style child
|
||||
class.
|
||||
|
||||
In atom.cpp, aside from the constructor and destructor, there are 3
|
||||
methods that a new variable name or flag needs to be added to.
|
||||
|
||||
.. parsed-literal::
|
||||
In Atom::peratom\_create() when using the add_peratom() method, a
|
||||
final length argument of 0 is for per-atom vectors, a length > 1 is
|
||||
for per-atom arrays. Note the use of an extra per-thread flag and the
|
||||
add_peratom_vary() method when last dimension of the array is
|
||||
variable-length.
|
||||
|
||||
int index = atom->find_custom(char \*name, int &flag);
|
||||
Adding the variable name to Atom::extract() enable the per-atom data
|
||||
to be accessed through the :doc:`LAMMPS library interface
|
||||
<Howto_library>` by a calling code, including from :doc:`Python
|
||||
<Python_head>`.
|
||||
|
||||
The "name" of a custom attribute, as specified in the :doc:`fix property/atom <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
|
||||
The constructor of the new atom style will also typically set a few
|
||||
flags which are defined at the top of atom_vec.h. If these are
|
||||
unclear, see how other atom styles use them.
|
||||
|
||||
The grow_pointers() method is also required to make
|
||||
a copy of peratom data pointers, as explained in the code.
|
||||
|
||||
.. parsed-literal::
|
||||
There are a number of other optional methods which your atom style can
|
||||
implement. These are only needed if you need to do something
|
||||
out-of-the-oridinary which the default operation of the AtomVec parent
|
||||
class does not take care of. The best way to figure out why they are
|
||||
sometimes useful is to look at how other atom styles use them.
|
||||
|
||||
int \*ivector = atom->ivector[index];
|
||||
double \*dvector = atom->dvector[index];
|
||||
* process_args = use if the atom style has arguments
|
||||
* init = called before each run
|
||||
* force_clear = called before force computations each timestep
|
||||
|
||||
Ivector or dvector are vectors of length Nlocal = # of owned atoms,
|
||||
which store the attributes of individual atoms.
|
||||
A few atom styles define "bonus" data associated with some or all of
|
||||
their particles, such as :doc:`atom_style ellipsoid or tri
|
||||
<atom_style>`. These methods work with that data:
|
||||
|
||||
* copy_bonus
|
||||
* clear_bonus
|
||||
* pack_comm_bonus
|
||||
* unpack_comm_bonus
|
||||
* pack_border_bonus
|
||||
* unpack_border_bonus
|
||||
* pack_exchange_bonus
|
||||
* unpack_exchange_bonus
|
||||
* size_restart_bonus
|
||||
* pack_restart_bonus
|
||||
* unpack_restart_bonus
|
||||
* data_atom_bonus
|
||||
* memory_usage_bonus
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
The :doc:`atom_style body <atom_style>` command can define a particle
|
||||
geomerty with an arbitrary number of values. This method reads it
|
||||
from a data file:
|
||||
|
||||
* data_body
|
||||
|
||||
These methods are called before or after operations handled by the
|
||||
parent AtomVec class. They allow an atom style to do customized
|
||||
operations on the per-atom values. For example :doc:`atom_style
|
||||
sphere <atom_style>` reads a diameter and density of each particle
|
||||
from a data file. But these need to be converted internally to a
|
||||
radius and mass. That operation is done in the data_\atom\_post()
|
||||
method.
|
||||
|
||||
* pack_restart_pre
|
||||
* pack_restart_post
|
||||
* unpack_restart_init
|
||||
* create_atom_post
|
||||
* data_atom_post
|
||||
* pack_data_pre
|
||||
* pack_data_post
|
||||
|
||||
These methods enable the :doc:`compute property/atom <compute
|
||||
property/atom>` command to access per-atom variables it does not
|
||||
already define as arguments, so that they can be written to a dump
|
||||
file or used by other LAMMPS commands.
|
||||
|
||||
* property_atom
|
||||
* pack_property_atom
|
||||
|
|
|
@ -6,20 +6,21 @@ atom_style command
|
|||
Syntax
|
||||
""""""
|
||||
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
atom_style style args
|
||||
|
||||
* style = *angle* or *atomic* or *body* or *bond* or *charge* or *dipole* or *dpd* or *edpd* or *mdpd* or *tdpd* or *electron* or *ellipsoid* or *full* or *line* or *meso* or *molecular* or *peri* or *smd* or *sphere* or *spin* or *tri* or *template* or *hybrid*
|
||||
|
||||
* style = *angle* or *atomic* or *body* or *bond* or *charge* or *dipole* or *dpd* or *edpd* or *electron* or *ellipsoid* or *full* or *line* or *mdpd* or *meso* or *molecular* or *peri* or *smd* or *sphere* or *spin* or *tdpd* or *tri* or *template* or *hybrid*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
|
||||
args = none for any style except the following
|
||||
*body* args = bstyle bstyle-args
|
||||
bstyle = style of body particles
|
||||
bstyle-args = additional arguments specific to the bstyle
|
||||
see the :doc:`Howto body <Howto_body>` doc page for details
|
||||
see the :doc:`Howto body <Howto_body>` doc
|
||||
page for details
|
||||
*sphere* arg = 0/1 (optional) for static/dynamic particle radii
|
||||
*tdpd* arg = Nspecies
|
||||
Nspecies = # of chemical species
|
||||
*template* arg = template-ID
|
||||
|
@ -28,11 +29,9 @@ Syntax
|
|||
|
||||
* accelerated styles (with same args) = *angle/kk* or *atomic/kk* or *bond/kk* or *charge/kk* or *full/kk* or *molecular/kk*
|
||||
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
atom_style atomic
|
||||
|
@ -50,8 +49,8 @@ Description
|
|||
|
||||
Define what style of atoms to use in a simulation. This determines
|
||||
what attributes are associated with the atoms. This command must be
|
||||
used before a simulation is setup via a :doc:`read\_data <read_data>`,
|
||||
:doc:`read\_restart <read_restart>`, or :doc:`create\_box <create_box>`
|
||||
used before a simulation is setup via a :doc:`read_data <read_data>`,
|
||||
:doc:`read_restart <read_restart>`, or :doc:`create_box <create_box>`
|
||||
command.
|
||||
|
||||
.. note::
|
||||
|
@ -68,12 +67,12 @@ style more general than needed, though it may be slightly inefficient.
|
|||
The choice of style affects what quantities are stored by each atom,
|
||||
what quantities are communicated between processors to enable forces
|
||||
to be computed, and what quantities are listed in the data file read
|
||||
by the :doc:`read\_data <read_data>` command.
|
||||
by the :doc:`read_data <read_data>` command.
|
||||
|
||||
These are the additional attributes of each style and the typical
|
||||
kinds of physical systems they are used to model. All styles store
|
||||
coordinates, velocities, atom IDs and types. See the
|
||||
:doc:`read\_data <read_data>`, :doc:`create\_atoms <create_atoms>`, and
|
||||
:doc:`read_data <read_data>`, :doc:`create_atoms <create_atoms>`, and
|
||||
:doc:`set <set>` commands for info on how to set these various
|
||||
quantities.
|
||||
|
||||
|
@ -94,10 +93,6 @@ quantities.
|
|||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *edpd* | temperature and heat capacity | eDPD particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *mdpd* | density | mDPD particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *tdpd* | chemical concentration | tDPD particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *electron* | charge and spin and eradius | electronic force field |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *ellipsoid* | shape, quaternion, angular momentum | aspherical particles |
|
||||
|
@ -106,6 +101,8 @@ quantities.
|
|||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *line* | end points, angular velocity | rigid bodies |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *mdpd* | density | mDPD particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *meso* | rho, e, cv | SPH particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *molecular* | bonds, angles, dihedrals, impropers | uncharged molecules |
|
||||
|
@ -118,6 +115,8 @@ quantities.
|
|||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *spin* | magnetic moment | system with magnetic particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *tdpd* | chemical concentration | tDPD particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *template* | template index, template atom | small molecules with fixed topology |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *tri* | corner points, angular momentum | rigid bodies |
|
||||
|
@ -147,9 +146,16 @@ basis.
|
|||
For the *sphere* style, the particles are spheres and each stores a
|
||||
per-particle diameter and mass. If the diameter > 0.0, the particle
|
||||
is a finite-size sphere. If the diameter = 0.0, it is a point
|
||||
particle. Note that by use of the *disc* keyword with the :doc:`fix nve/sphere <fix_nve_sphere>`, :doc:`fix nvt/sphere <fix_nvt_sphere>`,
|
||||
:doc:`fix nph/sphere <fix_nph_sphere>`, :doc:`fix npt/sphere <fix_npt_sphere>` commands, spheres can be effectively
|
||||
treated as 2d discs for a 2d simulation if desired. See also the :doc:`set density/disc <set>` command.
|
||||
particle. Note that by use of the *disc* keyword with the :doc:`fix
|
||||
nve/sphere <fix_nve_sphere>`, :doc:`fix nvt/sphere <fix_nvt_sphere>`,
|
||||
:doc:`fix nph/sphere <fix_nph_sphere>`, :doc:`fix npt/sphere
|
||||
<fix_npt_sphere>` commands, spheres can be effectively treated as 2d
|
||||
discs for a 2d simulation if desired. See also the :doc:`set
|
||||
density/disc <set>` command. The *sphere* style takes an optional 0
|
||||
or 1 argument. A value of 0 means the radius of each sphere is
|
||||
constant for the duration of the simulation. A value of 1 means the
|
||||
radii may vary dynamically during the simulation, e.g. due to use of
|
||||
the :doc:`fix adapt <fix_adapt>` command.
|
||||
|
||||
For the *ellipsoid* style, the particles are ellipsoids and each
|
||||
stores a flag which indicates whether it is a finite-size ellipsoid or
|
||||
|
@ -173,7 +179,7 @@ per-particle mass and volume.
|
|||
|
||||
The *dpd* style is for dissipative particle dynamics (DPD) particles.
|
||||
Note that it is part of the USER-DPD package, and is not for use with
|
||||
the :doc:`pair\_style dpd or dpd/stat <pair_dpd>` commands, which can
|
||||
the :doc:`pair_style dpd or dpd/stat <pair_dpd>` commands, which can
|
||||
simply use atom\_style atomic. Atom\_style dpd extends DPD particle
|
||||
properties with internal temperature (dpdTheta), internal conductive
|
||||
energy (uCond), internal mechanical energy (uMech), and internal
|
||||
|
@ -240,7 +246,7 @@ can be advantageous for large-scale coarse-grained systems.
|
|||
another CO2, then you probably do not want each molecule file to
|
||||
define 2 atom types and a single bond type, because they will conflict
|
||||
with each other when a mixture system of H2O and CO2 molecules is
|
||||
defined, e.g. by the :doc:`read\_data <read_data>` command. Rather the
|
||||
defined, e.g. by the :doc:`read_data <read_data>` command. Rather the
|
||||
H2O molecule should define atom types 1 and 2, and bond type 1. And
|
||||
the CO2 molecule should define atom types 3 and 4 (or atom types 3 and
|
||||
2 if a single oxygen type is desired), and bond type 2.
|
||||
|
@ -262,10 +268,8 @@ Note that there may be additional arguments required along with the
|
|||
*bstyle* specification, in the atom\_style body command. These
|
||||
arguments are described on the :doc:`Howto body <Howto_body>` doc page.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
Typically, simulations require only a single (non-hybrid) atom style.
|
||||
If some atoms in the simulation do not have all the properties defined
|
||||
by a particular style, use the simplest style that defines all the
|
||||
|
@ -287,10 +291,8 @@ per-atom basis.
|
|||
LAMMPS can be extended with new atom styles as well as new body
|
||||
styles; see the :doc:`Modify <Modify>` doc page.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
Styles with a *kk* suffix are functionally the same as the
|
||||
corresponding style without the suffix. They have been optimized to
|
||||
run faster, depending on your available hardware, as discussed in on
|
||||
|
@ -315,9 +317,8 @@ instructions on how to use the accelerated styles effectively.
|
|||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
|
||||
This command cannot be used after the simulation box is defined by a
|
||||
:doc:`read\_data <read_data>` or :doc:`create\_box <create_box>` command.
|
||||
:doc:`read_data <read_data>` or :doc:`create_box <create_box>` command.
|
||||
|
||||
Many of the styles listed above are only enabled if LAMMPS was built
|
||||
with a specific package, as listed below. See the :doc:`Build package <Build_package>` doc page for more info.
|
||||
|
@ -338,7 +339,7 @@ The *electron* style is part of the USER-EFF package for :doc:`electronic force
|
|||
The *dpd* style is part of the USER-DPD package for dissipative
|
||||
particle dynamics (DPD).
|
||||
|
||||
The *edpd*\ , *mdpd*\ , and *tdpd* styles are part of the USER-MESO package
|
||||
The *edpd*\ , *mdpd*\ , and *tdpd* styles are part of the USER-MESODPD package
|
||||
for energy-conserving dissipative particle dynamics (eDPD), many-body
|
||||
dissipative particle dynamics (mDPD), and transport dissipative particle
|
||||
dynamics (tDPD), respectively.
|
||||
|
@ -354,20 +355,17 @@ The *wavepacket* style is part of the USER-AWPMD package for the
|
|||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`read\_data <read_data>`, :doc:`pair\_style <pair_style>`
|
||||
:doc:`read_data <read_data>`, :doc:`pair_style <pair_style>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
atom\_style atomic
|
||||
|
||||
The default atom style is atomic. If atom\_style sphere is used its
|
||||
default argument is 0.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _Grime:
|
||||
|
||||
|
||||
|
||||
**(Grime)** Grime and Voth, to appear in J Chem Theory & Computation
|
||||
(2014).
|
||||
|
|
|
@ -6,7 +6,6 @@ compute property/atom command
|
|||
Syntax
|
||||
""""""
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
compute ID group-ID property/atom input1 input2 ...
|
||||
|
@ -14,9 +13,9 @@ Syntax
|
|||
* ID, group-ID are documented in :doc:`compute <compute>` command
|
||||
* property/atom = style name of this compute command
|
||||
* input = one or more atom attributes
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
|
||||
possible attributes = id, mol, proc, type, mass,
|
||||
x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz,
|
||||
vx, vy, vz, fx, fy, fz,
|
||||
|
@ -36,9 +35,8 @@ Syntax
|
|||
rho, drho, e, de, cv,
|
||||
i_name, d_name
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
|
||||
id = atom ID
|
||||
mol = molecule ID
|
||||
proc = ID of processor that owns atom
|
||||
|
@ -66,46 +64,39 @@ Syntax
|
|||
corner123x, corner123y, corner123z = corner points of triangle
|
||||
nbonds = number of bonds assigned to an atom
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
PERI package per-atom properties:
|
||||
vfrac = ???
|
||||
s0 = ???
|
||||
|
||||
|
||||
PERI package per-atom properties:
|
||||
vfrac = volume fraction
|
||||
s0 = max stretch of any bond a particle is part of
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
|
||||
USER-EFF and USER-AWPMD package per-atom properties:
|
||||
spin = electron spin
|
||||
eradius = electron radius
|
||||
ervel = electron radial velocity
|
||||
erforce = electron radial force
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
USER-SPH package per-atom properties:
|
||||
rho = ???
|
||||
drho = ???
|
||||
e = ???
|
||||
de = ???
|
||||
cv = ???
|
||||
|
||||
|
||||
USER-SPH package per-atom properties:
|
||||
rho = density of SPH particles
|
||||
drho = change in density
|
||||
e = energy
|
||||
de = change in thermal energy
|
||||
cv = heat capacity
|
||||
|
||||
.. 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
|
||||
|
||||
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
compute 1 all property/atom xs vx fx mux
|
||||
compute 2 all property/atom type
|
||||
|
@ -117,13 +108,17 @@ Description
|
|||
|
||||
Define a computation that simply stores atom attributes for each atom
|
||||
in the group. This is useful so that the values can be used by other
|
||||
:doc:`output commands <Howto_output>` that take computes as inputs. See
|
||||
for example, the :doc:`compute reduce <compute_reduce>`, :doc:`fix 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.
|
||||
:doc:`output commands <Howto_output>` that take computes as inputs.
|
||||
See for example, the :doc:`compute reduce <compute_reduce>`, :doc:`fix
|
||||
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 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 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
|
||||
|
@ -141,8 +136,9 @@ particles and body particles and store the 4-vector quaternion
|
|||
representing the orientation of each particle. See the :doc:`set <set>`
|
||||
command for an explanation of the quaternion vector.
|
||||
|
||||
*End1x*\ , *end1y*\ , *end1z*\ , *end2x*\ , *end2y*\ , *end2z*\ , are defined for
|
||||
line segment particles and define the end points of each line segment.
|
||||
*End1x*\ , *end1y*\ , *end1z*\ , *end2x*\ , *end2y*\ , *end2z*\ , are
|
||||
defined for line segment particles and define the end points of each
|
||||
line segment.
|
||||
|
||||
*Corner1x*\ , *corner1y*\ , *corner1z*\ , *corner2x*\ , *corner2y*\ ,
|
||||
*corner2z*\ , *corner3x*\ , *corner3y*\ , *corner3z*\ , are defined for
|
||||
|
@ -153,14 +149,14 @@ 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.
|
||||
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*.
|
||||
: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*.
|
||||
|
||||
**Output info:**
|
||||
|
||||
|
@ -169,8 +165,8 @@ on the number of input values. If a single input is specified, a
|
|||
per-atom vector is produced. If two or more inputs are specified, a
|
||||
per-atom array is produced where the number of columns = the number of
|
||||
inputs. The vector or array can be accessed by any command that uses
|
||||
per-atom values from a compute as input. See the :doc:`Howto output <Howto_output>` doc page for an overview of LAMMPS output
|
||||
options.
|
||||
per-atom values from a compute as input. See the :doc:`Howto output
|
||||
<Howto_output>` doc page for an overview of LAMMPS output options.
|
||||
|
||||
The vector or array values will be in whatever :doc:`units <units>` the
|
||||
corresponding attribute is in, e.g. velocity units for vx, charge
|
||||
|
@ -187,12 +183,8 @@ Restrictions
|
|||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`dump custom <dump>`, :doc:`compute reduce <compute_reduce>`, :doc:`fix ave/atom <fix_ave_atom>`, :doc:`fix ave/chunk <fix_ave_chunk>`,
|
||||
:doc:`fix property/atom <fix_property_atom>`
|
||||
:doc:`dump custom <dump>`, :doc:`compute reduce <compute_reduce>`,
|
||||
:doc::doc:`fix ave/atom <fix_ave_atom>`, :doc:`fix ave/chunk
|
||||
:doc:<fix_ave_chunk>`, `fix property/atom <fix_property_atom>`
|
||||
|
||||
**Default:** none
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue