Finished edits on computes (whew!); builds with no errors or warnings

This commit is contained in:
Karl Hammond
2022-08-19 00:25:06 -05:00
parent d03f0a6716
commit d32b303a82
26 changed files with 654 additions and 521 deletions

View File

@ -33,8 +33,8 @@ they are calculated from information about atoms on the current
timestep or iteration, though a compute may internally store some timestep or iteration, though a compute may internally store some
information about a previous state of the system. Defining a compute information about a previous state of the system. Defining a compute
does not perform a computation. Instead computes are invoked by other does not perform a computation. Instead computes are invoked by other
LAMMPS commands as needed, e.g. to calculate a temperature needed for LAMMPS commands as needed (e.g., to calculate a temperature needed for
a thermostat fix or to generate thermodynamic or dump file output. a thermostat fix or to generate thermodynamic or dump file output).
See the :doc:`Howto output <Howto_output>` page for a summary of See the :doc:`Howto output <Howto_output>` page for a summary of
various LAMMPS output options, many of which involve computes. various LAMMPS output options, many of which involve computes.
@ -45,15 +45,15 @@ underscores.
Computes calculate one of three styles of quantities: global, Computes calculate one of three styles of quantities: global,
per-atom, or local. A global quantity is one or more system-wide per-atom, or local. A global quantity is one or more system-wide
values, e.g. the temperature of the system. A per-atom quantity is values (e.g., the temperature of the system). A per-atom quantity is
one or more values per atom, e.g. the kinetic energy of each atom. one or more values per atom (e.g., the kinetic energy of each atom).
Per-atom values are set to 0.0 for atoms not in the specified compute Per-atom values are set to 0.0 for atoms not in the specified compute
group. Local quantities are calculated by each processor based on the group. Local quantities are calculated by each processor based on the
atoms it owns, but there may be zero or more per atom, e.g. a list of atoms it owns, but there may be zero or more per atom (e.g., a list of
bond distances. Computes that produce per-atom quantities have the bond distances). Computes that produce per-atom quantities have the
word "atom" in their style, e.g. *ke/atom*\ . Computes that produce word "atom" in their style (e.g., *ke/atom*\ ). Computes that produce
local quantities have the word "local" in their style, local quantities have the word "local" in their style
e.g. *bond/local*\ . Styles with neither "atom" or "local" in their (e.g., *bond/local*\ ). Styles with neither "atom" or "local" in their
style produce global quantities. style produce global quantities.
Note that a single compute can produce either global or per-atom or Note that a single compute can produce either global or per-atom or
@ -64,8 +64,8 @@ compute page will explain.
Global, per-atom, and local quantities each come in three kinds: a Global, per-atom, and local quantities each come in three kinds: a
single scalar value, a vector of values, or a 2d array of values. The single scalar value, a vector of values, or a 2d array of values. The
doc page for each compute describes the style and kind of values it doc page for each compute describes the style and kind of values it
produces, e.g. a per-atom vector. Some computes produce more than one produces (e.g., a per-atom vector). Some computes produce more than one
kind of a single style, e.g. a global scalar and a global vector. kind of a single style (e.g., a global scalar and a global vector).
When a compute quantity is accessed, as in many of the output commands When a compute quantity is accessed, as in many of the output commands
discussed below, it can be referenced via the following bracket discussed below, it can be referenced via the following bracket
@ -80,14 +80,14 @@ notation, where ID is the ID of the compute:
+-------------+--------------------------------------------+ +-------------+--------------------------------------------+
In other words, using one bracket reduces the dimension of the In other words, using one bracket reduces the dimension of the
quantity once (vector -> scalar, array -> vector). Using two brackets quantity once (vector :math:`\to` scalar, array :math:`\to` vector). Using two
reduces the dimension twice (array -> scalar). Thus a command that brackets reduces the dimension twice (array :math:`\to` scalar). Thus a
uses scalar compute values as input can also process elements of a command that uses scalar compute values as input can also process elements of a
vector or array. vector or array.
Note that commands and :doc:`variables <variable>` which use compute Note that commands and :doc:`variables <variable>` which use compute
quantities typically do not allow for all kinds, e.g. a command may quantities typically do not allow for all kinds (e.g., a command may
require a vector of values, not a scalar. This means there is no require a vector of values, not a scalar). This means there is no
ambiguity about referring to a compute quantity as c_ID even if it ambiguity about referring to a compute quantity as c_ID even if it
produces, for example, both a scalar and vector. The doc pages for produces, for example, both a scalar and vector. The doc pages for
various commands explain the details. various commands explain the details.
@ -111,14 +111,14 @@ ways:
The results of computes that calculate global quantities can be either The results of computes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is "intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation, independent of the number of atoms in the simulation
e.g. temperature. Extensive means the value scales with the number of (e.g., temperature). Extensive means the value scales with the number of
atoms in the simulation, e.g. total rotational kinetic energy. atoms in the simulation (e.g., total rotational kinetic energy).
:doc:`Thermodynamic output <thermo_style>` will normalize extensive :doc:`Thermodynamic output <thermo_style>` will normalize extensive
values by the number of atoms in the system, depending on the values by the number of atoms in the system, depending on the
"thermo_modify norm" setting. It will not normalize intensive values. "thermo_modify norm" setting. It will not normalize intensive values.
If a compute value is accessed in another way, e.g. by a If a compute value is accessed in another way (e.g., by a
:doc:`variable <variable>`, you may want to know whether it is an :doc:`variable <variable>`), you may want to know whether it is an
intensive or extensive value. See the page for individual intensive or extensive value. See the page for individual
computes for further info. computes for further info.
@ -187,8 +187,8 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
* :doc:`cluster/atom <compute_cluster_atom>` - cluster ID for each atom * :doc:`cluster/atom <compute_cluster_atom>` - cluster ID for each atom
* :doc:`cna/atom <compute_cna_atom>` - common neighbor analysis (CNA) for each atom * :doc:`cna/atom <compute_cna_atom>` - common neighbor analysis (CNA) for each atom
* :doc:`cnp/atom <compute_cnp_atom>` - common neighborhood parameter (CNP) for each atom * :doc:`cnp/atom <compute_cnp_atom>` - common neighborhood parameter (CNP) for each atom
* :doc:`com <compute_com>` - center-of-mass of group of atoms * :doc:`com <compute_com>` - center of mass of group of atoms
* :doc:`com/chunk <compute_com_chunk>` - center-of-mass for each chunk * :doc:`com/chunk <compute_com_chunk>` - center of mass for each chunk
* :doc:`contact/atom <compute_contact_atom>` - contact count for each spherical particle * :doc:`contact/atom <compute_contact_atom>` - contact count for each spherical particle
* :doc:`coord/atom <compute_coord_atom>` - coordination number for each atom * :doc:`coord/atom <compute_coord_atom>` - coordination number for each atom
* :doc:`damage/atom <compute_damage_atom>` - Peridynamic damage for each atom * :doc:`damage/atom <compute_damage_atom>` - Peridynamic damage for each atom
@ -232,7 +232,7 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
* :doc:`ke/atom/eff <compute_ke_atom_eff>` - per-atom translational and radial kinetic energy in the electron force field model * :doc:`ke/atom/eff <compute_ke_atom_eff>` - per-atom translational and radial kinetic energy in the electron force field model
* :doc:`ke/eff <compute_ke_eff>` - kinetic energy of a group of nuclei and electrons in the electron force field model * :doc:`ke/eff <compute_ke_eff>` - kinetic energy of a group of nuclei and electrons in the electron force field model
* :doc:`ke/rigid <compute_ke_rigid>` - translational kinetic energy of rigid bodies * :doc:`ke/rigid <compute_ke_rigid>` - translational kinetic energy of rigid bodies
* :doc:`mliap <compute_mliap>` - gradients of energy and forces w.r.t. model parameters and related quantities for training machine learning interatomic potentials * :doc:`mliap <compute_mliap>` - gradients of energy and forces with respect to model parameters and related quantities for training machine learning interatomic potentials
* :doc:`momentum <compute_momentum>` - translational momentum * :doc:`momentum <compute_momentum>` - translational momentum
* :doc:`msd <compute_msd>` - mean-squared displacement of group of atoms * :doc:`msd <compute_msd>` - mean-squared displacement of group of atoms
* :doc:`msd/chunk <compute_msd_chunk>` - mean-squared displacement for each chunk * :doc:`msd/chunk <compute_msd_chunk>` - mean-squared displacement for each chunk
@ -254,7 +254,7 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
* :doc:`property/chunk <compute_property_chunk>` - extract various per-chunk attributes * :doc:`property/chunk <compute_property_chunk>` - extract various per-chunk attributes
* :doc:`property/local <compute_property_local>` - convert local attributes to localvectors/arrays * :doc:`property/local <compute_property_local>` - convert local attributes to localvectors/arrays
* :doc:`ptm/atom <compute_ptm_atom>` - determines the local lattice structure based on the Polyhedral Template Matching method * :doc:`ptm/atom <compute_ptm_atom>` - determines the local lattice structure based on the Polyhedral Template Matching method
* :doc:`rdf <compute_rdf>` - radial distribution function g(r) histogram of group of atoms * :doc:`rdf <compute_rdf>` - radial distribution function :math:`g(r)` histogram of group of atoms
* :doc:`reduce <compute_reduce>` - combine per-atom quantities into a single global value * :doc:`reduce <compute_reduce>` - combine per-atom quantities into a single global value
* :doc:`reduce/chunk <compute_reduce_chunk>` - reduce per-atom quantities within each chunk * :doc:`reduce/chunk <compute_reduce_chunk>` - reduce per-atom quantities within each chunk
* :doc:`reduce/region <compute_reduce>` - same as compute reduce, within a region * :doc:`reduce/region <compute_reduce>` - same as compute reduce, within a region
@ -282,7 +282,7 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
* :doc:`smd/ulsph/strain/rate <compute_smd_ulsph_strain_rate>` - logarithmic strain rate for Smooth Mach Dynamics * :doc:`smd/ulsph/strain/rate <compute_smd_ulsph_strain_rate>` - logarithmic strain rate for Smooth Mach Dynamics
* :doc:`smd/ulsph/stress <compute_smd_ulsph_stress>` - per-particle Cauchy stress tensor and von Mises equivalent stress in Smooth Mach Dynamics * :doc:`smd/ulsph/stress <compute_smd_ulsph_stress>` - per-particle Cauchy stress tensor and von Mises equivalent stress in Smooth Mach Dynamics
* :doc:`smd/vol <compute_smd_vol>` - per-particle volumes and their sum in Smooth Mach Dynamics * :doc:`smd/vol <compute_smd_vol>` - per-particle volumes and their sum in Smooth Mach Dynamics
* :doc:`snap <compute_sna_atom>` - gradients of SNAP energy and forces w.r.t. linear coefficients and related quantities for fitting SNAP potentials * :doc:`snap <compute_sna_atom>` - gradients of SNAP energy and forces with respect to linear coefficients and related quantities for fitting SNAP potentials
* :doc:`sna/atom <compute_sna_atom>` - bispectrum components for each atom * :doc:`sna/atom <compute_sna_atom>` - bispectrum components for each atom
* :doc:`sna/grid <compute_sna_atom>` - global array of bispectrum components on a regular grid * :doc:`sna/grid <compute_sna_atom>` - global array of bispectrum components on a regular grid
* :doc:`sna/grid/local <compute_sna_atom>` - local array of bispectrum components on a regular grid * :doc:`sna/grid/local <compute_sna_atom>` - local array of bispectrum components on a regular grid
@ -308,7 +308,7 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
* :doc:`temp/cs <compute_temp_cs>` - temperature based on the center-of-mass velocity of atom pairs that are bonded to each other * :doc:`temp/cs <compute_temp_cs>` - temperature based on the center-of-mass velocity of atom pairs that are bonded to each other
* :doc:`temp/deform <compute_temp_deform>` - temperature excluding box deformation velocity * :doc:`temp/deform <compute_temp_deform>` - temperature excluding box deformation velocity
* :doc:`temp/deform/eff <compute_temp_deform_eff>` - temperature excluding box deformation velocity in the electron force field model * :doc:`temp/deform/eff <compute_temp_deform_eff>` - temperature excluding box deformation velocity in the electron force field model
* :doc:`temp/drude <compute_temp_drude>` - temperature of Core-Drude pairs * :doc:`temp/drude <compute_temp_drude>` - temperature of Core--Drude pairs
* :doc:`temp/eff <compute_temp_eff>` - temperature of a group of nuclei and electrons in the electron force field model * :doc:`temp/eff <compute_temp_eff>` - temperature of a group of nuclei and electrons in the electron force field model
* :doc:`temp/partial <compute_temp_partial>` - temperature excluding one or more dimensions of velocity * :doc:`temp/partial <compute_temp_partial>` - temperature excluding one or more dimensions of velocity
* :doc:`temp/profile <compute_temp_profile>` - temperature excluding a binned velocity profile * :doc:`temp/profile <compute_temp_profile>` - temperature excluding a binned velocity profile
@ -324,7 +324,7 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` pag
* :doc:`vcm/chunk <compute_vcm_chunk>` - velocity of center-of-mass for each chunk * :doc:`vcm/chunk <compute_vcm_chunk>` - velocity of center-of-mass for each chunk
* :doc:`viscosity/cos <compute_viscosity_cos>` - velocity profile under cosine-shaped acceleration * :doc:`viscosity/cos <compute_viscosity_cos>` - velocity profile under cosine-shaped acceleration
* :doc:`voronoi/atom <compute_voronoi_atom>` - Voronoi volume and neighbors for each atom * :doc:`voronoi/atom <compute_voronoi_atom>` - Voronoi volume and neighbors for each atom
* :doc:`xrd <compute_xrd>` - x-ray diffraction intensity on a mesh of reciprocal lattice nodes * :doc:`xrd <compute_xrd>` - X-ray diffraction intensity on a mesh of reciprocal lattice nodes
Restrictions Restrictions
"""""""""""" """"""""""""
@ -333,7 +333,9 @@ Restrictions
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`uncompute <uncompute>`, :doc:`compute_modify <compute_modify>`, :doc:`fix ave/atom <fix_ave_atom>`, :doc:`fix ave/time <fix_ave_time>`, :doc:`fix ave/histo <fix_ave_histo>` :doc:`uncompute <uncompute>`, :doc:`compute_modify <compute_modify>`,
:doc:`fix ave/atom <fix_ave_atom>`, :doc:`fix ave/time <fix_ave_time>`,
:doc:`fix ave/histo <fix_ave_histo>`
Default Default
""""""" """""""

View File

@ -602,7 +602,8 @@ be used. For non-orthogonal (triclinic) simulation boxes, only the
*reduced* option may be used. *reduced* option may be used.
A *box* value selects standard distance units as defined by the A *box* value selects standard distance units as defined by the
:doc:`units <units>` command (e.g., Angstroms for units = *real* or *metal*). :doc:`units <units>` command (e.g., :math:`\mathrm{\mathring A}`
for units = *real* or *metal*).
A *lattice* value means the distance units are in lattice spacings. A *lattice* value means the distance units are in lattice spacings.
The :doc:`lattice <lattice>` command must have been previously used to The :doc:`lattice <lattice>` command must have been previously used to
define the lattice spacing. A *reduced* value means normalized define the lattice spacing. A *reduced* value means normalized

View File

@ -95,11 +95,12 @@ something like the following commands:
refresh c_dsp delay 100 refresh c_dsp delay 100
The :doc:`dump_modify thresh <dump_modify>` command will only output The :doc:`dump_modify thresh <dump_modify>` command will only output
atoms that have displaced more than 0.6 Angstroms on each snapshot atoms that have displaced more than :math:`0.6~\mathrm{\mathring A}` on each
(assuming metal units). The dump_modify *refresh* option triggers a snapshot (assuming metal units). The dump_modify *refresh* option triggers a
call to this compute at the end of every dump. call to this compute at the end of every dump.
The *refresh* argument for this compute is the ID of an :doc:`atom-style variable <variable>` which calculates a Boolean value (0 or 1) The *refresh* argument for this compute is the ID of an
:doc:`atom-style variable <variable>` which calculates a Boolean value (0 or 1)
based on the same criterion used by dump_modify thresh. This compute based on the same criterion used by dump_modify thresh. This compute
evaluates the atom-style variable. For each atom that returns 1 (true), evaluates the atom-style variable. For each atom that returns 1 (true),
the original (reference) coordinates of the atom (stored by the original (reference) coordinates of the atom (stored by

View File

@ -98,7 +98,7 @@ by the corresponding volume. This option can be useful when dealing with
inhomogeneous systems such as those that have surfaces. inhomogeneous systems such as those that have surfaces.
Here are typical input parameters for fcc aluminum (lattice Here are typical input parameters for fcc aluminum (lattice
constant 4.05 Angstroms), constant :math:`4.05~\mathrm{\mathring A}}`),
.. parsed-literal:: .. parsed-literal::

View File

@ -108,7 +108,8 @@ The *mass* attribute is the total mass of the rigid body.
There are two options for outputting the coordinates of the center of There are two options for outputting the coordinates of the center of
mass (COM) of the body. The *x*, *y*, *z* attributes write the COM mass (COM) of the body. The *x*, *y*, *z* attributes write the COM
"unscaled", in the appropriate distance :doc:`units <units>` (Angstroms, "unscaled", in the appropriate distance :doc:`units <units>`
(:math:`\mathrm{\mathring A}}`,
sigma, etc). Use *xu*, *yu*, *zu* if you want the COM "unwrapped" by sigma, etc). Use *xu*, *yu*, *zu* if you want the COM "unwrapped" by
the image flags for each body. Unwrapped means that if the body the image flags for each body. Unwrapped means that if the body
COM has passed through a periodic boundary one or more times, the value COM has passed through a periodic boundary one or more times, the value

View File

@ -86,19 +86,20 @@ will defined using the *c* values for the spacing along each reciprocal
lattice axis. Note that manual mapping of the reciprocal space mesh is lattice axis. Note that manual mapping of the reciprocal space mesh is
good for comparing diffraction results from multiple simulations; however good for comparing diffraction results from multiple simulations; however
it can reduce the likelihood that Bragg reflections will be satisfied it can reduce the likelihood that Bragg reflections will be satisfied
unless small spacing parameters <0.05 Angstrom\^(-1) are implemented. unless small spacing parameters (:math:`<0.05~\mathrm{\mathring A}}^-1`)
Meshes with manual spacing do not require a periodic boundary. are implemented. Meshes with manual spacing do not require a periodic
boundary.
The limits of the reciprocal lattice mesh are determined by the use of The limits of the reciprocal lattice mesh are determined by the use of
the *Kmax*, *Zone*, and *dR_Ewald* parameters. The rectilinear mesh the *Kmax*, *Zone*, and *dR_Ewald* parameters. The rectilinear mesh
created about the origin of reciprocal space is terminated at the created about the origin of reciprocal space is terminated at the
boundary of a sphere of radius *Kmax* centered at the origin. If boundary of a sphere of radius *Kmax* centered at the origin. If
*Zone* parameters z1=z2=z3=0 are used, diffraction intensities are *Zone* parameters *z1* = *z2* = *z3* = 0 are used, diffraction intensities are
computed throughout the entire spherical volume - note this can computed throughout the entire spherical volume - note this can
greatly increase the cost of computation. Otherwise, *Zone* greatly increase the cost of computation. Otherwise, *Zone*
parameters will denote the z1=h, z2=k, and z3=l (in a global since) parameters will denote the :math:`z1=h`, :math:`z2=k`, and :math:`z3=\ell`
zone axis of an intersecting Ewald sphere. Diffraction intensities (in a global sense) zone axis of an intersecting Ewald sphere. Diffraction
will only be computed at the intersection of the reciprocal lattice intensities will only be computed at the intersection of the reciprocal lattice
mesh and a *dR_Ewald* thick surface of the Ewald sphere. See the mesh and a *dR_Ewald* thick surface of the Ewald sphere. See the
example 3D intensity data and the intersection of a [010] zone axis example 3D intensity data and the intersection of a [010] zone axis
in the below image. in the below image.

View File

@ -6,7 +6,7 @@ compute temp/cs command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/cs group1 group2 compute ID group-ID temp/cs group1 group2
@ -29,14 +29,15 @@ Description
Define a computation that calculates the temperature of a system based Define a computation that calculates the temperature of a system based
on the center-of-mass velocity of atom pairs that are bonded to each on the center-of-mass velocity of atom pairs that are bonded to each
other. This compute is designed to be used with the adiabatic other. This compute is designed to be used with the adiabatic
core/shell model of :ref:`(Mitchell and Finchham) <MitchellFinchham1>`. See core/shell model of :ref:`(Mitchell and Finchham) <MitchellFinchham1>`.
the :doc:`Howto coreshell <Howto_coreshell>` page for an overview of See the :doc:`Howto coreshell <Howto_coreshell>` page for an overview of
the model as implemented in LAMMPS. Specifically, this compute the model as implemented in LAMMPS. Specifically, this compute
enables correct temperature calculation and thermostatting of enables correct temperature calculation and thermostatting of
core/shell pairs where it is desirable for the internal degrees of core/shell pairs where it is desirable for the internal degrees of
freedom of the core/shell pairs to not be influenced by a thermostat. freedom of the core/shell pairs to not be influenced by a thermostat.
A compute of this style can be used by any command that computes a A compute of this style can be used by any command that computes a
temperature via :doc:`fix_modify <fix_modify>` e.g. :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`, etc. temperature via :doc:`fix_modify <fix_modify>`
(e.g., :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`).
Note that this compute does not require all ions to be polarized, Note that this compute does not require all ions to be polarized,
hence defined as core/shell pairs. One can mix core/shell pairs and hence defined as core/shell pairs. One can mix core/shell pairs and
@ -52,48 +53,56 @@ included in the treated system should not be included into either of
these groups, they are taken into account by the *group-ID* (second these groups, they are taken into account by the *group-ID* (second
argument) of the compute. argument) of the compute.
The temperature is calculated by the formula KE = dim/2 N k T, where The temperature is calculated by the formula
KE = total kinetic energy of the group of atoms (sum of 1/2 m v\^2),
dim = 2 or 3 = dimensionality of the simulation, N = number of atoms .. math::
in the group, k = Boltzmann constant, and T = temperature. Note that
\text{KE} = \frac{\text{dim}}{2} N k T,
where KE is the total kinetic energy of the group of atoms (sum of
:math:`\frac12 m v^2`), dim = 2 or 3 is the dimensionality of the simulation,
:math:`N` is the number of atoms in the group, :math:`k` is the Boltzmann
constant, and :math:`T` is the absolute temperature. Note that
the velocity of each core or shell atom used in the KE calculation is the velocity of each core or shell atom used in the KE calculation is
the velocity of the center-of-mass (COM) of the core/shell pair the the velocity of the center-of-mass (COM) of the core/shell pair the
atom is part of. atom is part of.
A kinetic energy tensor, stored as a 6-element vector, is also A kinetic energy tensor, stored as a six-element vector, is also calculated by
calculated by this compute for use in the computation of a pressure this compute for use in the computation of a pressure tensor. The formula for
tensor. The formula for the components of the tensor is the same as the components of the tensor is the same as the above formula, except that
the above formula, except that v\^2 is replaced by vx\*vy for the xy :math:`v^2` is replaced by :math:`v_x v_y` for the :math:`xy` component, and so
component, etc. The 6 components of the vector are ordered xx, yy, on. The six components of the vector are ordered :math:`xx`, :math:`yy`,
zz, xy, xz, yz. In contrast to the temperature, the velocity of :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`. In contrast to the temperature,
each core or shell atom is taken individually. the velocity of each core or shell atom is taken individually.
The change this fix makes to core/shell atom velocities is essentially The change this fix makes to core/shell atom velocities is essentially
computing the temperature after a "bias" has been removed from the computing the temperature after a "bias" has been removed from the velocity of
velocity of the atoms. This "bias" is the velocity of the atom the atoms. This "bias" is the velocity of the atom relative to the
relative to the COM velocity of the core/shell pair. If this compute center-of-mass velocity of the core/shell pair. If this compute is used with a
is used with a fix command that performs thermostatting then this bias fix command that performs thermostatting then this bias will be subtracted from
will be subtracted from each atom, thermostatting of the remaining COM each atom, thermostatting of the remaining center-of-mass velocity will be
velocity will be performed, and the bias will be added back in. This performed, and the bias will be added back in. This means the thermostatting
means the thermostatting will effectively be performed on the will effectively be performed on the core/shell pairs, instead of on the
core/shell pairs, instead of on the individual core and shell atoms. individual core and shell atoms. Thermostatting fixes that work in this way
Thermostatting fixes that work in this way include :doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix temp/berendsen <fix_temp_berendsen>`, and :doc:`fix langevin <fix_langevin>`. include :doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`,
:doc:`fix temp/berendsen <fix_temp_berendsen>`, and
:doc:`fix langevin <fix_langevin>`.
The internal energy of core/shell pairs can be calculated by the The internal energy of core/shell pairs can be calculated by the
:doc:`compute temp/chunk <compute_temp_chunk>` command, if chunks are :doc:`compute temp/chunk <compute_temp_chunk>` command, if chunks are defined
defined as core/shell pairs. See the :doc:`Howto coreshell <Howto_coreshell>` page doc page for more discussion as core/shell pairs. See the :doc:`Howto coreshell <Howto_coreshell>` doc
on how to do this. page for more discussion on how to do this.
Output info Output info
""""""""""" """""""""""
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6. vector of length 6 (KE tensor), which can be accessed by indices 1--6.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. vector values from a compute as input.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
vector values are "extensive". vector values are "extensive."
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`. The
vector values will be in energy :doc:`units <units>`. vector values will be in energy :doc:`units <units>`.
@ -108,7 +117,8 @@ be used which generate new molecules or atoms during a simulation.
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`compute temp <compute_temp>`, :doc:`compute temp/chunk <compute_temp_chunk>` :doc:`compute temp <compute_temp>`,
:doc:`compute temp/chunk <compute_temp_chunk>`
Default Default
""""""" """""""

View File

@ -9,7 +9,7 @@ Accelerator Variants: *temp/deform/kk*
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/deform compute ID group-ID temp/deform
@ -34,17 +34,17 @@ induced by use of the :doc:`fix deform <fix_deform>` command. A compute
of this style is created by the :doc:`fix nvt/sllod <fix_nvt_sllod>` of this style is created by the :doc:`fix nvt/sllod <fix_nvt_sllod>`
command to compute the thermal temperature of atoms for thermostatting command to compute the thermal temperature of atoms for thermostatting
purposes. A compute of this style can also be used by any command purposes. A compute of this style can also be used by any command
that computes a temperature, e.g. :doc:`thermo_modify <thermo_modify>`, that computes a temperature (e.g., :doc:`thermo_modify <thermo_modify>`,
:doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`, etc. :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`).
The deformation fix changes the box size and/or shape over time, so The deformation fix changes the box size and/or shape over time, so
each atom in the simulation box can be thought of as having a each atom in the simulation box can be thought of as having a
"streaming" velocity. For example, if the box is being sheared in x, "streaming" velocity. For example, if the box is being sheared in *x*,
relative to y, then atoms at the bottom of the box (low y) have a relative to *y*, then atoms at the bottom of the box (low *y*) have a
small x velocity, while atoms at the top of the box (hi y) have a small *x* velocity, while atoms at the top of the box (high *y*) have a
large x velocity. This position-dependent streaming velocity is large *x* velocity. This position-dependent streaming velocity is
subtracted from each atom's actual velocity to yield a thermal subtracted from each atom's actual velocity to yield a thermal
velocity which is used to compute the temperature. velocity, which is then used to compute the temperature.
.. note:: .. note::
@ -52,7 +52,8 @@ velocity which is used to compute the temperature.
atom coordinates or velocities to the changing simulation box. When atom coordinates or velocities to the changing simulation box. When
using this compute in conjunction with a deforming box, fix deform using this compute in conjunction with a deforming box, fix deform
should NOT remap atom positions, but rather should let atoms respond should NOT remap atom positions, but rather should let atoms respond
to the changing box by adjusting their own velocities (or let :doc:`fix deform <fix_deform>` remap the atom velocities, see it's remap to the changing box by adjusting their own velocities (or let
:doc:`fix deform <fix_deform>` remap the atom velocities; see its remap
option). If fix deform does remap atom positions, then they appear to option). If fix deform does remap atom positions, then they appear to
move with the box but their velocity is not changed, and thus they do move with the box but their velocity is not changed, and thus they do
NOT have the streaming velocity assumed by this compute. LAMMPS will NOT have the streaming velocity assumed by this compute. LAMMPS will
@ -60,18 +61,24 @@ velocity which is used to compute the temperature.
consistent with this compute. consistent with this compute.
After the streaming velocity has been subtracted from each atom, the After the streaming velocity has been subtracted from each atom, the
temperature is calculated by the formula KE = dim/2 N k T, where KE = temperature is calculated by the formula
total kinetic energy of the group of atoms (sum of 1/2 m v\^2), dim = 2
or 3 = dimensionality of the simulation, N = number of atoms in the
group, k = Boltzmann constant, and T = temperature. Note that v in
the kinetic energy formula is the atom's thermal velocity.
A kinetic energy tensor, stored as a 6-element vector, is also .. math::
\text{KE} = \frac{\text{dim}}{2} N k T,
where KE is the total kinetic energy of the group of atoms (sum of
:math:`\frac12 m v^2`, dim = 2 or 3 is the dimensionality of the simulation,
:math:`N` is the number of atoms in the group, :math:`k` is the Boltzmann
constant, and :math:`T` is the temperature. Note that :math:`v` in the kinetic energy formula is the atom's velocity.
A kinetic energy tensor, stored as a six-element vector, is also
calculated by this compute for use in the computation of a pressure calculated by this compute for use in the computation of a pressure
tensor. The formula for the components of the tensor is the same as tensor. The formula for the components of the tensor is the same as
the above formula, except that v\^2 is replaced by vx\*vy for the xy the above formula, except that :math:`v^2` is replaced by :math:`v_x v_y` for
component, etc. The 6 components of the vector are ordered xx, yy, the :math:`xy` component, and so on. The six components of the vector are
zz, xy, xz, yz. ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
:math:`yz`.
The number of atoms contributing to the temperature is assumed to be The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the *dynamic* option of the constant for the duration of the run; use the *dynamic* option of the
@ -83,7 +90,10 @@ from the velocity of the atoms. If this compute is used with a fix
command that performs thermostatting then this bias will be subtracted command that performs thermostatting then this bias will be subtracted
from each atom, thermostatting of the remaining thermal velocity will from each atom, thermostatting of the remaining thermal velocity will
be performed, and the bias will be added back in. Thermostatting be performed, and the bias will be added back in. Thermostatting
fixes that work in this way include :doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix temp/berendsen <fix_temp_berendsen>`, and :doc:`fix langevin <fix_langevin>`. fixes that work in this way include :doc:`fix nvt <fix_nh>`,
:doc:`fix temp/rescale <fix_temp_rescale>`,
:doc:`fix temp/berendsen <fix_temp_berendsen>`, and
:doc:`fix langevin <fix_langevin>`.
.. note:: .. note::
@ -91,14 +101,16 @@ fixes that work in this way include :doc:`fix nvt <fix_nh>`, :doc:`fix temp/resc
the atoms are indeed moving with a stream velocity profile that the atoms are indeed moving with a stream velocity profile that
matches the box deformation. If not, then the compute will subtract matches the box deformation. If not, then the compute will subtract
off an incorrect stream velocity, yielding a bogus thermal off an incorrect stream velocity, yielding a bogus thermal
temperature. You should NOT assume that your atoms are streaming at temperature. You should **not** assume that your atoms are streaming at
the same rate the box is deforming. Rather, you should monitor their the same rate the box is deforming. Rather, you should monitor their
velocity profile, e.g. via the :doc:`fix ave/chunk <fix_ave_chunk>` velocity profiles (e.g., via the :doc:`fix ave/chunk <fix_ave_chunk>`
command. And you can compare the results of this compute to :doc:`compute temp/profile <compute_temp_profile>`, which actually calculates the command). You can also compare the results of this compute to
stream profile before subtracting it. If the two computes do not give :doc:`compute temp/profile <compute_temp_profile>`, which actually
roughly the same temperature, then your atoms are not streaming calculates the stream profile before subtracting it. If the two computes do
consistent with the box deformation. See the :doc:`fix deform <fix_deform>` command for more details on ways to get atoms not give roughly the same temperature, then your atoms are not streaming
to stream consistently with the box deformation. consistent with the box deformation. See the :doc:`fix deform <fix_deform>`
command for more details on ways to get atoms to stream consistently with
the box deformation.
This compute subtracts out degrees-of-freedom due to fixes that This compute subtracts out degrees-of-freedom due to fixes that
constrain molecular motion, such as :doc:`fix shake <fix_shake>` and constrain molecular motion, such as :doc:`fix shake <fix_shake>` and
@ -115,16 +127,17 @@ Output info
""""""""""" """""""""""
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6. vector of length 6 (KE tensor), which can be accessed by indices 1--6.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output vector values from a compute as input. See the
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
options. options.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
vector values are "extensive". vector values are "extensive".
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`.
vector values will be in energy :doc:`units <units>`. The vector values will be in energy :doc:`units <units>`.
Restrictions Restrictions
"""""""""""" """"""""""""
@ -133,7 +146,9 @@ Restrictions
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`compute temp/ramp <compute_temp_ramp>`, :doc:`compute temp/profile <compute_temp_profile>`, :doc:`fix deform <fix_deform>`, :doc:`compute temp/ramp <compute_temp_ramp>`,
:doc:`compute temp/profile <compute_temp_profile>`,
:doc:`fix deform <fix_deform>`,
:doc:`fix nvt/sllod <fix_nvt_sllod>` :doc:`fix nvt/sllod <fix_nvt_sllod>`
Default Default

View File

@ -6,7 +6,7 @@ compute temp/deform/eff command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/deform/eff compute ID group-ID temp/deform/eff
@ -29,11 +29,11 @@ model, after subtracting out a streaming velocity induced by the
simulation box changing size and/or shape, for example in a simulation box changing size and/or shape, for example in a
non-equilibrium MD (NEMD) simulation. The size/shape change is non-equilibrium MD (NEMD) simulation. The size/shape change is
induced by use of the :doc:`fix deform <fix_deform>` command. A induced by use of the :doc:`fix deform <fix_deform>` command. A
compute of this style is created by the :doc:`fix nvt/sllod/eff <fix_nvt_sllod_eff>` command to compute the thermal compute of this style is created by the
:doc:`fix nvt/sllod/eff <fix_nvt_sllod_eff>` command to compute the thermal
temperature of atoms for thermostatting purposes. A compute of this temperature of atoms for thermostatting purposes. A compute of this
style can also be used by any command that computes a temperature, style can also be used by any command that computes a temperature
e.g. :doc:`thermo_modify <thermo_modify>`, :doc:`fix npt/eff <fix_nh_eff>`, (e.g., :doc:`thermo_modify <thermo_modify>`, :doc:`fix npt/eff <fix_nh_eff>`).
etc.
The calculation performed by this compute is exactly like that The calculation performed by this compute is exactly like that
described by the :doc:`compute temp/deform <compute_temp_deform>` described by the :doc:`compute temp/deform <compute_temp_deform>`
@ -47,13 +47,14 @@ Output info
""""""""""" """""""""""
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6. vector of length 6 (KE tensor), which can be accessed by indices 1--6.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output vector values from a compute as input. See the
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
options. options.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
vector values are "extensive". vector values are "extensive."
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`. The
vector values will be in energy :doc:`units <units>`. vector values will be in energy :doc:`units <units>`.
@ -62,7 +63,8 @@ Restrictions
"""""""""""" """"""""""""
This compute is part of the EFF package. It is only enabled if This compute is part of the EFF package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info. LAMMPS was built with that package. See the
:doc:`Build package <Build_package>` page for more info.
Related commands Related commands
"""""""""""""""" """"""""""""""""

View File

@ -6,7 +6,7 @@ compute temp/drude command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/drude compute ID group-ID temp/drude
@ -20,26 +20,28 @@ Examples
compute TDRUDE all temp/drude compute TDRUDE all temp/drude
Example input scripts available: examples/PACKAGES/drude Example input scripts available: :file:`examples/PACKAGES/drude`.
Description Description
""""""""""" """""""""""
Define a computation that calculates the temperatures of core-Drude Define a computation that calculates the temperatures of core--Drude
pairs. This compute is designed to be used with the :doc:`thermalized Drude oscillator model <Howto_drude>`. Polarizable models in LAMMPS pairs. This compute is designed to be used with the
are described on the :doc:`Howto polarizable <Howto_polarizable>` doc :doc:`thermalized Drude oscillator model <Howto_drude>`.
page. Polarizable models in LAMMPS
are described on the :doc:`Howto polarizable <Howto_polarizable>` doc page.
Drude oscillators consist of a core particle and a Drude particle Drude oscillators consist of a core particle and a Drude particle
connected by a harmonic bond, and the relative motion of these Drude connected by a harmonic bond, and the relative motion of these Drude
oscillators is usually maintained cold by a specific thermostat that oscillators is usually maintained cold by a specific thermostat that
acts on the relative motion of the core-Drude particle acts on the relative motion of the core--Drude particle
pairs. Therefore, because LAMMPS considers Drude particles as normal pairs. Therefore, because LAMMPS considers Drude particles as normal
atoms in its default temperature compute (:doc:`compute temp <compute_temp>` command), the reduced temperature of the atoms in its default temperature compute (:doc:`compute temp <compute_temp>`
core-Drude particle pairs is not calculated correctly. command), the reduced temperature of the core--Drude particle pairs is not
calculated correctly.
By contrast, this compute calculates the temperature of the cores By contrast, this compute calculates the temperature of the cores
using center-of-mass velocities of the core-Drude pairs, and the using center-of-mass velocities of the core--Drude pairs, and the
reduced temperature of the Drude particles using the relative reduced temperature of the Drude particles using the relative
velocities of the Drude particles with respect to their cores. velocities of the Drude particles with respect to their cores.
Non-polarizable atoms are considered as cores. Their velocities Non-polarizable atoms are considered as cores. Their velocities
@ -49,7 +51,7 @@ Output info
""""""""""" """""""""""
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 6, which can be accessed by indices 1-6, whose components vector of length 6, which can be accessed by indices 1--6, whose components
are are
1. temperature of the centers of mass (temperature units) 1. temperature of the centers of mass (temperature units)
@ -60,12 +62,13 @@ are
6. kinetic energy of the dipoles (energy units) 6. kinetic energy of the dipoles (energy units)
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output vector values from a compute as input. See the
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
options. options.
Both the scalar value and the first two values of the vector Both the scalar value and the first two values of the vector
calculated by this compute are "intensive". The other 4 vector values calculated by this compute are "intensive." The other four vector values
are "extensive". are "extensive."
Restrictions Restrictions
"""""""""""" """"""""""""
@ -77,7 +80,9 @@ assumed to be constant for the duration of the run unless the
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`fix drude <fix_drude>`, :doc:`fix langevin/drude <fix_langevin_drude>`, :doc:`fix drude/transform <fix_drude_transform>`, :doc:`pair_style thole <pair_thole>`, :doc:`compute temp <compute_temp>` :doc:`fix drude <fix_drude>`, :doc:`fix langevin/drude <fix_langevin_drude>`,
:doc:`fix drude/transform <fix_drude_transform>`,
:doc:`pair_style thole <pair_thole>`, :doc:`compute temp <compute_temp>`
Default Default
""""""" """""""

View File

@ -6,7 +6,7 @@ compute temp/eff command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/eff compute ID group-ID temp/eff
@ -27,20 +27,27 @@ Description
Define a computation that calculates the temperature of a group of Define a computation that calculates the temperature of a group of
nuclei and electrons in the :doc:`electron force field <pair_eff>` nuclei and electrons in the :doc:`electron force field <pair_eff>`
model. A compute of this style can be used by commands that compute a model. A compute of this style can be used by commands that compute a
temperature, e.g. :doc:`thermo_modify <thermo_modify>`, :doc:`fix npt/eff <fix_nh_eff>`, etc. temperature (e.g., :doc:`thermo_modify <thermo_modify>`,
:doc:`fix npt/eff <fix_nh_eff>`).
The temperature is calculated by the formula KE = dim/2 N k T, where The temperature is calculated by the formula
KE = total kinetic energy of the group of atoms (sum of 1/2 m v\^2 for
nuclei and sum of 1/2 (m v\^2 + 3/4 m s\^2) for electrons, where s .. math::
includes the radial electron velocity contributions), dim = 2 or 3 =
dimensionality of the simulation, N = number of atoms (only total \text{KE} = \frac{\text{dim}}{2} N k T,
where KE is the total kinetic energy of the group of atoms (sum of
:math:`\frac12 m v^2` for nuclei and sum of
:math:`\frac12 (m v^2 + \frac34 m s^2`) for electrons, where :math:`s`
includes the radial electron velocity contributions), dim = 2 or 3 is the
dimensionality of the simulation, :math:`N` is the number of atoms (only total
number of nuclei in the eFF (see the :doc:`pair_eff <pair_style>` number of nuclei in the eFF (see the :doc:`pair_eff <pair_style>`
command) in the group, k = Boltzmann constant, and T = temperature. command) in the group, :math:`k` is the Boltzmann constant, and :math:`T` is
This expression is summed over all nuclear and electronic degrees of the absolute temperature. This expression is summed over all nuclear and
freedom, essentially by setting the kinetic contribution to the heat electronic degrees of freedom, essentially by setting the kinetic contribution
capacity to 3/2k (where only nuclei contribute). This subtlety is to the heat capacity to :math:`\frac32 k` (where only nuclei contribute). This
valid for temperatures well below the Fermi temperature, which for subtlety is valid for temperatures well below the Fermi temperature, which for
densities two to five times the density of liquid H2 ranges from densities two to five times the density of liquid hydrogen ranges from
86,000 to 170,000 K. 86,000 to 170,000 K.
.. note:: .. note::
@ -57,11 +64,11 @@ densities two to five times the density of liquid H2 ranges from
thermo_style custom step etotal pe ke temp press thermo_style custom step etotal pe ke temp press
thermo_modify temp effTemp thermo_modify temp effTemp
A 6-component kinetic energy tensor is also calculated by this compute A six-component kinetic energy tensor is also calculated by this compute
for use in the computation of a pressure tensor. The formula for the for use in the computation of a pressure tensor. The formula for the
components of the tensor is the same as the above formula, except that components of the tensor is the same as the above formula, except that
v\^2 is replaced by vx \* vy for the xy component, etc. For the eFF, :math:`v^2` is replaced by :math:`v_x v_y` for the :math:`xy` component, etc.
again, the radial electronic velocities are also considered. For the eFF, again, the radial electronic velocities are also considered.
The number of atoms contributing to the temperature is assumed to be The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the *dynamic* option of the constant for the duration of the run; use the *dynamic* option of the
@ -81,9 +88,9 @@ thermostatting.
Output info Output info
""""""""""" """""""""""
The scalar value calculated by this compute is "intensive", meaning it The scalar value calculated by this compute is "intensive," meaning it
is independent of the number of atoms in the simulation. The vector is independent of the number of atoms in the simulation. The vector
values are "extensive", meaning they scale with the number of atoms in values are "extensive," meaning they scale with the number of atoms in
the simulation. the simulation.
Restrictions Restrictions
@ -95,7 +102,9 @@ LAMMPS was built with that package. See the :doc:`Build package <Build_package>
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`compute temp/partial <compute_temp_partial>`, :doc:`compute temp/region <compute_temp_region>`, :doc:`compute pressure <compute_pressure>` :doc:`compute temp/partial <compute_temp_partial>`,
:doc:`compute temp/region <compute_temp_region>`,
:doc:`compute pressure <compute_pressure>`
Default Default
""""""" """""""

View File

@ -6,7 +6,7 @@ compute temp/partial command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/partial xflag yflag zflag compute ID group-ID temp/partial xflag yflag zflag
@ -26,23 +26,31 @@ Description
Define a computation that calculates the temperature of a group of Define a computation that calculates the temperature of a group of
atoms, after excluding one or more velocity components. A compute of atoms, after excluding one or more velocity components. A compute of
this style can be used by any command that computes a temperature, this style can be used by any command that computes a temperature
e.g. :doc:`thermo_modify <thermo_modify>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`, etc. (e.g. :doc:`thermo_modify <thermo_modify>`,
:doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`).
The temperature is calculated by the formula KE = dim/2 N k T, where The temperature is calculated by the formula
KE = total kinetic energy of the group of atoms (sum of 1/2 m v\^2),
dim = dimensionality of the simulation, N = number of atoms in the .. math::
group, k = Boltzmann constant, and T = temperature. The calculation
of KE excludes the x, y, or z dimensions if xflag, yflag, or zflag = \text{KE} = \frac{\text{dim}{2} N k T,
0. The dim parameter is adjusted to give the correct number of
where KE is the total kinetic energy of the group of atoms (sum of
:math:`\frac12 m v^2`), dim = 2 or 3 is the dimensionality of the simulation,
:math:`N` is the number of atoms in the group, :math:`k` is the Boltzmann
constant, and :math:`T` = temperature. The calculation of KE excludes the
:math:`x`, :math:`y`, or :math:`z` dimensions if *xflag*, *yflag*, or *zflag*
is 0. The dim parameter is adjusted to give the correct number of
degrees of freedom. degrees of freedom.
A kinetic energy tensor, stored as a 6-element vector, is also A kinetic energy tensor, stored as a six-element vector, is also
calculated by this compute for use in the calculation of a pressure calculated by this compute for use in the calculation of a pressure
tensor. The formula for the components of the tensor is the same as tensor. The formula for the components of the tensor is the same as
the above formula, except that v\^2 is replaced by vx\*vy for the xy the above formula, except that :math:`v^2` is replaced by :math:`v_x v_y` for
component, etc. The 6 components of the vector are ordered xx, yy, the :math:`xy` component, and so on. The six components of the vector are
zz, xy, xz, yz. ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
:math:`yz`.
The number of atoms contributing to the temperature is assumed to be The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the *dynamic* option of the constant for the duration of the run; use the *dynamic* option of the
@ -54,7 +62,10 @@ velocity of the atoms. If this compute is used with a fix command
that performs thermostatting then this bias will be subtracted from that performs thermostatting then this bias will be subtracted from
each atom, thermostatting of the remaining thermal velocity will be each atom, thermostatting of the remaining thermal velocity will be
performed, and the bias will be added back in. Thermostatting fixes performed, and the bias will be added back in. Thermostatting fixes
that work in this way include :doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix temp/berendsen <fix_temp_berendsen>`, and :doc:`fix langevin <fix_langevin>`. that work in this way include :doc:`fix nvt <fix_nh>`,
:doc:`fix temp/rescale <fix_temp_rescale>`,
:doc:`fix temp/berendsen <fix_temp_berendsen>`, and
:doc:`fix langevin <fix_langevin>`.
This compute subtracts out degrees-of-freedom due to fixes that This compute subtracts out degrees-of-freedom due to fixes that
constrain molecular motion, such as :doc:`fix shake <fix_shake>` and constrain molecular motion, such as :doc:`fix shake <fix_shake>` and
@ -77,13 +88,14 @@ Output info
""""""""""" """""""""""
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6. vector of length 6 (KE tensor), which can be accessed by indices 1--6.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output vector values from a compute as input.
options. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS
output options.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
vector values are "extensive". vector values are "extensive."
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`. The
vector values will be in energy :doc:`units <units>`. vector values will be in energy :doc:`units <units>`.

View File

@ -6,7 +6,7 @@ compute temp/profile command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/profile xflag yflag zflag binstyle args compute ID group-ID temp/profile xflag yflag zflag binstyle args
@ -24,7 +24,7 @@ Syntax
*yz* args = Ny Nz *yz* args = Ny Nz
*xz* args = Nx Nz *xz* args = Nx Nz
*xyz* args = Nx Ny Nz *xyz* args = Nx Ny Nz
Nx,Ny,Nz = number of velocity bins in x,y,z dimensions Nx, Ny, Nz = number of velocity bins in *x*, *y*, *z* dimensions
* zero or more keyword/value pairs may be appended * zero or more keyword/value pairs may be appended
* keyword = *out* * keyword = *out*
@ -49,24 +49,24 @@ Define a computation that calculates the temperature of a group of
atoms, after subtracting out a spatially-averaged center-of-mass atoms, after subtracting out a spatially-averaged center-of-mass
velocity field, before computing the kinetic energy. This can be velocity field, before computing the kinetic energy. This can be
useful for thermostatting a collection of atoms undergoing a complex useful for thermostatting a collection of atoms undergoing a complex
flow, e.g. via a profile-unbiased thermostat (PUT) as described in flow (e.g. via a profile-unbiased thermostat (PUT) as described in
:ref:`(Evans) <Evans1>`. A compute of this style can be used by any command :ref:`(Evans) <Evans1>`). A compute of this style can be used by any command
that computes a temperature, e.g. :doc:`thermo_modify <thermo_modify>`, that computes a temperature (e.g. :doc:`thermo_modify <thermo_modify>`,
:doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`, etc. :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`).
The *xflag*, *yflag*, *zflag* settings determine which components of The *xflag*, *yflag*, *zflag* settings determine which components of
average velocity are subtracted out. average velocity are subtracted out.
The *binstyle* setting and its *Nx*, *Ny*, *Nz* arguments determine The *binstyle* setting and its *Nx*, *Ny*, *Nz* arguments determine how bins
how bins are setup to perform spatial averaging. "Bins" can be 1d are setup to perform spatial averaging. "Bins" can be 1d slabs, 2d pencils,
slabs, 2d pencils, or 3d bricks depending on which *binstyle* is used. or 3d bricks depending on which *binstyle* is used. The simulation box is
The simulation box is partitioned conceptually into *Nx* by *Ny* by partitioned conceptually into *Nx* :math:`\times` *Ny* :math:`\times` *Nz*
*Nz* bins. Depending on the *binstyle*, you may only specify one or bins. Depending on the *binstyle*, you may only specify one or two of these
two of these values; the others are effectively set to 1 (no binning values; the others are effectively set to 1 (no binning in that dimension).
in that dimension). For non-orthogonal (triclinic) simulation boxes, For non-orthogonal (triclinic) simulation boxes, the bins are "tilted" slabs or
the bins are "tilted" slabs or pencils or bricks that are parallel to pencils or bricks that are parallel to the tilted faces of the box. See the
the tilted faces of the box. See the :doc:`region prism <region>` :doc:`region prism <region>` command for a discussion of the geometry of tilted
command for a discussion of the geometry of tilted boxes in LAMMPS. boxes in LAMMPS.
When a temperature is computed, the center-of-mass velocity for the When a temperature is computed, the center-of-mass velocity for the
set of atoms that are both in the compute group and in the same set of atoms that are both in the compute group and in the same
@ -77,36 +77,41 @@ bin, its thermal velocity will thus be 0.0.
After the spatially-averaged velocity field has been subtracted from After the spatially-averaged velocity field has been subtracted from
each atom, the temperature is calculated by the formula each atom, the temperature is calculated by the formula
*KE* = (*dim\*N* - *Ns\*Nx\*Ny\*Nz* - *extra* ) *k* *T*/2, where *KE* = total
kinetic energy of the group of atoms (sum of 1/2 *m* *v*\^2), *dim* = 2 .. math::
or 3 = dimensionality of the simulation, *Ns* = 0, 1, 2 or 3 for
streaming velocity subtracted in 0, 1, 2 or 3 dimensions, *extra* = extra \text{KE} = \left( \frac{\text{dim}}{N} - N_s N_x N_y N_z
degrees-of-freedom, *N* = number of atoms in the group, *k* = Boltzmann - \text{extra} \right) \frac{k T}{2},
constant, and *T* = temperature. The *Ns\*Nx\*Ny\*Nz* term is degrees
of freedom subtracted to adjust for the removal of the center-of-mass where KE is the total kinetic energy of the group of atoms (sum of
velocity in each direction of the *Nx\*Ny\*Nz* bins, as discussed in the :math:`\frac12 m v^2`; dim = 2 or 3 is the dimensionality of the simulation;
:ref:`(Evans) <Evans1>` paper. The extra term defaults to (*dim* - *Ns*) :math:`N_s =` 0, 1, 2, or 3 for streaming velocity subtracted in 0, 1, 2, or 3
and accounts for overall conservation of center-of-mass velocity across dimensions, respectively; *extra* is the number of extra degrees of freedom;
the group in directions where streaming velocity is *not* subtracted. This *N* is the number of atoms in the group; *k* is the Boltzmann constant, and
can be altered using the *extra* option of the *T* is the absolute temperature. The :math:`N_s N_x N_y N_z` term is the
number of degrees of freedom subtracted to adjust for the removal of the
center-of-mass velocity in each direction of the *Nx\*Ny\*Nz* bins, as
discussed in the :ref:`(Evans) <Evans1>` paper. The extra term defaults to
:math:`\text{dim} - N_s` and accounts for overall conservation of
center-of-mass velocity across the group in directions where streaming velocity
is *not* subtracted. This can be altered using the *extra* option of the
:doc:`compute_modify <compute_modify>` command. :doc:`compute_modify <compute_modify>` command.
If the *out* keyword is used with a *tensor* value, which is the If the *out* keyword is used with a *tensor* value, which is the default,
default, a kinetic energy tensor, stored as a 6-element vector, is a kinetic energy tensor, stored as a six-element vector, is also calculated by
also calculated by this compute for use in the computation of a this compute for use in the computation of a pressure tensor. The formula for
pressure tensor. The formula for the components of the tensor is the the components of the tensor is the same as the above formula, except that
same as the above formula, except that *v*\^2 is replaced by *vx\*vy* for :math:`v^2` is replaced by :math:`v_x v_y` for the :math:`xy` component, and
the xy component, etc. The 6 components of the vector are ordered *xx, so on. The six components of the vector are ordered :math:`xx`, :math:`yy`,
yy, zz, xy, xz, yz.* :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
If the *out* keyword is used with a *bin* value, the count of atoms If the *out* keyword is used with a *bin* value, the count of atoms and
and computed temperature for each bin are stored for output, as an computed temperature for each bin are stored for output, as an array of values,
array of values, as described below. The temperature of each bin is as described below. The temperature of each bin is calculated as described
calculated as described above, where the bias velocity is subtracted above, where the bias velocity is subtracted and only the remaining thermal
and only the remaining thermal velocity of atoms in the bin velocity of atoms in the bin contributes to the temperature. See the note
contributes to the temperature. See the note below for how the below for how the temperature is normalized by the degrees-of-freedom of atoms
temperature is normalized by the degrees-of-freedom of atoms in the in the bin.
bin.
The number of atoms contributing to the temperature is assumed to be The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the *dynamic* option of the constant for the duration of the run; use the *dynamic* option of the
@ -118,14 +123,17 @@ from the velocity of the atoms. If this compute is used with a fix
command that performs thermostatting then this bias will be subtracted command that performs thermostatting then this bias will be subtracted
from each atom, thermostatting of the remaining thermal velocity will from each atom, thermostatting of the remaining thermal velocity will
be performed, and the bias will be added back in. Thermostatting be performed, and the bias will be added back in. Thermostatting
fixes that work in this way include :doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix temp/berendsen <fix_temp_berendsen>`, and :doc:`fix langevin <fix_langevin>`. fixes that work in this way include :doc:`fix nvt <fix_nh>`,
:doc:`fix temp/rescale <fix_temp_rescale>`,
:doc:`fix temp/berendsen <fix_temp_berendsen>`,
and :doc:`fix langevin <fix_langevin>`.
This compute subtracts out degrees-of-freedom due to fixes that This compute subtracts out degrees-of-freedom due to fixes that constrain
constrain molecular motion, such as :doc:`fix shake <fix_shake>` and molecular motion, such as :doc:`fix shake <fix_shake>` and
:doc:`fix rigid <fix_rigid>`. This means the temperature of groups of :doc:`fix rigid <fix_rigid>`. This means the temperature of groups of atoms
atoms that include these constraints will be computed correctly. If that include these constraints will be computed correctly. If needed, the
needed, the subtracted degrees-of-freedom can be altered using the subtracted degrees-of-freedom can be altered using the *extra* option of the
*extra* option of the :doc:`compute_modify <compute_modify>` command. :doc:`compute_modify <compute_modify>` command.
.. note:: .. note::
@ -137,11 +145,12 @@ needed, the subtracted degrees-of-freedom can be altered using the
by fractionally applying them based on the fraction of atoms in each by fractionally applying them based on the fraction of atoms in each
bin. As a result, the bin degrees-of-freedom summed over all bins exactly bin. As a result, the bin degrees-of-freedom summed over all bins exactly
equals the degrees-of-freedom used in the scalar temperature calculation, equals the degrees-of-freedom used in the scalar temperature calculation,
:math:`\Sigma N_{DOF_i} = N_{DOF}` and the corresponding relation for temperature :math:`\Sigma N_{\text{DOF}_i} = N_\text{DOF}` and the corresponding
is also satisfied :math:`\Sigma N_{DOF_i} T_i = N_{DOF} T`. relation for temperature is also satisfied
These relations will breakdown in cases where the adjustment (:math:`\Sigma N_{\text{DOF}_i} T_i = N_\text{DOF} T`).
exceeds the actual number of degrees-of-freedom in a bin. This could happen These relations will break down in cases for which the adjustment
if a bin is empty or in situations where rigid molecules exceeds the actual number of degrees of freedom in a bin. This could happen
if a bin is empty or in situations in which rigid molecules
are non-uniformly distributed, in which case the reported are non-uniformly distributed, in which case the reported
temperature within a bin may not be accurate. temperature within a bin may not be accurate.
@ -157,23 +166,25 @@ Output info
This compute calculates a global scalar (the temperature). Depending This compute calculates a global scalar (the temperature). Depending
on the setting of the *out* keyword, it also calculates a global on the setting of the *out* keyword, it also calculates a global
vector or array. For *out* = *tensor*, it calculates a vector of vector or array. For *out* = *tensor*, it calculates a vector of
length 6 (KE tensor), which can be accessed by indices 1-6. For *out* length 6 (KE tensor), which can be accessed by indices 1--6. For *out*
= *bin* it calculates a global array which has 2 columns and N rows, = *bin* it calculates a global array which has 2 columns and :math:`N` rows,
where N is the number of bins. The first column contains the number where :math:`N` is the number of bins. The first column contains the number
of atoms in that bin. The second contains the temperature of that of atoms in that bin. The second contains the temperature of that
bin, calculated as described above. The ordering of rows in the array bin, calculated as described above. The ordering of rows in the array
is as follows. Bins in x vary fastest, then y, then z. Thus for a is as follows. Bins in :math:`x` vary fastest, then :math:`y`, then
10x10x10 3d array of bins, there will be 1000 rows. The bin with :math:`z`. Thus for a :math:`10\times 10\times 10` 3d array of bins, there
indices ix,iy,iz = 2,3,4 would map to row M = (iz-1)\*10\*10 + (iy-1)\*10 will be 1000 rows. The bin with indices :math:`(i_x,i_y,i_z) = (2,3,4)` would
+ ix = 322, where the rows are numbered from 1 to 1000 and the bin map to row :math:`M = 10^2(i_z-1) + 10(i_y-1) + i_x = 322`, where the rows are
indices are numbered from 1 to 10 in each dimension. numbered from 1 to 1000 and the bin indices are numbered from 1 to 10 in each
dimension.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector or array values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output vector or array values from a compute as input. See the
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
options. options.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
vector values are "extensive". The array values are "intensive". vector values are "extensive." The array values are "intensive."
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`. The
vector values will be in energy :doc:`units <units>`. The first column vector values will be in energy :doc:`units <units>`. The first column

View File

@ -6,7 +6,7 @@ compute temp/ramp command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/ramp vdim vlo vhi dim clo chi keyword value ... compute ID group-ID temp/ramp vdim vlo vhi dim clo chi keyword value ...
@ -33,11 +33,11 @@ Examples
Description Description
""""""""""" """""""""""
Define a computation that calculates the temperature of a group of Define a computation that calculates the temperature of a group of atoms,
atoms, after subtracting out an ramped velocity profile before after subtracting out an ramped velocity profile before computing the kinetic
computing the kinetic energy. A compute of this style can be used by energy. A compute of this style can be used by any command that computes a
any command that computes a temperature, temperature (e.g. :doc:`thermo_modify <thermo_modify>`,
e.g. :doc:`thermo_modify <thermo_modify>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`, etc. :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`).
The meaning of the arguments for this command which define the The meaning of the arguments for this command which define the
velocity ramp are the same as for the :doc:`velocity ramp <velocity>` velocity ramp are the same as for the :doc:`velocity ramp <velocity>`
@ -45,28 +45,33 @@ command which was presumably used to impose the velocity.
After the ramp velocity has been subtracted from the specified After the ramp velocity has been subtracted from the specified
dimension for each atom, the temperature is calculated by the formula dimension for each atom, the temperature is calculated by the formula
KE = dim/2 N k T, where KE = total kinetic energy of the group of
atoms (sum of 1/2 m v\^2), dim = 2 or 3 = dimensionality of the .. math::
simulation, N = number of atoms in the group, k = Boltzmann constant,
and T = temperature. \text{KE} = \frac{\text{dim}}{2} N k T,
where KE is the total kinetic energy of the group of atoms (sum of
:math:`\frac12 m v^2`), dim = 2 or 3 is the dimensionality of the simulation,
:math:`N` is the number of atoms in the group, :math:`k` is the Boltzmann
constant, and :math:`T` is the absolute temperature.
The *units* keyword determines the meaning of the distance units used The *units* keyword determines the meaning of the distance units used
for coordinates (c1,c2) and velocities (vlo,vhi). A *box* value for coordinates (*clo*, *chi*) and velocities (*vlo*, *vhi*). A *box* value
selects standard distance units as defined by the :doc:`units <units>` selects standard distance units as defined by the :doc:`units <units>`
command, e.g. Angstroms for units = real or metal. A *lattice* value command (e.g., :math:`\mathrm{\mathring A}` for units = real or metal). A
means the distance units are in lattice spacings; e.g. velocity = *lattice* value means the distance units are in lattice spacings (i.e.,
lattice spacings / tau. The :doc:`lattice <lattice>` command must have velocity in lattice spacings per unit time). The :doc:`lattice <lattice>`
been previously used to define the lattice spacing. command must have been previously used to define the lattice spacing.
A kinetic energy tensor, stored as a 6-element vector, is also A kinetic energy tensor, stored as a six-element vector, is also calculated by
calculated by this compute for use in the computation of a pressure this compute for use in the computation of a pressure tensor. The formula for
tensor. The formula for the components of the tensor is the same as the components of the tensor is the same as the above formula, except that
the above formula, except that v\^2 is replaced by vx\*vy for the xy :math:`v^2` is replaced by :math:`v_x v_y` for the :math:`xy` component, and
component, etc. The 6 components of the vector are ordered xx, yy, so on. The six components of the vector are ordered :math:`xx`, :math:`yy`,
zz, xy, xz, yz. :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
The number of atoms contributing to the temperature is assumed to be The number of atoms contributing to the temperature is assumed to be constant
constant for the duration of the run; use the *dynamic* option of the for the duration of the run; use the *dynamic* option of the
:doc:`compute_modify <compute_modify>` command if this is not the case. :doc:`compute_modify <compute_modify>` command if this is not the case.
The removal of the ramped velocity component by this fix is The removal of the ramped velocity component by this fix is
@ -75,7 +80,10 @@ from the velocity of the atoms. If this compute is used with a fix
command that performs thermostatting then this bias will be subtracted command that performs thermostatting then this bias will be subtracted
from each atom, thermostatting of the remaining thermal velocity will from each atom, thermostatting of the remaining thermal velocity will
be performed, and the bias will be added back in. Thermostatting be performed, and the bias will be added back in. Thermostatting
fixes that work in this way include :doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix temp/berendsen <fix_temp_berendsen>`, and :doc:`fix langevin <fix_langevin>`. fixes that work in this way include :doc:`fix nvt <fix_nh>`,
:doc:`fix temp/rescale <fix_temp_rescale>`,
:doc:`fix temp/berendsen <fix_temp_berendsen>`, and
:doc:`fix langevin <fix_langevin>`.
This compute subtracts out degrees-of-freedom due to fixes that This compute subtracts out degrees-of-freedom due to fixes that
constrain molecular motion, such as :doc:`fix shake <fix_shake>` and constrain molecular motion, such as :doc:`fix shake <fix_shake>` and
@ -92,13 +100,14 @@ Output info
""""""""""" """""""""""
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6. vector of length 6 (KE tensor), which can be accessed by indices 1--6.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output vector values from a compute as input. See the
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
options. options.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
vector values are "extensive". vector values are "extensive."
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`. The
vector values will be in energy :doc:`units <units>`. vector values will be in energy :doc:`units <units>`.

View File

@ -6,7 +6,7 @@ compute temp/region command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/region region-ID compute ID group-ID temp/region region-ID
@ -24,30 +24,37 @@ Examples
Description Description
""""""""""" """""""""""
Define a computation that calculates the temperature of a group of Define a computation that calculates the temperature of a group of atoms in a
atoms in a geometric region. This can be useful for thermostatting geometric region. This can be useful for thermostatting one portion of the
one portion of the simulation box. E.g. a McDLT simulation where one simulation box. For example, a McDLT simulation where one side is cooled, and
side is cooled, and the other side is heated. A compute of this style the other side is heated. A compute of this style can be used by any command
can be used by any command that computes a temperature, that computes a temperature (e.g., :doc:`thermo_modify <thermo_modify>`,
e.g. :doc:`thermo_modify <thermo_modify>`, :doc:`fix temp/rescale <fix_temp_rescale>`, etc. :doc:`fix temp/rescale <fix_temp_rescale>`).
Note that a *region*\ -style temperature can be used to thermostat with Note that a *region*\ -style temperature can be used to thermostat with
:doc:`fix temp/rescale <fix_temp_rescale>` or :doc:`fix langevin <fix_langevin>`, but should probably not be used with :doc:`fix temp/rescale <fix_temp_rescale>` or
Nose/Hoover style fixes (:doc:`fix nvt <fix_nh>`, :doc:`fix npt <fix_nh>`, or :doc:`fix nph <fix_nh>`), if the :doc:`fix langevin <fix_langevin>`, but should probably not be used with
degrees-of-freedom included in the computed T varies with time. Nose--Hoover style fixes (:doc:`fix nvt <fix_nh>`, :doc:`fix npt <fix_nh>`,
or :doc:`fix nph <fix_nh>`) if the degrees of freedom included in the computed
temperature vary with time.
The temperature is calculated by the formula KE = dim/2 N k T, where The temperature is calculated by the formula
KE = total kinetic energy of the group of atoms (sum of 1/2 m v\^2),
dim = 2 or 3 = dimensionality of the simulation, N = number of atoms
in both the group and region, k = Boltzmann constant, and T =
temperature.
A kinetic energy tensor, stored as a 6-element vector, is also .. math::
\text{KE} = \frac{\text{dim}}{2} N k T,
where KE = is the total kinetic energy of the group of atoms (sum of
:math:`\frac12 m v^2`), dim = 2 or 3 is the dimensionality of the simulation,
:math:`N` is the number of atoms in both the group and region, :math:`k` is
the Boltzmann constant, and :math:`T` temperature.
A kinetic energy tensor, stored as a six-element vector, is also
calculated by this compute for use in the computation of a pressure calculated by this compute for use in the computation of a pressure
tensor. The formula for the components of the tensor is the same as tensor. The formula for the components of the tensor is the same as
the above formula, except that v\^2 is replaced by vx\*vy for the xy the above formula, except that :math:`v^2` is replaced by :math:`v_x v_y`
component, etc. The 6 components of the vector are ordered xx, yy, for the :math:`xy` component, and so on. The six components of the vector are
zz, xy, xz, yz. ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
The number of atoms contributing to the temperature is calculated each The number of atoms contributing to the temperature is calculated each
time the temperature is evaluated since it is assumed atoms can time the temperature is evaluated since it is assumed atoms can
@ -62,18 +69,19 @@ compute is used with a fix command that performs thermostatting then
this bias will be subtracted from each atom, thermostatting of the this bias will be subtracted from each atom, thermostatting of the
remaining thermal velocity will be performed, and the bias will be remaining thermal velocity will be performed, and the bias will be
added back in. Thermostatting fixes that work in this way include added back in. Thermostatting fixes that work in this way include
:doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix temp/berendsen <fix_temp_berendsen>`, and :doc:`fix langevin <fix_langevin>`. This means that when this compute :doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`,
:doc:`fix temp/berendsen <fix_temp_berendsen>`, and
:doc:`fix langevin <fix_langevin>`. This means that when this compute
is used to calculate the temperature for any of the thermostatting is used to calculate the temperature for any of the thermostatting
fixes via the :doc:`fix modify temp <fix_modify>` command, the thermostat fixes via the :doc:`fix modify temp <fix_modify>` command, the thermostat
will operate only on atoms that are currently in the geometric will operate only on atoms that are currently in the geometric region.
region.
Unlike other compute styles that calculate temperature, this compute Unlike other compute styles that calculate temperature, this compute
does not subtract out degrees-of-freedom due to fixes that constrain does not subtract out degrees-of-freedom due to fixes that constrain
motion, such as :doc:`fix shake <fix_shake>` and :doc:`fix rigid <fix_rigid>`. This is because those degrees of freedom motion, such as :doc:`fix shake <fix_shake>` and :doc:`fix rigid <fix_rigid>`. This is because those degrees of freedom
(e.g. a constrained bond) could apply to sets of atoms that straddle (e.g., a constrained bond) could apply to sets of atoms that straddle
the region boundary, and hence the concept is somewhat ill-defined. the region boundary, and hence the concept is somewhat ill-defined.
If needed the number of subtracted degrees-of-freedom can be set If needed the number of subtracted degrees of freedom can be set
explicitly using the *extra* option of the explicitly using the *extra* option of the
:doc:`compute_modify <compute_modify>` command. :doc:`compute_modify <compute_modify>` command.
@ -85,16 +93,17 @@ Output info
""""""""""" """""""""""
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6. vector of length 6 (KE tensor), which can be accessed by indices 1--6.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output vector values from a compute as input. See the
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
options. options.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
vector values are "extensive". vector values are "extensive."
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`.
vector values will be in energy :doc:`units <units>`. The vector values will be in energy :doc:`units <units>`.
Restrictions Restrictions
"""""""""""" """"""""""""

View File

@ -6,7 +6,7 @@ compute temp/region/eff command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/region/eff region-ID compute ID group-ID temp/region/eff region-ID
@ -26,26 +26,28 @@ Description
Define a computation that calculates the temperature of a group of Define a computation that calculates the temperature of a group of
nuclei and electrons in the :doc:`electron force field <pair_eff>` nuclei and electrons in the :doc:`electron force field <pair_eff>`
model, within a geometric region using the electron force field. A model, within a geometric region using the electron force field.
compute of this style can be used by commands that compute a A compute of this style can be used by commands that compute a
temperature, e.g. :doc:`thermo_modify <thermo_modify>`. temperature (e.g., :doc:`thermo_modify <thermo_modify>`).
The operation of this compute is exactly like that described by the The operation of this compute is exactly like that described by the
:doc:`compute temp/region <compute_temp_region>` command, except that :doc:`compute temp/region <compute_temp_region>` command, except that
the formula for the temperature itself includes the radial electron the formula for the temperature itself includes the radial electron
velocity contributions, as discussed by the :doc:`compute temp/eff <compute_temp_eff>` command. velocity contributions, as discussed by the
:doc:`compute temp/eff <compute_temp_eff>` command.
Output info Output info
""""""""""" """""""""""
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6. vector of length 6 (KE tensor), which can be accessed by indices 1--6.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output vector values from a compute as input. See the
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
options. options.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
vector values are "extensive". vector values are "extensive."
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`. The
vector values will be in energy :doc:`units <units>`. vector values will be in energy :doc:`units <units>`.
@ -54,12 +56,15 @@ Restrictions
"""""""""""" """"""""""""
This compute is part of the EFF package. It is only enabled if This compute is part of the EFF package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info. LAMMPS was built with that package.
See the :doc:`Build package <Build_package>` page for more info.
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`compute temp/region <compute_temp_region>`, :doc:`compute temp/eff <compute_temp_eff>`, :doc:`compute pressure <compute_pressure>` :doc:`compute temp/region <compute_temp_region>`,
:doc:`compute temp/eff <compute_temp_eff>`,
:doc:`compute pressure <compute_pressure>`
Default Default
""""""" """""""

View File

@ -6,7 +6,7 @@ compute temp/rotate command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/rotate compute ID group-ID temp/rotate
@ -24,36 +24,46 @@ Description
""""""""""" """""""""""
Define a computation that calculates the temperature of a group of Define a computation that calculates the temperature of a group of
atoms, after subtracting out the center-of-mass velocity and angular velocity of the group. atoms, after subtracting out the center-of-mass velocity and angular velocity
This is useful if the group is expected to have a non-zero net of the group. This is useful if the group is expected to have a non-zero net
velocity and/or global rotation motion for some reason. A compute of this style can be used by any velocity and/or global rotation motion for some reason. A compute of this
command that computes a temperature, style can be used by any command that computes a temperature
e.g. :doc:`thermo_modify <thermo_modify>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`, etc. (e.g., :doc:`thermo_modify <thermo_modify>`,
:doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`).
After the center-of-mass velocity and angular velocity has been subtracted from each atom, After the center-of-mass velocity and angular velocity has been subtracted from
the temperature is calculated by the formula KE = dim/2 N k T, where each atom, the temperature is calculated by the formula
KE = total kinetic energy of the group of atoms (sum of 1/2 m v\^2),
dim = 2 or 3 = dimensionality of the simulation, N = number of atoms
in the group, k = Boltzmann constant, and T = temperature.
A kinetic energy tensor, stored as a 6-element vector, is also .. math::
calculated by this compute for use in the computation of a pressure
tensor. The formula for the components of the tensor is the same as \text{KE} = \frac{\text{dim}}{2} N k T,
the above formula, except that v\^2 is replaced by vx\*vy for the xy
component, etc. The 6 components of the vector are ordered xx, yy, where KE is the total kinetic energy of the group of atoms (sum of
zz, xy, xz, yz. :math:`\frac12 m v^2`), dim = 2 or 3 is the dimensionality of the simulation,
:math:`N` is the number of atoms in the group, :math:`k` is the Boltzmann
constant, and :math:`T` is the absolute temperature.
A kinetic energy tensor, stored as a six-element vector, is also calculated by
this compute for use in the computation of a pressure tensor. The formula for
the components of the tensor is the same as the above formula, except that
:math:`v^2` is replaced by :math:`v_x v_y` for the :math:`xy` component, and
so on. The six components of the vector are ordered :math:`xx`, :math:`yy`,
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
The number of atoms contributing to the temperature is assumed to be The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the *dynamic* option of the constant for the duration of the run; use the *dynamic* option of the
:doc:`compute_modify <compute_modify>` command if this is not the case. :doc:`compute_modify <compute_modify>` command if this is not the case.
The removal of the center-of-mass velocity and angular velocity by this fix is essentially The removal of the center-of-mass velocity and angular velocity by this fix is
computing the temperature after a "bias" has been removed from the essentially computing the temperature after a "bias" has been removed from the
velocity of the atoms. If this compute is used with a fix command velocity of the atoms. If this compute is used with a fix command
that performs thermostatting then this bias will be subtracted from that performs thermostatting then this bias will be subtracted from
each atom, thermostatting of the remaining thermal velocity will be each atom, thermostatting of the remaining thermal velocity will be
performed, and the bias will be added back in. Thermostatting fixes performed, and the bias will be added back in. Thermostatting fixes
that work in this way include :doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix temp/berendsen <fix_temp_berendsen>`, and :doc:`fix langevin <fix_langevin>`. that work in this way include :doc:`fix nvt <fix_nh>`,
:doc:`fix temp/rescale <fix_temp_rescale>`,
:doc:`fix temp/berendsen <fix_temp_berendsen>`, and
:doc:`fix langevin <fix_langevin>`.
This compute subtracts out degrees-of-freedom due to fixes that This compute subtracts out degrees-of-freedom due to fixes that
constrain molecular motion, such as :doc:`fix shake <fix_shake>` and constrain molecular motion, such as :doc:`fix shake <fix_shake>` and
@ -72,11 +82,12 @@ Output info
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6. vector of length 6 (KE tensor), which can be accessed by indices 1-6.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output vector values from a compute as input. See the
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
options. options.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
vector values are "extensive". vector values are "extensive."
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`. The
vector values will be in energy :doc:`units <units>`. vector values will be in energy :doc:`units <units>`.
@ -85,7 +96,8 @@ Restrictions
"""""""""""" """"""""""""
This compute is part of the EXTRA-COMPUTE package. It is only enabled if This compute is part of the EXTRA-COMPUTE package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info. LAMMPS was built with that package.
See the :doc:`Build package <Build_package>` page for more info.
Related commands Related commands
"""""""""""""""" """"""""""""""""

View File

@ -6,7 +6,7 @@ compute temp/sphere command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/sphere keyword value ... compute ID group-ID temp/sphere keyword value ...
@ -42,10 +42,10 @@ usual :doc:`compute temp <compute_temp>` command, which assumes point
particles with only translational kinetic energy. particles with only translational kinetic energy.
Both point and finite-size particles can be included in the group. Both point and finite-size particles can be included in the group.
Point particles do not rotate, so they have only 3 translational Point particles do not rotate, so they have only three translational
degrees of freedom. For 3d spherical particles, each has 6 degrees of degrees of freedom. For 3d spherical particles, each has six degrees of
freedom (3 translational, 3 rotational). For 2d spherical particles, freedom (three translational, three rotational). For 2d spherical particles,
each has 3 degrees of freedom (2 translational, 1 rotational). each has three degrees of freedom (two translational, one rotational).
.. note:: .. note::
@ -60,8 +60,9 @@ each has 3 degrees of freedom (2 translational, 1 rotational).
The translational kinetic energy is computed the same as is described The translational kinetic energy is computed the same as is described
by the :doc:`compute temp <compute_temp>` command. The rotational by the :doc:`compute temp <compute_temp>` command. The rotational
kinetic energy is computed as 1/2 I w\^2, where I is the moment of kinetic energy is computed as :math:`\frac12 I \omega^2`, where :math:`I` is
inertia for a sphere and w is the particle's angular velocity. the moment of inertia for a sphere and :math:`\omega` is the particle's angular
velocity.
.. note:: .. note::
@ -69,11 +70,12 @@ inertia for a sphere and w is the particle's angular velocity.
spheres, not disks, meaning their moment of inertia will be the same spheres, not disks, meaning their moment of inertia will be the same
as in 3d. as in 3d.
A kinetic energy tensor, stored as a 6-element vector, is also A kinetic energy tensor, stored as a six-element vector, is also
calculated by this compute. The formula for the components of the calculated by this compute. The formula for the components of the
tensor is the same as the above formulas, except that v\^2 and w\^2 are tensor is the same as the above formulas, except that :math:`v^2` and
replaced by vx\*vy and wx\*wy for the xy component. The 6 components of :math:`\omega^2` are replaced by :math:`v_x v_y` and :math:`\omega_x \omega_y`
the vector are ordered xx, yy, zz, xy, xz, yz. for the :math:`xy` component. The six components of the vector are ordered
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
The number of atoms contributing to the temperature is assumed to be The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the *dynamic* option of the constant for the duration of the run; use the *dynamic* option of the
@ -82,7 +84,7 @@ constant for the duration of the run; use the *dynamic* option of the
This compute subtracts out translational degrees-of-freedom due to This compute subtracts out translational degrees-of-freedom due to
fixes that constrain molecular motion, such as :doc:`fix shake <fix_shake>` and :doc:`fix rigid <fix_rigid>`. This means the fixes that constrain molecular motion, such as :doc:`fix shake <fix_shake>` and :doc:`fix rigid <fix_rigid>`. This means the
temperature of groups of atoms that include these constraints will be temperature of groups of atoms that include these constraints will be
computed correctly. If needed, the subtracted degrees-of-freedom can computed correctly. If needed, the subtracted degrees of freedom can
be altered using the *extra* option of the be altered using the *extra* option of the
:doc:`compute_modify <compute_modify>` command. :doc:`compute_modify <compute_modify>` command.
@ -98,14 +100,14 @@ For the *bias* keyword, *bias-ID* refers to the ID of a temperature
compute that removes a "bias" velocity from each atom. This allows compute that removes a "bias" velocity from each atom. This allows
compute temp/sphere to compute its thermal temperature after the compute temp/sphere to compute its thermal temperature after the
translational kinetic energy components have been altered in a translational kinetic energy components have been altered in a
prescribed way, e.g. to remove a flow velocity profile. Thermostats prescribed way (e.g., to remove a flow velocity profile). Thermostats
that use this compute will work with this bias term. See the doc that use this compute will work with this bias term. See the doc
pages for individual computes that calculate a temperature and the doc pages for individual computes that calculate a temperature and the doc
pages for fixes that perform thermostatting for more details. pages for fixes that perform thermostatting for more details.
For the *dof* keyword, a setting of *all* calculates a temperature For the *dof* keyword, a setting of *all* calculates a temperature
that includes both translational and rotational degrees of freedom. A that includes both translational and rotational degrees of freedom.
setting of *rotate* calculates a temperature that includes only A setting of *rotate* calculates a temperature that includes only
rotational degrees of freedom. rotational degrees of freedom.
---------- ----------
@ -114,13 +116,14 @@ Output info
""""""""""" """""""""""
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 6 (KE tensor), which can be accessed by indices 1-6. vector of length 6 (KE tensor), which can be accessed by indices 1--6.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output vector values from a compute as input.
options. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS
output options.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
vector values are "extensive". vector values are "extensive."
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`. The
vector values will be in energy :doc:`units <units>`. vector values will be in energy :doc:`units <units>`.

View File

@ -6,7 +6,7 @@ compute temp/uef command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID temp/uef compute ID group-ID temp/uef
@ -38,8 +38,9 @@ documentation for :doc:`compute temp <compute_temp>`.
Restrictions Restrictions
"""""""""""" """"""""""""
This fix is part of the UEF package. It is only enabled if LAMMPS This fix is part of the UEF package. It is only enabled if LAMMPS was built
was built with that package. See the :doc:`Build package <Build_package>` page for more info. with that package. See the :doc:`Build package <Build_package>` page for more
info.
This command can only be used when :doc:`fix nvt/uef <fix_nh_uef>` This command can only be used when :doc:`fix nvt/uef <fix_nh_uef>`
or :doc:`fix npt/uef <fix_nh_uef>` is active. or :doc:`fix npt/uef <fix_nh_uef>` is active.

View File

@ -6,14 +6,14 @@ compute ti command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group ti keyword args ... compute ID group ti keyword args ...
* ID, group-ID are documented in :doc:`compute <compute>` command * ID, group-ID are documented in :doc:`compute <compute>` command
* ti = style name of this compute command * ti = style name of this compute command
* one or more attribute/arg pairs may be appended * one or more attribute/arg pairs may be appended
* keyword = pair style (lj/cut, gauss, born, etc) or *tail* or *kspace* * keyword = pair style (lj/cut, gauss, born, etc.) or *tail* or *kspace*
.. parsed-literal:: .. parsed-literal::
@ -47,81 +47,85 @@ thermodynamic integration. This derivative can be used to infer a
free energy difference resulting from an alchemical simulation, as free energy difference resulting from an alchemical simulation, as
described in :ref:`Eike <Eike>`. described in :ref:`Eike <Eike>`.
Typically this compute will be used in conjunction with the :doc:`fix adapt <fix_adapt>` command which can perform alchemical Typically this compute will be used in conjunction with the
:doc:`fix adapt <fix_adapt>` command which can perform alchemical
transformations by adjusting the strength of an interaction potential transformations by adjusting the strength of an interaction potential
as a simulation runs, as defined by one or more as a simulation runs, as defined by one or more
:doc:`pair_style <pair_style>` or :doc:`kspace_style <kspace_style>` :doc:`pair_style <pair_style>` or :doc:`kspace_style <kspace_style>`
commands. This scaling is done via a prefactor on the energy, forces, commands. This scaling is done via a prefactor on the energy, forces,
virial calculated by the pair or K-Space style. The prefactor is virial calculated by the pair or :math:`k`-space style. The prefactor is
often a function of a *lambda* parameter which may be adjusted from 0 often a function of a *lambda* parameter which may be adjusted from 0 to 1
to 1 (or vice versa) over the course of a :doc:`run <run>`. The (or vice versa) over the course of a :doc:`run <run>`.
time-dependent adjustment is what the :doc:`fix adapt <fix_adapt>` The time-dependent adjustment is what the :doc:`fix adapt <fix_adapt>`
command does. command does.
Assume that the unscaled energy of a pair_style or kspace_style is Assume that the unscaled energy of a pair_style or kspace_style is
given by U. Then the scaled energy is given by :math:`U`. Then the scaled energy is
.. parsed-literal:: .. math::
Us = f(lambda) U U_s = f(\lambda) U
where f() is some function of lambda. What this compute calculates is where :math:`f` is some function of :math:`\lambda`. What this compute
calculates is
.. parsed-literal:: .. math::
dUs / d(lambda) = U df(lambda)/dlambda = Us / f(lambda) df(lambda)/dlambda \frac{dU_s}{d\lambda} = U \frac{df(\lambda)}{d\lambda}
= \frac{U_s}{f(\lambda)} \frac{df(\lambda)}{d\lambda},
which is the derivative of the system's scaled potential energy Us which is the derivative of the system's scaled potential energy :math:`U_s`
with respect to *lambda*\ . with respect to :math:`\lambda`.
To perform this calculation, you provide one or more atom types as To perform this calculation, you provide one or more atom types as
*atype*\ . *Atype* can be specified in one of two ways. An explicit *atype*\ . The variable *atype* can be specified in one of two ways.
numeric values can be used, as in the first example above. Or a An explicit numeric value can be used, as in the first example above, or a
wildcard asterisk can be used in place of or in conjunction with the wildcard asterisk can be used in place of or in conjunction with the
*atype* argument to select multiple atom types. This takes the form *atype* argument to select multiple atom types. This takes the form
"\*" or "\*n" or "n\*" or "m\*n". If N = the number of atom types, then "\*" or "\*n" or "m\*" or "m\*n". If :math:`N` is the number of atom types,
an asterisk with no numeric values means all types from 1 to N. A then an asterisk with no numeric values means all types from 1 to :math:`N`.
leading asterisk means all types from 1 to n (inclusive). A trailing A leading asterisk means all types from 1 to n (inclusive). A trailing
asterisk means all types from n to N (inclusive). A middle asterisk asterisk means all types from m to N (inclusive). A middle asterisk
means all types from m to n (inclusive). means all types from m to n (inclusive).
You also specify two functions, as :doc:`equal-style variables <variable>`. The first is specified as *v_name1*, where You also specify two functions, as :doc:`equal-style variables <variable>`.
*name1* is the name of the variable, and is f(lambda) in the notation The first is specified as *v_name1*, where *name1* is the name of the
above. The second is specified as *v_name2*, where *name2* is the variable, and is :math:`f(\lambda)` in the notation above. The second is
name of the variable, and is df(lambda) / dlambda in the notation specified as *v_name2*, where *name2* is the name of the variable, and is
above. I.e. it is the analytic derivative of f() with respect to :math:`df(\lambda)/d\lambda` in the notation above (i.e., it is the analytic
lambda. Note that the *name1* variable is also typically given as an derivative of :math:`f` with respect to :math:`\lambda`).
Note that the *name1* variable is also typically given as an
argument to the :doc:`fix adapt <fix_adapt>` command. argument to the :doc:`fix adapt <fix_adapt>` command.
An alchemical simulation may use several pair potentials together, An alchemical simulation may use several pair potentials together,
invoked via the :doc:`pair_style hybrid or hybrid/overlay <pair_hybrid>` invoked via the :doc:`pair_style hybrid or hybrid/overlay <pair_hybrid>`
command. The total dUs/dlambda for the overall system is calculated command. The total :math:`dU_s/d\lambda` for the overall system is calculated
as the sum of each contributing term as listed by the keywords in the as the sum of each contributing term as listed by the keywords in the
compute ti command. Individual pair potentials can be listed, which :doc:`compute ti <compute_ti>` command. Individual pair potentials can be
will be sub-styles in the hybrid case. You can also include a K-space listed, which will be sub-styles in the hybrid case. You can also include a
term via the *kspace* keyword. You can also include a pairwise :math:`k`-space term via the *kspace* keyword. You can also include a pairwise
long-range tail correction to the energy via the *tail* keyword. long-range tail correction to the energy via the *tail* keyword.
For each term you can specify a different (or the same) scale factor For each term, you can specify a different (or the same) scale factor
by the two variables that you list. Again, these will typically by the two variables that you list. Again, these will typically
correspond toe the scale factors applied to these various potentials correspond toe the scale factors applied to these various potentials
and the K-Space contribution via the :doc:`fix adapt <fix_adapt>` and the :math:`k`-space contribution via the :doc:`fix adapt <fix_adapt>`
command. command.
More details about the exact functional forms for the computation of More details about the exact functional forms for the computation of
du/dl can be found in the paper by :ref:`Eike <Eike>`. :math:`du/dl` can be found in the paper by :ref:`Eike <Eike>`.
---------- ----------
Output info Output info
""""""""""" """""""""""
This compute calculates a global scalar, namely dUs/dlambda. This This compute calculates a global scalar, namely :math:`dU_s/d\lambda`. This
value can be used by any command that uses a global scalar value from value can be used by any command that uses a global scalar value from
a compute as input. See the :doc:`Howto output <Howto_output>` doc page a compute as input. See the :doc:`Howto output <Howto_output>` doc page
for an overview of LAMMPS output options. for an overview of LAMMPS output options.
The scalar value calculated by this compute is "extensive". The scalar value calculated by this compute is "extensive."
The scalar value will be in energy :doc:`units <units>`. The scalar value will be in energy :doc:`units <units>`.
@ -129,7 +133,8 @@ Restrictions
"""""""""""" """"""""""""
This compute is part of the EXTRA-COMPUTE package. It is only enabled if This compute is part of the EXTRA-COMPUTE package. It is only enabled if
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info. LAMMPS was built with that package. See the
:doc:`Build package <Build_package>` page for more info.
Related commands Related commands
"""""""""""""""" """"""""""""""""

View File

@ -6,7 +6,7 @@ compute torque/chunk command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID torque/chunk chunkID compute ID group-ID torque/chunk chunkID
@ -27,14 +27,17 @@ Description
Define a computation that calculates the torque on multiple chunks of Define a computation that calculates the torque on multiple chunks of
atoms. atoms.
In LAMMPS, chunks are collections of atoms defined by a :doc:`compute chunk/atom <compute_chunk_atom>` command, which assigns each atom In LAMMPS, chunks are collections of atoms defined by a
:doc:`compute chunk/atom <compute_chunk_atom>` command, which assigns each atom
to a single chunk (or no chunk). The ID for this command is specified to a single chunk (or no chunk). The ID for this command is specified
as chunkID. For example, a single chunk could be the atoms in a as chunkID. For example, a single chunk could be the atoms in a
molecule or atoms in a spatial bin. See the :doc:`compute chunk/atom <compute_chunk_atom>` and :doc:`Howto chunk <Howto_chunk>` molecule or atoms in a spatial bin. See the
:doc:`compute chunk/atom <compute_chunk_atom>` and
:doc:`Howto chunk <Howto_chunk>`
doc pages for details of how chunks can be defined and examples of how doc pages for details of how chunks can be defined and examples of how
they can be used to measure properties of a system. they can be used to measure properties of a system.
This compute calculates the 3 components of the torque vector for eqch This compute calculates the three components of the torque vector for eqch
chunk, due to the forces on the individual atoms in the chunk around chunk, due to the forces on the individual atoms in the chunk around
the center-of-mass of the chunk. The calculation includes all effects the center-of-mass of the chunk. The calculation includes all effects
due to atoms passing through periodic boundaries. due to atoms passing through periodic boundaries.
@ -55,7 +58,8 @@ non-zero chunk IDs.
"unwrapped" coordinates. See the Atoms section of the "unwrapped" coordinates. See the Atoms section of the
:doc:`read_data <read_data>` command for a discussion of image flags and :doc:`read_data <read_data>` command for a discussion of image flags and
how they are set for each atom. You can reset the image flags how they are set for each atom. You can reset the image flags
(e.g. to 0) before invoking this compute by using the :doc:`set image <set>` command. (e.g., to 0) before invoking this compute by using the
:doc:`set image <set>` command.
The simplest way to output the results of the compute torque/chunk The simplest way to output the results of the compute torque/chunk
calculation to a file is to use the :doc:`fix ave/time <fix_ave_time>` calculation to a file is to use the :doc:`fix ave/time <fix_ave_time>`
@ -70,14 +74,16 @@ command, for example:
Output info Output info
""""""""""" """""""""""
This compute calculates a global array where the number of rows = the This compute calculates a global array where the number of rows is equal to the
number of chunks *Nchunk* as calculated by the specified :doc:`compute chunk/atom <compute_chunk_atom>` command. The number of columns = number of chunks *Nchunk* as calculated by the specified
3 for the 3 xyz components of the torque for each chunk. These values :doc:`compute chunk/atom <compute_chunk_atom>` command. The number of columns
can be accessed by any command that uses global array values from a is three for the :math:`x`, :math:`y`, and :math:`z` components of the torque
compute as input. See the :doc:`Howto output <Howto_output>` doc page for each chunk. These values can be accessed by any command that uses global
array values from a compute as input.
See the :doc:`Howto output <Howto_output>` doc page
for an overview of LAMMPS output options. for an overview of LAMMPS output options.
The array values are "intensive". The array values will be in The array values are "intensive." The array values will be in
force-distance :doc:`units <units>`. force-distance :doc:`units <units>`.
Restrictions Restrictions

View File

@ -6,7 +6,7 @@ compute vacf command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID vacf compute ID group-ID vacf
@ -29,13 +29,14 @@ function (VACF), averaged over a group of atoms. Each atom's
contribution to the VACF is its current velocity vector dotted into contribution to the VACF is its current velocity vector dotted into
its initial velocity vector at the time the compute was specified. its initial velocity vector at the time the compute was specified.
A vector of four quantities is calculated by this compute. The first 3 A vector of four quantities is calculated by this compute. The first three
elements of the vector are vx \* vx0 (and similarly for the y and z elements of the vector are :math:`v_x v_{x,0}` (and similar for the
components), summed and averaged over atoms in the group. Vx is the :math:`y` and :math:`z` components), summed and averaged over atoms in the
current x-component of velocity for the atom, vx0 is the initial group, where :math:`v_x` is the current :math:`x`-component of the velocity of
x-component of velocity for the atom. The fourth element of the vector the atom and :math:`v_{x,0}` is the initial :math:`x`-component of the velocity
is the total VACF, i.e. (vx\*vx0 + vy\*vy0 + vz\*vz0), summed and of the atom. The fourth element of the vector is the total VACF
averaged over atoms in the group. (i.e., :math:`(v_x v_{x,0} + v_y v_{y,0} + v_z v_{z,0})`),
summed and averaged over atoms in the group.
The integral of the VACF versus time is proportional to the diffusion The integral of the VACF versus time is proportional to the diffusion
coefficient of the diffusing atoms. This can be computed in the coefficient of the diffusing atoms. This can be computed in the
@ -61,12 +62,12 @@ Output info
""""""""""" """""""""""
This compute calculates a global vector of length 4, which can be This compute calculates a global vector of length 4, which can be
accessed by indices 1-4 by any command that uses global vector values accessed by indices 1--4 by any command that uses global vector values
from a compute as input. See the :doc:`Howto output <Howto_output>` doc from a compute as input. See the :doc:`Howto output <Howto_output>` doc
page for an overview of LAMMPS output options. page for an overview of LAMMPS output options.
The vector values are "intensive". The vector values will be in The vector values are "intensive." The vector values will be in
velocity\^2 :doc:`units <units>`. velocity\ :math:`^2` :doc:`units <units>`.
Restrictions Restrictions
"""""""""""" """"""""""""

View File

@ -6,7 +6,7 @@ compute vcm/chunk command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID vcm/chunk chunkID compute ID group-ID vcm/chunk chunkID
@ -27,14 +27,15 @@ Description
Define a computation that calculates the center-of-mass velocity for Define a computation that calculates the center-of-mass velocity for
multiple chunks of atoms. multiple chunks of atoms.
In LAMMPS, chunks are collections of atoms defined by a :doc:`compute chunk/atom <compute_chunk_atom>` command, which assigns each atom In LAMMPS, chunks are collections of atoms defined by a
to a single chunk (or no chunk). The ID for this command is specified :doc:`compute chunk/atom <compute_chunk_atom>` command, which assigns each atom
as chunkID. For example, a single chunk could be the atoms in a to a single chunk (or no chunk). The ID for this command is specified as
molecule or atoms in a spatial bin. See the :doc:`compute chunk/atom <compute_chunk_atom>` and :doc:`Howto chunk <Howto_chunk>` chunkID. For example, a single chunk could be the atoms in a molecule or atoms
doc pages for details of how chunks can be defined and examples of how in a spatial bin. See the :doc:`compute chunk/atom <compute_chunk_atom>` and
they can be used to measure properties of a system. :doc:`Howto chunk <Howto_chunk>` doc pages for details of how chunks can be
defined and examples of how they can be used to measure properties of a system.
This compute calculates the x,y,z components of the center-of-mass This compute calculates the :math:`(x,y,z)` components of the center-of-mass
velocity for each chunk. This is done by summing mass\*velocity for velocity for each chunk. This is done by summing mass\*velocity for
each atom in the chunk and dividing the sum by the total mass of the each atom in the chunk and dividing the sum by the total mass of the
chunk. chunk.
@ -60,14 +61,15 @@ command, for example:
Output info Output info
""""""""""" """""""""""
This compute calculates a global array where the number of rows = the This compute calculates a global array where the number of rows is the
number of chunks *Nchunk* as calculated by the specified :doc:`compute chunk/atom <compute_chunk_atom>` command. The number of columns = number of chunks *Nchunk* as calculated by the specified
3 for the x,y,z center-of-mass velocity coordinates of each chunk. :doc:`compute chunk/atom <compute_chunk_atom>` command. The number of
These values can be accessed by any command that uses global array columns is 3 for the :math:`(x,y,z)` center-of-mass velocity coordinates of
values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output each chunk. These values can be accessed by any command that uses global array
options. values from a compute as input. See the :doc:`Howto output <Howto_output>`
page for an overview of LAMMPS output options.
The array values are "intensive". The array values will be in The array values are "intensive." The array values will be in
velocity :doc:`units <units>`. velocity :doc:`units <units>`.
Restrictions Restrictions

View File

@ -7,7 +7,7 @@ Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID viscosity/cos compute ID group-ID viscosity/cos
@ -35,64 +35,69 @@ Description
Define a computation that calculates the velocity amplitude of a group of atoms Define a computation that calculates the velocity amplitude of a group of atoms
with an cosine-shaped velocity profile and the temperature of them with an cosine-shaped velocity profile and the temperature of them
after subtracting out the velocity profile before computing the kinetic energy. after subtracting out the velocity profile before computing the kinetic energy.
A compute of this style can be used by any command that computes a temperature, A compute of this style can be used by any command that computes a temperature
e.g. :doc:`thermo_modify <thermo_modify>`, :doc:`fix npt <fix_nh>`, etc. (e.g., :doc:`thermo_modify <thermo_modify>`, :doc:`fix npt <fix_nh>`).
This command together with :doc:`fix_accelerate/cos<fix_accelerate_cos>` This command together with :doc:`fix_accelerate/cos<fix_accelerate_cos>`
enables viscosity calculation with periodic perturbation method, enables viscosity calculation with periodic perturbation method,
as described by :ref:`Hess<Hess1>`. as described by :ref:`Hess<Hess1>`.
An acceleration along the x-direction is applied to the simulation system An acceleration along the :math:`x`-direction is applied to the simulation
by using :doc:`fix_accelerate/cos<fix_accelerate_cos>` command. system by using :doc:`fix_accelerate/cos<fix_accelerate_cos>` command.
The acceleration is a periodic function along the z-direction: The acceleration is a periodic function along the :math:`z`-direction:
.. math:: .. math::
a_{x}(z) = A \cos \left(\frac{2 \pi z}{l_{z}}\right) a_{x}(z) = A \cos \left(\frac{2 \pi z}{l_{z}}\right)
where :math:`A` is the acceleration amplitude, :math:`l_z` is the z-length where :math:`A` is the acceleration amplitude, :math:`l_z` is the
of the simulation box. At steady state, the acceleration generates :math:`z`-length of the simulation box. At steady state, the acceleration
a velocity profile: generates a velocity profile:
.. math:: .. math::
v_{x}(z) = V \cos \left(\frac{2 \pi z}{l_{z}}\right) v_{x}(z) = V \cos \left(\frac{2 \pi z}{l_{z}}\right)
The generated velocity amplitude :math:`V` is related to the The generated velocity amplitude :math:`V` is related to the
shear viscosity :math:`\eta` by: shear viscosity :math:`\eta` by
.. math:: .. math::
V = \frac{A \rho}{\eta}\left(\frac{l_{z}}{2 \pi}\right)^{2} V = \frac{A \rho}{\eta}\left(\frac{l_{z}}{2 \pi}\right)^{2},
and it can be obtained from ensemble average of the velocity profile via
and it can be obtained from ensemble average of the velocity profile:
.. math:: .. math::
V = \frac{\sum_i 2 m_{i} v_{i, x} \cos \left(\frac{2 \pi z_i}{l_{z}}\right)}{\sum_i m_{i}} V = \frac{\sum\limits_i 2 m_{i} v_{i, x} \cos \left(\frac{2 \pi z_i}{l_{z}}\right)}{\sum\limits_i m_{i}}
where :math:`m_i`, :math:`v_{i,x}` and :math:`z_i` are the mass, where :math:`m_i`, :math:`v_{i,x}` and :math:`z_i` are the mass,
x-component velocity and z coordinate of a particle. :math:`x`-component velocity, and :math:`z`-coordinate of a particle,
respectively.
After the cosine-shaped collective velocity in :math:`x` direction After the cosine-shaped collective velocity in the :math:`x`-direction has been
has been subtracted for each atom, the temperature is calculated by the formula subtracted for each atom, the temperature is calculated by the formula
KE = dim/2 N k T, where KE = total kinetic energy of the group of
atoms (sum of 1/2 m v\^2), dim = 2 or 3 = dimensionality of the
simulation, N = number of atoms in the group, k = Boltzmann constant,
and T = temperature.
A kinetic energy tensor, stored as a 6-element vector, is also .. math::
\text{KE} = \frac{\text{dim}}{2} N k T,
where KE is the total kinetic energy of the group of atoms (sum of
:math:`\frac12 m v^2`), dim = 2 or 3 is the dimensionality of the simulation,
:math:`N` is the number of atoms in the group, :math:`k` is the Boltzmann
constant, and :math:`T` is the absolute temperature.
A kinetic energy tensor, stored as a six-element vector, is also
calculated by this compute for use in the computation of a pressure calculated by this compute for use in the computation of a pressure
tensor. The formula for the components of the tensor is the same as tensor. The formula for the components of the tensor is the same as
the above formula, except that v\^2 is replaced by vx\*vy for the xy the above formula, except that :math:`v^2` is replaced by :math:`v_x v_y` for
component, etc. The 6 components of the vector are ordered xx, yy, the :math:`xy` component, and so on. The six components of the vector are
zz, xy, xz, yz. ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
The number of atoms contributing to the temperature is assumed to be The number of atoms contributing to the temperature is assumed to be
constant for the duration of the run; use the *dynamic* option of the constant for the duration of the run; use the *dynamic* option of the
:doc:`compute_modify <compute_modify>` command if this is not the case. :doc:`compute_modify <compute_modify>` command if this is not the case.
However, in order to get meaningful result, the group ID of this compute should be all. However, in order to get meaningful result, the group ID of this compute should
be all.
The removal of the cosine-shaped velocity component by this command is The removal of the cosine-shaped velocity component by this command is
essentially computing the temperature after a "bias" has been removed essentially computing the temperature after a "bias" has been removed
@ -100,18 +105,20 @@ from the velocity of the atoms. If this compute is used with a fix
command that performs thermostatting then this bias will be subtracted command that performs thermostatting then this bias will be subtracted
from each atom, thermostatting of the remaining thermal velocity will from each atom, thermostatting of the remaining thermal velocity will
be performed, and the bias will be added back in. Thermostatting be performed, and the bias will be added back in. Thermostatting
fixes that work in this way include :doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix temp/berendsen <fix_temp_berendsen>`, and :doc:`fix langevin <fix_langevin>`. fixes that work in this way include :doc:`fix nvt <fix_nh>`,
:doc:`fix temp/rescale <fix_temp_rescale>`,
:doc:`fix temp/berendsen <fix_temp_berendsen>`, and
:doc:`fix langevin <fix_langevin>`.
This compute subtracts out degrees-of-freedom due to fixes that This compute subtracts out degrees of freedom due to fixes that
constrain molecular motion, such as :doc:`fix shake <fix_shake>` and constrain molecular motion, such as :doc:`fix shake <fix_shake>` and
:doc:`fix rigid <fix_rigid>`. This means the temperature of groups of :doc:`fix rigid <fix_rigid>`. This means that the temperature of groups of
atoms that include these constraints will be computed correctly. If atoms that include these constraints will be computed correctly. If
needed, the subtracted degrees-of-freedom can be altered using the needed, the subtracted degrees of freedom can be altered using the
*extra* option of the :doc:`compute_modify <compute_modify>` command. *extra* option of the :doc:`compute_modify <compute_modify>` command.
See the :doc:`Howto thermostat <Howto_thermostat>` page for a See the :doc:`Howto thermostat <Howto_thermostat>` page for a discussion of
discussion of different ways to compute temperature and perform different ways to compute temperature and perform thermostatting.
thermostatting.
---------- ----------
@ -119,28 +126,28 @@ Output info
""""""""""" """""""""""
This compute calculates a global scalar (the temperature) and a global This compute calculates a global scalar (the temperature) and a global
vector of length 7, which can be accessed by indices 1-7. vector of length 7, which can be accessed by indices 1--7.
The first 6 elements of the vector are the KE tensor, The first six elements of the vector are the KE tensor,
and the 7-th is the cosine-shaped velocity amplitude :math:`V`, and the seventh is the cosine-shaped velocity amplitude :math:`V`,
which can be used to calculate the reciprocal viscosity, as shown in the example. which can be used to calculate the reciprocal viscosity, as shown in the example.
These values can be used by any command that uses global scalar or These values can be used by any command that uses global scalar or
vector values from a compute as input. vector values from a compute as input.
See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output options. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output options.
The scalar value calculated by this compute is "intensive". The The scalar value calculated by this compute is "intensive." The
first 6 elements of vector values are "extensive", first six elements of vector values are "extensive,"
and the 7-th element of vector values is "intensive". and the seventh element of vector values is "intensive."
The scalar value will be in temperature :doc:`units <units>`. The The scalar value will be in temperature :doc:`units <units>`.
first 6 elements of vector values will be in energy :doc:`units <units>`. The first six elements of vector values will be in energy :doc:`units <units>`.
The 7-th element of vector value will be in velocity :doc:`units <units>`. The seventh element of vector value will be in velocity :doc:`units <units>`.
Restrictions Restrictions
"""""""""""" """"""""""""
This command is only available when LAMMPS was built with the MISC package. This command is only available when LAMMPS was built with the MISC package.
Since this compute depends on :doc:`fix accelerate/cos <fix_accelerate_cos>` which can Since this compute depends on :doc:`fix accelerate/cos <fix_accelerate_cos>`
only work for 3d systems, it cannot be used for 2d systems. which can only work for 3d systems, it cannot be used for 2d systems.
Related commands Related commands
"""""""""""""""" """"""""""""""""

View File

@ -6,15 +6,14 @@ compute voronoi/atom command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID voronoi/atom keyword arg ... compute ID group-ID voronoi/atom keyword arg ...
* ID, group-ID are documented in :doc:`compute <compute>` command * ID, group-ID are documented in :doc:`compute <compute>` command
* voronoi/atom = style name of this compute command * voronoi/atom = style name of this compute command
* zero or more keyword/value pairs may be appended * zero or more keyword/value pairs may be appended
* keyword = *only_group* or *surface* or *radius* or *edge_histo* or *edge_threshold* * keyword = *only_group* or *surface* or *radius* or *edge_histo* or *edge_threshold* or *face_threshold* or *neighbors* or *peratom*
or *face_threshold* or *neighbors* or *peratom*
.. parsed-literal:: .. parsed-literal::
@ -80,7 +79,7 @@ In the example above, a precipitate embedded in a matrix, only atoms
at the surface of the precipitate will have non-zero surface area, and at the surface of the precipitate will have non-zero surface area, and
only the outward facing facets of the Voronoi cells are counted (the only the outward facing facets of the Voronoi cells are counted (the
hull of the precipitate). The total surface area of the precipitate hull of the precipitate). The total surface area of the precipitate
can be obtained by running a "reduce sum" compute on c_2[3] can be obtained by running a "reduce sum" compute on c_2[3].
If the *radius* keyword is specified with an atom style variable as If the *radius* keyword is specified with an atom style variable as
the argument, a poly-disperse Voronoi tessellation is the argument, a poly-disperse Voronoi tessellation is
@ -149,7 +148,8 @@ with areas greater than the threshold are stored.
---------- ----------
The Voronoi calculation is performed by the freely available `Voro++ package <voronoi_>`_, written by Chris Rycroft at UC Berkeley and LBL, The Voronoi calculation is performed by the freely available
`Voro++ package <voronoi_>`_, written by Chris Rycroft at UC Berkeley and LBL,
which must be installed on your system when building LAMMPS for use which must be installed on your system when building LAMMPS for use
with this compute. See instructions on obtaining and installing the with this compute. See instructions on obtaining and installing the
Voro++ software in the src/VORONOI/README file. Voro++ software in the src/VORONOI/README file.
@ -169,49 +169,51 @@ Voro++ software in the src/VORONOI/README file.
:doc:`pair_style <pair_style>` interactions. The cutoff can be set :doc:`pair_style <pair_style>` interactions. The cutoff can be set
explicitly via the :doc:`comm_modify cutoff <comm_modify>` command. The explicitly via the :doc:`comm_modify cutoff <comm_modify>` command. The
Voronoi cells for atoms adjacent to empty regions will extend into Voronoi cells for atoms adjacent to empty regions will extend into
those regions up to the communication cutoff in x, y, or z. In that those regions up to the communication cutoff in :math:`x`, :math:`y`, or
situation, an exterior face is created at the cutoff distance normal :math:`z`. In that situation, an exterior face is created at the cutoff
to the x, y, or z direction. For triclinic systems, the exterior face distance normal to the :math:`x`, :math:`y`, or :math:`z` direction.
is parallel to the corresponding reciprocal lattice vector. For triclinic systems, the exterior face is parallel to the corresponding
reciprocal lattice vector.
.. note:: .. note::
The Voro++ package performs its calculation in 3d. This will The Voro++ package performs its calculation in 3d. This will
still work for a 2d LAMMPS simulation, provided all the atoms have the still work for a 2d LAMMPS simulation, provided all the atoms have the
same z coordinate. The Voronoi cell of each atom will be a columnar same :math:`z`-coordinate. The Voronoi cell of each atom will be a columnar
polyhedron with constant cross-sectional area along the z direction polyhedron with constant cross-sectional area along the :math:`z`-direction
and two exterior faces at the top and bottom of the simulation box. If and two exterior faces at the top and bottom of the simulation box. If
the atoms do not all have the same z coordinate, then the columnar the atoms do not all have the same :math:`z`-coordinate, then the columnar
cells will be accordingly distorted. The cross-sectional area of each cells will be accordingly distorted. The cross-sectional area of each
Voronoi cell can be obtained by dividing its volume by the z extent of Voronoi cell can be obtained by dividing its volume by the :math:`z` extent
the simulation box. Note that you define the z extent of the of the simulation box. Note that you define the :math:`z` extent of the
simulation box for 2d simulations when using the simulation box for 2d simulations when using the
:doc:`create_box <create_box>` or :doc:`read_data <read_data>` commands. :doc:`create_box <create_box>` or :doc:`read_data <read_data>` commands.
Output info Output info
""""""""""" """""""""""
By default, this compute calculates a per-atom array with 2 By default, this compute calculates a per-atom array with two
columns. In regular dynamic tessellation mode the first column is the columns. In regular dynamic tessellation mode the first column is the
Voronoi volume, the second is the neighbor count, as described above Voronoi volume, the second is the neighbor count, as described above
(read above for the output data in case the *occupation* keyword is (read above for the output data in case the *occupation* keyword is
specified). These values can be accessed by any command that uses specified). These values can be accessed by any command that uses
per-atom values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output per-atom values from a compute as input. See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
options. If the *peratom* keyword is set to "no", the per-atom array options. If the *peratom* keyword is set to "no," the per-atom array
is still created, but it is not accessible. is still created, but it is not accessible.
If the *edge_histo* keyword is used, then this compute generates a If the *edge_histo* keyword is used, then this compute generates a
global vector of length *maxedge*\ +1, containing a histogram of the global vector of length *maxedge*\ +1, containing a histogram of the
number of edges per face. number of edges per face.
If the *neighbors* value is set to yes, then this compute calculates a If the *neighbors* value is set to *yes*, then this compute calculates a
local array with 3 columns. There is one row for each face of each local array with three columns. There is one row for each face of each
Voronoi cell. Voronoi cell.
.. note:: .. note::
Some LAMMPS commands such as the :doc:`compute reduce <compute_reduce>` command can accept either a per-atom or Some LAMMPS commands such as the :doc:`compute reduce <compute_reduce>`
local quantity. If this compute produces both quantities, the command command can accept either a per-atom or local quantity. If this compute
produces both quantities, the command
may access the per-atom quantity, even if you want to access the local may access the per-atom quantity, even if you want to access the local
quantity. This effect can be eliminated by using the *peratom* quantity. This effect can be eliminated by using the *peratom*
keyword to turn off the production of the per-atom quantities. For keyword to turn off the production of the per-atom quantities. For

View File

@ -6,7 +6,7 @@ compute xrd command
Syntax Syntax
"""""" """"""
.. parsed-literal:: .. code-block:: LAMMPS
compute ID group-ID xrd lambda type1 type2 ... typeN keyword value ... compute ID group-ID xrd lambda type1 type2 ... typeN keyword value ...
@ -45,30 +45,31 @@ Examples
Description Description
""""""""""" """""""""""
Define a computation that calculates x-ray diffraction intensity as described Define a computation that calculates X-ray diffraction intensity as described
in :ref:`(Coleman) <xrd-Coleman>` on a mesh of reciprocal lattice nodes defined in :ref:`(Coleman) <xrd-Coleman>` on a mesh of reciprocal lattice nodes defined
by the entire simulation domain (or manually) using a simulated radiation by the entire simulation domain (or manually) using a simulated radiation
of wavelength lambda. of wavelength *lambda*.
The x-ray diffraction intensity, I, at each reciprocal lattice point, k, The X-ray diffraction intensity, :math:`I`, at each reciprocal lattice point,
is computed from the structure factor, F, using the equations: :math:`k`, is computed from the structure factor, :math:`F`, using the
equations:
.. math:: .. math::
I = & Lp(\theta)\frac{F^{*}F}{N} \\ I &= L_p(\theta)\frac{F^{*}F}{N} \\
F(\mathbf{k}) = & \sum_{j=1}^{N}f_j(\theta)exp(2\pi i \mathbf{k}\cdot \mathbf{r}_j) \\ F(\mathbf{k}) &= \sum_{j=1}^{N}f_j(\theta)exp(2\pi i \mathbf{k}\cdot \mathbf{r}_j) \\
Lp(\theta) = & \frac{1+cos^{2}(2\theta)}{cos(\theta)sin^{2}(\theta)} \\ L_p(\theta) &= \frac{1+\cos^2(2\theta)}{\cos(\theta)\sin^2(\theta)} \\
\frac{sin(\theta)}{\lambda} = & \frac{\left | \mathbf{k} \right |}{2} \frac{\sin(\theta)}{\lambda} &= \frac{\left\lVert\mathbf{k}\right\rVert}{2}
Here, K is the location of the reciprocal lattice node, :math:`r_j` is the Here, :math:`\mathbf{k}` is the location of the reciprocal lattice node,
position of each atom, :math:`f_j` are atomic scattering factors, *Lp* is the :math:`r_j` is the position of each atom, :math:`f_j` are atomic scattering
Lorentz-polarization factor, and :math:`\theta` is the scattering angle of factors, *Lp* is the Lorentz-polarization factor, and :math:`\theta` is the
diffraction. The Lorentz-polarization factor can be turned off using scattering angle of diffraction. The Lorentz-polarization factor can be turned
the optional *LP* keyword. off using the optional *LP* keyword.
Diffraction intensities are calculated on a three-dimensional mesh of Diffraction intensities are calculated on a three-dimensional mesh of
reciprocal lattice nodes. The mesh spacing is defined either (a) reciprocal lattice nodes. The mesh spacing is defined either (a) by the entire
by the entire simulation domain or (b) manually using selected values as simulation domain or (b) manually using selected values as
shown in the 2D diagram below. shown in the 2D diagram below.
.. image:: img/xrd_mesh.jpg .. image:: img/xrd_mesh.jpg
@ -76,29 +77,29 @@ shown in the 2D diagram below.
:align: center :align: center
For a mesh defined by the simulation domain, a rectilinear grid is For a mesh defined by the simulation domain, a rectilinear grid is
constructed with spacing *c*\ \*inv(A) along each reciprocal lattice constructed with spacing :math:`c A^{-1}` along each reciprocal lattice
axis. Where A are the vectors corresponding to the edges of the axis, where :math:`A` is a matrix containing the vectors corresponding to the
simulation cell. If one or two directions has non-periodic boundary edges of the simulation cell. If one or two directions has non-periodic
conditions, then the spacing in these directions is defined from the boundary conditions, then the spacing in these directions is defined from the
average of the (inversed) box lengths with periodic boundary conditions. average of the (inversed) box lengths with periodic boundary conditions.
Meshes defined by the simulation domain must contain at least one periodic Meshes defined by the simulation domain must contain at least one periodic
boundary. boundary.
If the *manual* flag is included, the mesh of reciprocal lattice nodes If the *manual* flag is included, the mesh of reciprocal lattice nodes
will defined using the *c* values for the spacing along each will be defined using the *c* values for the spacing along each
reciprocal lattice axis. Note that manual mapping of the reciprocal reciprocal lattice axis. Note that manual mapping of the reciprocal
space mesh is good for comparing diffraction results from multiple space mesh is good for comparing diffraction results from multiple
simulations; however it can reduce the likelihood that Bragg simulations; however, it can reduce the likelihood that Bragg
reflections will be satisfied unless small spacing parameters (< 0.05 reflections will be satisfied unless small spacing parameters
Angstrom\^(-1)) are implemented. Meshes with manual spacing do not (:math:`< 0.05~\mathrm{\mathring{A}}^{-1}`) are implemented.
require a periodic boundary. Meshes with manual spacing do not require a periodic boundary.
The limits of the reciprocal lattice mesh are determined by range of The limits of the reciprocal lattice mesh are determined by range of
scattering angles explored. The *2Theta* parameters allows the user scattering angles explored. The *2Theta* parameter allows the user
to reduce the scattering angle range to only the region of interest to reduce the scattering angle range to only the region of interest
which reduces the cost of the computation. which reduces the cost of the computation.
The atomic scattering factors, fj, accounts for the reduction in The atomic scattering factor, :math:`f_j`, accounts for the reduction in
diffraction intensity due to Compton scattering. Compute xrd uses diffraction intensity due to Compton scattering. Compute xrd uses
analytical approximations of the atomic scattering factors that vary analytical approximations of the atomic scattering factors that vary
for each atom type (type1 type2 ... typeN) and angle of diffraction. for each atom type (type1 type2 ... typeN) and angle of diffraction.
@ -107,8 +108,8 @@ The analytic approximation is computed using the formula
.. math:: .. math::
f_j\left ( \frac{sin(\theta)}{\lambda} \right )=\sum_{i}^{4} f_j\left ( \frac{\sin(\theta)}{\lambda} \right )=\sum_{i=1}^{4}
a_i exp\left ( -b_i \frac{sin^{2}(\theta)}{\lambda^{2}} \right )+c a_i \exp\left ( -b_i \frac{\sin^{2}(\theta)}{\lambda^{2}} \right )+c
Coefficients parameterized by :ref:`(Peng) <Peng>` are assigned for each Coefficients parameterized by :ref:`(Peng) <Peng>` are assigned for each
atom type designating the chemical symbol and charge of each atom atom type designating the chemical symbol and charge of each atom
@ -208,7 +209,7 @@ Output info
This compute calculates a global array. The number of rows in the This compute calculates a global array. The number of rows in the
array is the number of reciprocal lattice nodes that are explored array is the number of reciprocal lattice nodes that are explored
which by the mesh. The global array has 2 columns. which by the mesh. The global array has two columns.
The first column contains the diffraction angle in the units (radians The first column contains the diffraction angle in the units (radians
or degrees) provided with the *2Theta* values. The second column contains or degrees) provided with the *2Theta* values. The second column contains
@ -218,7 +219,7 @@ The array can be accessed by any command that uses global values from
a compute as input. See the :doc:`Howto output <Howto_output>` doc page a compute as input. See the :doc:`Howto output <Howto_output>` doc page
for an overview of LAMMPS output options. for an overview of LAMMPS output options.
All array values calculated by this compute are "intensive". All array values calculated by this compute are "intensive."
Restrictions Restrictions
"""""""""""" """"""""""""
@ -237,7 +238,7 @@ Related commands
Default Default
""""""" """""""
The option defaults are 2Theta = 1 179 (degrees), c = 1 1 1, LP = 1, The option defaults are *2Theta* = 1 179 (degrees), *c* = 1 1 1, *LP* = 1,
no manual flag, no echo flag. no manual flag, no echo flag.
---------- ----------