Page MenuHomec4science

compute_stress_atom.html
No OneTemporary

File Metadata

Created
Mon, Dec 2, 19:19

compute_stress_atom.html

<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute stress/atom command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID stress/atom temp-ID keyword ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>stress/atom = style name of this compute command
<LI>temp-ID = ID of compute that calculates temperature, can be NULL if not needed
<LI>zero or more keywords may be appended
<LI>keyword = <I>ke</I> or <I>pair</I> or <I>bond</I> or <I>angle</I> or <I>dihedral</I> or <I>improper</I> or <I>kspace</I> or <I>fix</I> or <I>virial</I>
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 mobile stress/atom NULL
compute 1 mobile stress/atom myRamp
compute 1 all stress/atom NULL pair bond
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that computes the symmetric per-atom stress
tensor for each atom in a group. The tensor for each atom has 6
components and is stored as a 6-element vector in the following order:
xx, yy, zz, xy, xz, yz. See the <A HREF = "compute_pressure.html">compute
pressure</A> command if you want the stress tensor
(pressure) of the entire system.
</P>
<P>The stress tensor for atom <I>I</I> is given by the following formula,
where <I>a</I> and <I>b</I> take on values x,y,z to generate the 6 components of
the symmetric tensor:
</P>
<CENTER><IMG SRC = "Eqs/stress_tensor.jpg">
</CENTER>
<P>The first term is a kinetic energy contribution for atom <I>I</I>. See
details below on how the specified <I>temp-ID</I> can affect the velocities
used in this calculation. The second term is a pairwise energy
contribution where <I>n</I> loops over the <I>Np</I> neighbors of atom <I>I</I>, <I>r1</I>
and <I>r2</I> are the positions of the 2 atoms in the pairwise interaction,
and <I>F1</I> and <I>F2</I> are the forces on the 2 atoms resulting from the
pairwise interaction. The third term is a bond contribution of
similar form for the <I>Nb</I> bonds which atom <I>I</I> is part of. There are
similar terms for the <I>Na</I> angle, <I>Nd</I> dihedral, and <I>Ni</I> improper
interactions atom <I>I</I> is part of. There is also a term for the KSpace
contribution from long-range Coulombic interactions, if defined.
Finally, there is a term for the <I>Nf</I> <A HREF = "fix.html">fixes</A> that apply
internal constraint forces to atom <I>I</I>. Currently, only the <A HREF = "fix_shake.html">fix
shake</A> and <A HREF = "fix_rigid.html">fix rigid</A> commands
contribute to this term.
</P>
<P>As the coefficients in the formula imply, a virial contribution
produced by a small set of atoms (e.g. 4 atoms in a dihedral or 3
atoms in a Tersoff 3-body interaction) is assigned in equal portions
to each atom in the set. E.g. 1/4 of the dihedral virial to each of
the 4 atoms, or 1/3 of the fix virial due to SHAKE constraints applied
to atoms in a a water molecule via the <A HREF = "fix_shake.html">fix shake</A>
command.
</P>
<P>If no extra keywords are listed, all of the terms in this formula are
included in the per-atom stress tensor. If any extra keywords are
listed, only those terms are summed to compute the tensor. The
<I>virial</I> keyword means include all terms except the kinetic energy
<I>ke</I>.
</P>
<P>Note that the stress for each atom is due to its interaction with all
other atoms in the simulation, not just with other atoms in the group.
</P>
<P>Details of how LAMMPS computes the virial for individual atoms for
either pairwise or manybody potentials, and including the effects of
periodic boundary conditions is discussed in <A HREF = "#Thompson">(Thompson)</A>.
The basic idea for manybody potentials is to treat each component of
the force computation between a small cluster of atoms in the same
manner as in the formula above for bond, angle, dihedral, etc
interactions. Namely the quantity R dot F is summed over the atoms in
the interaction, with the R vectors unwrapped by periodic boundaries
so that the cluster of atoms is close together. The total
contribution for the cluster interaction is divided evenly among those
atoms.
</P>
<P>The <A HREF = "dihedral_charmm.html">dihedral_style charmm</A> style calculates
pairwise interactions between 1-4 atoms. The virial contribution of
these terms is included in the pair virial, not the dihedral virial.
</P>
<P>The KSpace contribution is calculated using the method in
<A HREF = "#Heyes">(Heyes)</A> for the Ewald method and by the methodology described
in <A HREF = "#Sirk">(Sirk)</A> for PPPM. The choice of KSpace solver is specified
by the <A HREF = "kspace_style.html">kspace_style pppm</A> command. Note that for
PPPM, the calcluation requires 6 extra FFTs each timestep that
per-atom stress is calculated. Thus it can significantly increase the
cost of the PPPM calculation if it is needed on a large fraction of
the simulation timesteps.
</P>
<P>The <I>temp-ID</I> argument can be used to affect the per-atom velocities
used in the kinetic energy contribution to the total stress. If the
kinetic energy is not included in the stress, than the temperature
compute is not used and can be specified as NULL. If the kinetic
energy is included and you wish to use atom velocities as-is, then
<I>temp-ID</I> can also be specified as NULL. If desired, the specified
temperature compute can be one that subtracts off a bias to leave each
atom with only a thermal velocity to use in the formula above, e.g. by
subtracting a background streaming velocity. See the doc pages for
individual <A HREF = "compute.html">compute commands</A> to determine which ones
include a bias.
</P>
<HR>
<P>Note that as defined in the formula, per-atom stress is the negative
of the per-atom pressure tensor. It is also really a stress*volume
formulation, meaning the computed quantity is in units of
pressure*volume. It would need to be divided by a per-atom volume to
have units of stress (pressure), but an individual atom's volume is
not well defined or easy to compute in a deformed solid or a liquid.
See the <A HREF = "compute_voronoi_atom.html">compute voronoi/atom</A> command for
one possible way to estimate a per-atom volume.
</P>
<P>Thus, if the diagonal components of the per-atom stress tensor are
summed for all atoms in the system and the sum is divided by dV, where
d = dimension and V is the volume of the system, the result should be
-P, where P is the total pressure of the system.
</P>
<P>These lines in an input script for a 3d system should yield that
result. I.e. the last 2 columns of thermo output will be the same:
</P>
<PRE>compute peratom all stress/atom NULL
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]
variable press equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)
thermo_style custom step temp etotal press v_press
</PRE>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-atom array with 6 columns, which can be
accessed by indices 1-6 by any command that uses per-atom values from
a compute as input. See <A HREF = "Section_howto.html#howto_15">Section_howto
15</A> for an overview of LAMMPS output
options.
</P>
<P>The per-atom array values will be in pressure*volume
<A HREF = "units.html">units</A> as discussed above.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_pe.html">compute pe</A>, <A HREF = "compute_pressure.html">compute pressure</A>
</P>
<P><B>Default:</B> none
</P>
<HR>
<A NAME = "Heyes"></A>
<P><B>(Heyes)</B> Heyes, Phys Rev B 49, 755 (1994),
</P>
<A NAME = "Sirk"></A>
<P><B>(Sirk)</B> Sirk, Moore, Brown, J Chem Phys, 138, 064505 (2013).
</P>
<A NAME = "Thompson"></A>
<P><B>(Thompson)</B> Thompson, Plimpton, Mattson, J Chem Phys, 131, 154107 (2009).
</P>
</HTML>

Event Timeline