git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1195 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2007-11-30 23:16:45 +00:00
parent 358134485a
commit bba1cb5fcf
10 changed files with 229 additions and 186 deletions

View File

@ -2,10 +2,16 @@
\begin{document} \begin{document}
$$ \begin{eqnarray*}
S_{ab} = - \left[ m v_a v_b + S_{ab} & = & - \left[ m v_a v_b +
\frac{1}{2} \sum_{j = 1}^{N_p} (a_i - a_j) F_{p_{ij}} + \frac{1}{2} \sum_{n = 1}^{N_p} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b}) +
\frac{1}{2} \sum_{j = 1}^{N_b} (a_i - a_j) F_{b_{ij}} \right] \frac{1}{2} \sum_{n = 1}^{N_b} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b}) +
$$ \frac{1}{3} \sum_{n = 1}^{N_a} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b} +
r_{3_a} F_{3_b}) + \\
&& \frac{1}{4} \sum_{n = 1}^{N_d} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b} +
r_{3_a} F_{3_b} + r_{4_a} F_{4_b}) +
\frac{1}{4} \sum_{n = 1}^{N_i} (r_{1_a} F_{1_b} + r_{2_a} F_{2_b} +
r_{3_a} F_{3_b} + r_{4_a} F_{4_b}) \right]
\end{eqnarray*}
\end{document} \end{document}

View File

@ -318,12 +318,12 @@ of each style or click on the style itself for a full description:
</P> </P>
<DIV ALIGN=center><TABLE BORDER=1 > <DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "fix_addforce.html">addforce</A></TD><TD ><A HREF = "fix_aveforce.html">aveforce</A></TD><TD ><A HREF = "fix_ave_atom.html">ave/atom</A></TD><TD ><A HREF = "fix_ave_spatial.html">ave/spatial</A></TD><TD ><A HREF = "fix_ave_time.html">ave/time</A></TD><TD ><A HREF = "fix_com.html">com</A></TD><TD ><A HREF = "fix_deform.html">deform</A></TD><TD ><A HREF = "fix_deposit.html">deposit</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "fix_addforce.html">addforce</A></TD><TD ><A HREF = "fix_aveforce.html">aveforce</A></TD><TD ><A HREF = "fix_ave_atom.html">ave/atom</A></TD><TD ><A HREF = "fix_ave_spatial.html">ave/spatial</A></TD><TD ><A HREF = "fix_ave_time.html">ave/time</A></TD><TD ><A HREF = "fix_com.html">com</A></TD><TD ><A HREF = "fix_deform.html">deform</A></TD><TD ><A HREF = "fix_deposit.html">deposit</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_drag.html">drag</A></TD><TD ><A HREF = "fix_dt_reset.html">dt/reset</A></TD><TD ><A HREF = "fix_efield.html">efield</A></TD><TD ><A HREF = "fix_enforce2d.html">enforce2d</A></TD><TD ><A HREF = "fix_freeze.html">freeze</A></TD><TD ><A HREF = "fix_gran_diag.html">gran/diag</A></TD><TD ><A HREF = "fix_gravity.html">gravity</A></TD><TD ><A HREF = "fix_gyration.html">gyration</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "fix_drag.html">drag</A></TD><TD ><A HREF = "fix_dt_reset.html">dt/reset</A></TD><TD ><A HREF = "fix_efield.html">efield</A></TD><TD ><A HREF = "fix_enforce2d.html">enforce2d</A></TD><TD ><A HREF = "fix_freeze.html">freeze</A></TD><TD ><A HREF = "fix_gravity.html">gravity</A></TD><TD ><A HREF = "fix_gyration.html">gyration</A></TD><TD ><A HREF = "fix_heat.html">heat</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_heat.html">heat</A></TD><TD ><A HREF = "fix_indent.html">indent</A></TD><TD ><A HREF = "fix_langevin.html">langevin</A></TD><TD ><A HREF = "fix_lineforce.html">lineforce</A></TD><TD ><A HREF = "fix_msd.html">msd</A></TD><TD ><A HREF = "fix_momentum.html">momentum</A></TD><TD ><A HREF = "fix_nph.html">nph</A></TD><TD ><A HREF = "fix_npt.html">npt</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "fix_indent.html">indent</A></TD><TD ><A HREF = "fix_langevin.html">langevin</A></TD><TD ><A HREF = "fix_lineforce.html">lineforce</A></TD><TD ><A HREF = "fix_msd.html">msd</A></TD><TD ><A HREF = "fix_momentum.html">momentum</A></TD><TD ><A HREF = "fix_nph.html">nph</A></TD><TD ><A HREF = "fix_npt.html">npt</A></TD><TD ><A HREF = "fix_npt_asphere.html">npt/asphere</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_npt_asphere.html">npt/asphere</A></TD><TD ><A HREF = "fix_nve.html">nve</A></TD><TD ><A HREF = "fix_nve_asphere.html">nve/asphere</A></TD><TD ><A HREF = "fix_nve_dipole.html">nve/dipole</A></TD><TD ><A HREF = "fix_nve_gran.html">nve/gran</A></TD><TD ><A HREF = "fix_nve_limit.html">nve/limit</A></TD><TD ><A HREF = "fix_nve_noforce.html">nve/noforce</A></TD><TD ><A HREF = "fix_nvt.html">nvt</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "fix_nve.html">nve</A></TD><TD ><A HREF = "fix_nve_asphere.html">nve/asphere</A></TD><TD ><A HREF = "fix_nve_dipole.html">nve/dipole</A></TD><TD ><A HREF = "fix_nve_gran.html">nve/gran</A></TD><TD ><A HREF = "fix_nve_limit.html">nve/limit</A></TD><TD ><A HREF = "fix_nve_noforce.html">nve/noforce</A></TD><TD ><A HREF = "fix_nvt.html">nvt</A></TD><TD ><A HREF = "fix_nvt_asphere.html">nvt/asphere</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_nvt_asphere.html">nvt/asphere</A></TD><TD ><A HREF = "fix_nvt_sllod.html">nvt/sllod</A></TD><TD ><A HREF = "fix_orient_fcc.html">orient/fcc</A></TD><TD ><A HREF = "fix_planeforce.html">planeforce</A></TD><TD ><A HREF = "fix_poems.html">poems</A></TD><TD ><A HREF = "fix_pour.html">pour</A></TD><TD ><A HREF = "fix_print.html">print</A></TD><TD ><A HREF = "fix_rdf.html">rdf</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "fix_nvt_sllod.html">nvt/sllod</A></TD><TD ><A HREF = "fix_orient_fcc.html">orient/fcc</A></TD><TD ><A HREF = "fix_planeforce.html">planeforce</A></TD><TD ><A HREF = "fix_poems.html">poems</A></TD><TD ><A HREF = "fix_pour.html">pour</A></TD><TD ><A HREF = "fix_print.html">print</A></TD><TD ><A HREF = "fix_rdf.html">rdf</A></TD><TD ><A HREF = "fix_recenter.html">recenter</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_recenter.html">recenter</A></TD><TD ><A HREF = "fix_rigid.html">rigid</A></TD><TD ><A HREF = "fix_setforce.html">setforce</A></TD><TD ><A HREF = "fix_shake.html">shake</A></TD><TD ><A HREF = "fix_spring.html">spring</A></TD><TD ><A HREF = "fix_spring_rg.html">spring/rg</A></TD><TD ><A HREF = "fix_spring_self.html">spring/self</A></TD><TD ><A HREF = "fix_temp_rescale.html">temp/rescale</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "fix_rigid.html">rigid</A></TD><TD ><A HREF = "fix_setforce.html">setforce</A></TD><TD ><A HREF = "fix_shake.html">shake</A></TD><TD ><A HREF = "fix_spring.html">spring</A></TD><TD ><A HREF = "fix_spring_rg.html">spring/rg</A></TD><TD ><A HREF = "fix_spring_self.html">spring/self</A></TD><TD ><A HREF = "fix_temp_rescale.html">temp/rescale</A></TD><TD ><A HREF = "fix_tmd.html">tmd</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "fix_tmd.html">tmd</A></TD><TD ><A HREF = "fix_viscosity.html">viscosity</A></TD><TD ><A HREF = "fix_viscous.html">viscous</A></TD><TD ><A HREF = "fix_wall_gran.html">wall/gran</A></TD><TD ><A HREF = "fix_wall_lj126.html">wall/lj126</A></TD><TD ><A HREF = "fix_wall_lj93.html">wall/lj93</A></TD><TD ><A HREF = "fix_wall_reflect.html">wall/reflect</A></TD><TD ><A HREF = "fix_wiggle.html">wiggle</A> <TR ALIGN="center"><TD ><A HREF = "fix_viscosity.html">viscosity</A></TD><TD ><A HREF = "fix_viscous.html">viscous</A></TD><TD ><A HREF = "fix_wall_gran.html">wall/gran</A></TD><TD ><A HREF = "fix_wall_lj126.html">wall/lj126</A></TD><TD ><A HREF = "fix_wall_lj93.html">wall/lj93</A></TD><TD ><A HREF = "fix_wall_reflect.html">wall/reflect</A></TD><TD ><A HREF = "fix_wiggle.html">wiggle</A>
</TD></TR></TABLE></DIV> </TD></TR></TABLE></DIV>
<HR> <HR>
@ -333,10 +333,10 @@ descriptions of each style or click on the style itself for a full
description: description:
</P> </P>
<DIV ALIGN=center><TABLE BORDER=1 > <DIV ALIGN=center><TABLE BORDER=1 >
<TR ALIGN="center"><TD ><A HREF = "compute_attribute_atom.html">attribute/atom</A></TD><TD ><A HREF = "compute_centro_atom.html">centro/atom</A></TD><TD ><A HREF = "compute_coord_atom.html">coord/atom</A></TD><TD ><A HREF = "compute_ebond_atom.html">ebond/atom</A></TD><TD ><A HREF = "compute_epair_atom.html">epair/atom</A></TD><TD ><A HREF = "compute_ke_atom.html">ke/atom</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "compute_attribute_atom.html">attribute/atom</A></TD><TD ><A HREF = "compute_centro_atom.html">centro/atom</A></TD><TD ><A HREF = "compute_coord_atom.html">coord/atom</A></TD><TD ><A HREF = "compute_ke_atom.html">ke/atom</A></TD><TD ><A HREF = "compute_pe.html">pe</A></TD><TD ><A HREF = "compute_pe_atom.html">pe/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_pe.html">pe</A></TD><TD ><A HREF = "compute_pressure.html">pressure</A></TD><TD ><A HREF = "compute_rotate_dipole.html">rotate/dipole</A></TD><TD ><A HREF = "compute_rotate_gran.html">rotate/gran</A></TD><TD ><A HREF = "compute_stress_atom.html">stress/atom</A></TD><TD ><A HREF = "compute_sum.html">sum</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "compute_pressure.html">pressure</A></TD><TD ><A HREF = "compute_rotate_dipole.html">rotate/dipole</A></TD><TD ><A HREF = "compute_rotate_gran.html">rotate/gran</A></TD><TD ><A HREF = "compute_stress_atom.html">stress/atom</A></TD><TD ><A HREF = "compute_sum.html">sum</A></TD><TD ><A HREF = "compute_sum_atom.html">sum/atom</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_sum_atom.html">sum/atom</A></TD><TD ><A HREF = "compute_temp.html">temp</A></TD><TD ><A HREF = "compute_temp_asphere.html">temp/asphere</A></TD><TD ><A HREF = "compute_temp_deform.html">temp/deform</A></TD><TD ><A HREF = "compute_temp_dipole.html">temp/dipole</A></TD><TD ><A HREF = "compute_temp_partial.html">temp/partial</A></TD></TR> <TR ALIGN="center"><TD ><A HREF = "compute_temp.html">temp</A></TD><TD ><A HREF = "compute_temp_asphere.html">temp/asphere</A></TD><TD ><A HREF = "compute_temp_deform.html">temp/deform</A></TD><TD ><A HREF = "compute_temp_dipole.html">temp/dipole</A></TD><TD ><A HREF = "compute_temp_partial.html">temp/partial</A></TD><TD ><A HREF = "compute_temp_ramp.html">temp/ramp</A></TD></TR>
<TR ALIGN="center"><TD ><A HREF = "compute_temp_ramp.html">temp/ramp</A></TD><TD ><A HREF = "compute_temp_region.html">temp/region</A></TD><TD ><A HREF = "compute_variable.html">variable</A></TD><TD ><A HREF = "compute_variable_atom.html">variable/atom</A> <TR ALIGN="center"><TD ><A HREF = "compute_temp_region.html">temp/region</A></TD><TD ><A HREF = "compute_variable.html">variable</A></TD><TD ><A HREF = "compute_variable_atom.html">variable/atom</A>
</TD></TR></TABLE></DIV> </TD></TR></TABLE></DIV>
<P>These are compute styles contributed by users, which can be used if <P>These are compute styles contributed by users, which can be used if

View File

@ -93,10 +93,9 @@ defined in LAMMPS:
<UL><LI><A HREF = "compute_attribute_atom.html">attribute/atom</A> - attribute (x,v,f,etc) of each atom <UL><LI><A HREF = "compute_attribute_atom.html">attribute/atom</A> - attribute (x,v,f,etc) of each atom
<LI><A HREF = "compute_centro_atom.html">centro/atom</A> - centro-symmetry parameter for each atom <LI><A HREF = "compute_centro_atom.html">centro/atom</A> - centro-symmetry parameter for each atom
<LI><A HREF = "compute_coord_atom.html">coord/atom</A> - coordination number for each atom <LI><A HREF = "compute_coord_atom.html">coord/atom</A> - coordination number for each atom
<LI><A HREF = "compute_ebond_atom.html">ebond/atom</A> - bond energy for each atom
<LI><A HREF = "compute_epair_atom.html">epair/atom</A> - pairwise energy for each atom
<LI><A HREF = "compute_ke_atom.html">ke/atom</A> - kinetic energy for each atom <LI><A HREF = "compute_ke_atom.html">ke/atom</A> - kinetic energy for each atom
<LI><A HREF = "compute_pe.html">pe</A> - potential energy <LI><A HREF = "compute_pe.html">pe</A> - potential energy
<LI><A HREF = "compute_pe.html">pe</A> - potential energy for each atom
<LI><A HREF = "compute_pressure.html">pressure</A> - total pressure and pressure tensor <LI><A HREF = "compute_pressure.html">pressure</A> - total pressure and pressure tensor
<LI><A HREF = "compute_rotate_dipole.html">rotate/dipole</A> - rotational energy of dipolar atoms <LI><A HREF = "compute_rotate_dipole.html">rotate/dipole</A> - rotational energy of dipolar atoms
<LI><A HREF = "compute_rotate_gran.html">rotate/gran</A> - rotational energy of granular atoms <LI><A HREF = "compute_rotate_gran.html">rotate/gran</A> - rotational energy of granular atoms

View File

@ -23,14 +23,13 @@
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </P>
<PRE>compute 1 all pe <PRE>compute 1 all pe
compute molPE all bond angle dihedral improper compute molPE all pe bond angle dihedral improper
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>Define a computation that calculates the potential energy of the <P>Define a computation that calculates the potential energy of the
entire system of atoms. The specified group must be "all". See the entire system of atoms. The specified group must be "all". See the
<A HREF = "compute_epair_atom.html">compute epair/atom</A> and <A HREF = "compute_ebond_atom.html">compute <A HREF = "compute_pe_atom.html">compute pe/atom</A> command if you want per-atom
ebond/atom</A> commands if you want per-atom
energies. These per-atom values could be summed for a group of atoms energies. These per-atom values could be summed for a group of atoms
via the <A HREF = "compute_sum.html">compute sum</A> command. via the <A HREF = "compute_sum.html">compute sum</A> command.
</P> </P>
@ -57,7 +56,9 @@ LAMMPS starts up, as if this command were in the input script:
</P> </P>
<P><B>Restrictions:</B> none <P><B>Restrictions:</B> none
</P> </P>
<P><B>Related commands:</B> none <P><B>Related commands:</B>
</P>
<P><A HREF = "compute_pe_atom.html">compute pe/atom</A>
</P> </P>
<P><B>Default:</B> none <P><B>Default:</B> none
</P> </P>

View File

@ -20,14 +20,13 @@ keyword = {pair} or {bond} or {angle} or {dihedral} or {improper} or {kspace} :u
[Examples:] [Examples:]
compute 1 all pe compute 1 all pe
compute molPE all bond angle dihedral improper :pre compute molPE all pe bond angle dihedral improper :pre
[Description:] [Description:]
Define a computation that calculates the potential energy of the Define a computation that calculates the potential energy of the
entire system of atoms. The specified group must be "all". See the entire system of atoms. The specified group must be "all". See the
"compute epair/atom"_compute_epair_atom.html and "compute "compute pe/atom"_compute_pe_atom.html command if you want per-atom
ebond/atom"_compute_ebond_atom.html commands if you want per-atom
energies. These per-atom values could be summed for a group of atoms energies. These per-atom values could be summed for a group of atoms
via the "compute sum"_compute_sum.html command. via the "compute sum"_compute_sum.html command.
@ -54,6 +53,8 @@ See the "thermo_style" command for more details.
[Restrictions:] none [Restrictions:] none
[Related commands:] none [Related commands:]
"compute pe/atom"_compute_pe_atom.html
[Default:] none [Default:] none

View File

@ -13,15 +13,18 @@
</H3> </H3>
<P><B>Syntax:</B> <P><B>Syntax:</B>
</P> </P>
<PRE>compute ID group-ID pressure compute-ID <PRE>compute ID group-ID pressure temp-ID keyword ...
</PRE> </PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command <UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>pressure = style name of this compute command <LI>pressure = style name of this compute command
<LI>compute-ID = ID of compute that calculates temperature <LI>temp-ID = ID of compute that calculates temperature
<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>
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </P>
<PRE>compute 1 all pressure myTemp <PRE>compute 1 all pressure myTemp
compute 1 all pressure thermo_temp pair bond
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
@ -39,26 +42,35 @@ of atoms via the <A HREF = "compute_sum.html">compute sum</A> command.
below), Kb is the Boltzmann constant, T is the temperature, d is the below), Kb is the Boltzmann constant, T is the temperature, d is the
dimensionality of the system (2 or 3 for 2d/3d), V is the system dimensionality of the system (2 or 3 for 2d/3d), V is the system
volume (or area in 2d), and the second term is the virial, computed volume (or area in 2d), and the second term is the virial, computed
within LAMMPS for all pairwise as well as 2-body, 3-body, 4-body, and within LAMMPS for all pairwise as well as 2-body, 3-body, and 4-body,
long-range interactions. <A HREF = "fix.html">Fixes</A> that impose constraints and long-range interactions. <A HREF = "fix.html">Fixes</A> that impose constraints
(e.g. the <A HREF = "fix_shake.html">fix shake</A> command) also contribute to the (e.g. the <A HREF = "fix_shake.html">fix shake</A> command) also contribute to the
virial term. virial term.
</P> </P>
<P>A 6-component pressure tensor is also calculated by this compute which <P>A 6-component pressure tensor is also calculated by this compute whose
can be output by the <A HREF = "thermo_style.html">thermo_style custom</A> command. componenents can be output by the <A HREF = "thermo_style.html">thermo_style
The formula for the components of the tensor is the same as in above custom</A> command or accessed by other
formula, except that the first term uses the components of the kinetic <A HREF = "compute.html">compute</A> and <A HREF = "fix.html">fix</A> commands. The equation for
energy tensor (vx * vy instead of v^2 for temperature) and the second the components of the tensor is the same as in above formula, except
term uses Rx * Fy for the Wxy component of the virial tensor, etc. that the first term uses the components of the kinetic energy tensor
(vx * vy instead of v^2 for temperature) and the second term uses Rx *
Fy for the Wxy component of the virial tensor, etc.
</P>
<P>If no extra keywords are listed, the entire equation above is
calculated which includes a temperature term (or kinetic energy
tensor) and the virial as the sum of pair, bond, angle, dihedral,
improper, kspace (long-range), and fix contributions. If any extra
keywords are listed, then only those components are summed to compute
ke and/or the virial.
</P> </P>
<P>The temperature and kinetic energy tensor is not calculated by this <P>The temperature and kinetic energy tensor is not calculated by this
compute, but rather by the temperature compute specified as the last compute, but rather by the temperature compute specified with the
argument of the command. Normally this compute should calculate the command. Normally this compute should calculate the temperature of
temperature of all atoms for consistency with the virial term, but any all atoms for consistency with the virial term, but any compute style
compute style that calculates temperature can be used, e.g. one that that calculates temperature can be used, e.g. one that excludes frozen
excludes frozen atoms or other degrees of freedom. atoms or other degrees of freedom.
</P> </P>
<P>Note that the N is the above formula is really degrees-of-freedom/d <P>Note that the N is the above formula is really degrees-of-freedom
where the DOF is specified by the temperature compute. See the where the DOF is specified by the temperature compute. See the
various <A HREF = "compute.html">compute temperature</A> styles for details. various <A HREF = "compute.html">compute temperature</A> styles for details.
</P> </P>
@ -74,7 +86,9 @@ LAMMPS starts up, as if this command were in the input script:
</P> </P>
<P><B>Related commands:</B> <P><B>Related commands:</B>
</P> </P>
<P><A HREF = "compute_temp.html">compute temp</A>, <A HREF = "themo_style.html">thermo_style</A> <P><A HREF = "compute_temp.html">compute temp</A>, <A HREF = "compute_stress_atom.html">compute
stress/atom</A>,
<A HREF = "themo_style.html">thermo_style</A>,
</P> </P>
<P><B>Default:</B> none <P><B>Default:</B> none
</P> </P>

View File

@ -10,15 +10,18 @@ compute pressure command :h3
[Syntax:] [Syntax:]
compute ID group-ID pressure compute-ID :pre compute ID group-ID pressure temp-ID keyword ... :pre
ID, group-ID are documented in "compute"_compute.html command ID, group-ID are documented in "compute"_compute.html command
pressure = style name of this compute command pressure = style name of this compute command
compute-ID = ID of compute that calculates temperature :ul temp-ID = ID of compute that calculates temperature
zero or more keywords may be appended
keyword = {ke} or {pair} or {bond} or {angle} or {dihedral} or {improper} or {kspace} or {fix} :ul
[Examples:] [Examples:]
compute 1 all pressure myTemp :pre compute 1 all pressure myTemp
compute 1 all pressure thermo_temp pair bond :pre
[Description:] [Description:]
@ -36,26 +39,35 @@ where N is the number of atoms in the system (see discussion of DOF
below), Kb is the Boltzmann constant, T is the temperature, d is the below), Kb is the Boltzmann constant, T is the temperature, d is the
dimensionality of the system (2 or 3 for 2d/3d), V is the system dimensionality of the system (2 or 3 for 2d/3d), V is the system
volume (or area in 2d), and the second term is the virial, computed volume (or area in 2d), and the second term is the virial, computed
within LAMMPS for all pairwise as well as 2-body, 3-body, 4-body, and within LAMMPS for all pairwise as well as 2-body, 3-body, and 4-body,
long-range interactions. "Fixes"_fix.html that impose constraints and long-range interactions. "Fixes"_fix.html that impose constraints
(e.g. the "fix shake"_fix_shake.html command) also contribute to the (e.g. the "fix shake"_fix_shake.html command) also contribute to the
virial term. virial term.
A 6-component pressure tensor is also calculated by this compute which A 6-component pressure tensor is also calculated by this compute whose
can be output by the "thermo_style custom"_thermo_style.html command. componenents can be output by the "thermo_style
The formula for the components of the tensor is the same as in above custom"_thermo_style.html command or accessed by other
formula, except that the first term uses the components of the kinetic "compute"_compute.html and "fix"_fix.html commands. The equation for
energy tensor (vx * vy instead of v^2 for temperature) and the second the components of the tensor is the same as in above formula, except
term uses Rx * Fy for the Wxy component of the virial tensor, etc. that the first term uses the components of the kinetic energy tensor
(vx * vy instead of v^2 for temperature) and the second term uses Rx *
Fy for the Wxy component of the virial tensor, etc.
If no extra keywords are listed, the entire equation above is
calculated which includes a temperature term (or kinetic energy
tensor) and the virial as the sum of pair, bond, angle, dihedral,
improper, kspace (long-range), and fix contributions. If any extra
keywords are listed, then only those components are summed to compute
ke and/or the virial.
The temperature and kinetic energy tensor is not calculated by this The temperature and kinetic energy tensor is not calculated by this
compute, but rather by the temperature compute specified as the last compute, but rather by the temperature compute specified with the
argument of the command. Normally this compute should calculate the command. Normally this compute should calculate the temperature of
temperature of all atoms for consistency with the virial term, but any all atoms for consistency with the virial term, but any compute style
compute style that calculates temperature can be used, e.g. one that that calculates temperature can be used, e.g. one that excludes frozen
excludes frozen atoms or other degrees of freedom. atoms or other degrees of freedom.
Note that the N is the above formula is really degrees-of-freedom/d Note that the N is the above formula is really degrees-of-freedom
where the DOF is specified by the temperature compute. See the where the DOF is specified by the temperature compute. See the
various "compute temperature"_compute.html styles for details. various "compute temperature"_compute.html styles for details.
@ -71,6 +83,8 @@ where "thermo_temp" is the ID of a similarly defined compute of style
[Related commands:] [Related commands:]
"compute temp"_compute_temp.html, "thermo_style"_themo_style.html "compute temp"_compute_temp.html, "compute
stress/atom"_compute_stress_atom.html,
"thermo_style"_themo_style.html,
[Default:] none [Default:] none

View File

@ -13,97 +13,99 @@
</H3> </H3>
<P><B>Syntax:</B> <P><B>Syntax:</B>
</P> </P>
<PRE>compute ID group-ID stress/atom keyword value ... <PRE>compute ID group-ID stress/atom keyword ...
</PRE> </PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command <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>stress/atom = style name of this compute command <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>
<LI>zero or more keyword/arg pairs may be appended
<LI>keyword = <I>ke</I> or <I>pair</I> or <I>bond</I>
<PRE> <I>ke</I> arg = <I>yes</I> or <I>no</I>
yes/no = include/exclude kinetic energy contribution to stress
<I>pair</I> arg = <I>yes</I> or <I>no</I>
yes/no = include/exclude pairwise energy contribution to stress
<I>bond</I> arg = <I>yes</I> or <I>no</I>
yes/no = include/exclude bond energy contribution to stress
</PRE>
</UL> </UL>
<P><B>Examples:</B> <P><B>Examples:</B>
</P> </P>
<PRE>compute 1 mobile stress/atom <PRE>compute 1 mobile stress/atom
</PRE> </PRE>
<PRE>compute 1 all stress/atom ke no <PRE>compute 1 all stress/atom pair bond
</PRE> </PRE>
<P><B>Description:</B> <P><B>Description:</B>
</P> </P>
<P>Define a computation that computes the per-atom stress tensor for each <P>Define a computation that computes the symmetric per-atom stress
atom in a group. The tensor for each atom has 6 components: xx, yy, tensor for each atom in a group. The tensor for each atom has 6
zz, xy, xz, yz. The resulting values can be accessed by indices 1-6 components: xx, yy, zz, xy, xz, yz. See the <A HREF = "compute_pressure.html">compute
by any command that uses per-atom computes, e.g. the <A HREF = "dump.html">dump pressure</A> command if you want the stress tensor
(pressure) of the entire system. The 6 components can be accessed by
indices 1-6 by any command that uses per-atom computes, e.g. the <A HREF = "dump.html">dump
custom</A> command or <A HREF = "fix_ave_spatial.html">fix ave/spatial</A> custom</A> command or <A HREF = "fix_ave_spatial.html">fix ave/spatial</A>
command or <A HREF = "fix_ave_atom.html">fix ave/atom</A> command. command or <A HREF = "fix_ave_atom.html">fix ave/atom</A> command. See <A HREF = "Section_howto.html#4_15">this
section</A> for an overview.
</P> </P>
<P>The stress tensor for each atom is the sum of 3 terms in the following <P>The stress tensor for each atom is given by the following formula.
formula. Any of the terms can be excluded by setting the <I>ke</I>, where the ab component of stress on atom <I>I</I> is as shown where <I>a</I> and
<I>pair</I>, or <I>bond</I> keywords to <I>no</I>. The ab component of stress on <I>b</I> take on values x,y,z to generate the 6 components of the symmetric
atom <I>I</I> is as follows, where <I>a</I> and <I>b</I> take on values x,y,z to tensor:
generate the 6 components of the symmetric tensor:
</P> </P>
<CENTER><IMG SRC = "Eqs/stress_tensor.jpg"> <CENTER><IMG SRC = "Eqs/stress_tensor.jpg">
</CENTER> </CENTER>
<P>The first term is a kinetic energy contribution for atom <I>I</I>. The <P>The first term is a kinetic energy contribution for atom <I>I</I>. The
second term is a pairwise energy contribution where <I>J</I> loops over the second term is a pairwise energy contribution where <I>N</I> loops over the
<I>Np</I> neighbors of atom <I>I</I>, and <I>Fp</I> is one of 3 components of force <I>Np</I> neighbors of atom <I>I</I>, <I>r1</I> and <I>r2</I> are the positions of the 2
on atom <I>I</I> due to the pairwise interaction with atom <I>J</I>. The third atoms, and <I>F1</I> and <I>F2</I> are the forces on the 2 atoms. The third
term is a bond energy contribution where <I>J</I> loops over the <I>Nb</I> bonds term is a bond contribution for the <I>Nb</I> bonds whihc atom <I>I</I> is part
which atom <I>I</I> is part of, and <I>Fb</I> is one of 3 components of force on of. And similarly for the <I>Na</I> angle, <I>Nd</I> dihedral, and <I>Ni</I>
atom <I>I</I> due to the bonded interaction with atom <I>J</I>. improper interactions atom <I>I</I> is part of.
</P> </P>
<P>If two atoms interact, either pairwise or in a bond, and only one of <P>As the formula implies, a virial contribution produced by a small set
them is in the compute group, the interaction is included in the of atoms (e.g. 4 atoms in a dihedral or 3 atoms in a Tersoff 3-body
per-atom stress of the atom in the group. 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.
</P> </P>
<P>For force fields that include a contribution to the pairwise <P>If no extra keywords are listed, all of the terms in this formula are
interaction that is computed as part of dihedral terms (i.e. 1-4 included in the per-atom stress tensor. If any extra keywords are
interactions), this contribution is NOT included in the per-atom listed, only those terms are summed to compute the tensor.
pairwise stress.
</P> </P>
<P>IMPORTANT NOTE: The per-atom stress does NOT include contributions due <P>Note that the stress for each atom is due to its interaction with all
to angles, dihedrals, impropers that the atom is part of, or a other atoms in the simulation, not just with other atoms in the group.
long-range Coulombic contribution. Currently, there is no way in
LAMMPS to calculate per-atom stress from angles, dihedrals, improper,
or long-range interactions.
</P> </P>
<P>Note that as defined above, per-atom stress is the negative of the <P>The <A HREF = "dihedral_charmm.html">dihedral_style charmm</A> style calculates
per-atom pressure tensor. It is also really a stress-volume pairwise interactions between 1-4 atoms. The virial contribution of
these terms is included in the pair virial, not the dihedral virial.
</P>
<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. It would need to be divided by a per-atom volume to have formulation. It would need to be divided by a per-atom volume to have
units of stress, but an individual atom's volume is not easy to units of stress, but an individual atom's volume is not easy to
compute in a deformed solid. Thus, if you sum the diagonal components compute in a deformed solid or a liquid. Thus, if the diagonal
of the per-atom stress tensor for all atoms in the system and divide components of the per-atom stress tensor are summed for all atoms in
the sum by 3V, where V is the volume of the system, you should get -P, the system and the sum is divided by 3V, where V is the volume of the
where P is the total pressure of the system (assuming there is no system, the result should be -P, where P is the total pressure of the
angle, dihedral, improper, or long-range contribution to the total system.
pressure).
</P> </P>
<P>Computation of per-atom stress tensor components requires a loop thru <P>These lines in an input script should yield that result (assuming
the pairwise and bond neighbor lists and inter-processor there is no fix or long-range contribution to the stress):
communication, so it can be inefficient to compute/dump this quantity </P>
too frequently or to have multiple compute/dump commands, each of a <PRE>compute global all pressure thermo_temp
<I>stress/atom</I> style. compute peratom all stress/atom
compute p all sum peratom
variable p equal div(add(add(c_p<B>1</B>,c_p<B>2</B>),c_p<B>3</B>),mult(3.0,vol))
thermo_style custom step temp etotal c_global v_p
</PRE>
<P>IMPORTANT NOTE: The per-atom stress does NOT include contributions due
to fixes (e.g. <A HREF = "fix_shake.html">SHAKE</A>) or long-range Coulombic
interactions (via the <A HREF = "kspace_style.html">kspace_style</A> command). The
former needs to be added to LAMMPS. We're not sure if the latter is
possible to compute. There are also a few pair styles for manybody
potentials that are not yet instrumented to yield per-atom stress.
See the Restrictions below.
</P> </P>
<P><B>Restrictions:</B> <P><B>Restrictions:</B>
</P> </P>
<P>Some pair potentials do not allow the calculation of per-atom stress <P>These pair styles do not yet work with this compute: "airebo", "meam",
via this command. An error will be generated if this is the case. and "TIP4P".
</P> </P>
<P><B>Related commands:</B> none <P><B>Related commands:</B>
</P> </P>
<P><B>Default:</B> <P><A HREF = "compute_pe.html">compute pe</A>, <A HREF = "compute_stress_atom.html">compute
stress/atom</A>
</P> </P>
<P>The option defaults are ke = yes, pair = yes, bond = yes. <P><B>Default:</B> none
</P> </P>
</HTML> </HTML>

View File

@ -10,89 +10,96 @@ compute stress/atom command :h3
[Syntax:] [Syntax:]
compute ID group-ID stress/atom keyword value ... :pre compute ID group-ID stress/atom keyword ... :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l ID, group-ID are documented in "compute"_compute.html command
stress/atom = style name of this compute command :l stress/atom = style name of this compute command
zero or more keyword/arg pairs may be appended :l zero or more keywords may be appended
keyword = {ke} or {pair} or {bond} :l keyword = {ke} or {pair} or {bond} or {angle} or {dihedral} or {improper} :ul
{ke} arg = {yes} or {no}
yes/no = include/exclude kinetic energy contribution to stress
{pair} arg = {yes} or {no}
yes/no = include/exclude pairwise energy contribution to stress
{bond} arg = {yes} or {no}
yes/no = include/exclude bond energy contribution to stress :pre
:ule
[Examples:] [Examples:]
compute 1 mobile stress/atom :pre compute 1 mobile stress/atom :pre
compute 1 all stress/atom ke no :pre compute 1 all stress/atom pair bond :pre
[Description:] [Description:]
Define a computation that computes the per-atom stress tensor for each Define a computation that computes the symmetric per-atom stress
atom in a group. The tensor for each atom has 6 components: xx, yy, tensor for each atom in a group. The tensor for each atom has 6
zz, xy, xz, yz. The resulting values can be accessed by indices 1-6 components: xx, yy, zz, xy, xz, yz. See the "compute
by any command that uses per-atom computes, e.g. the "dump pressure"_compute_pressure.html command if you want the stress tensor
(pressure) of the entire system. The 6 components can be accessed by
indices 1-6 by any command that uses per-atom computes, e.g. the "dump
custom"_dump.html command or "fix ave/spatial"_fix_ave_spatial.html custom"_dump.html command or "fix ave/spatial"_fix_ave_spatial.html
command or "fix ave/atom"_fix_ave_atom.html command. command or "fix ave/atom"_fix_ave_atom.html command. See "this
section"_Section_howto.html#4_15 for an overview.
The stress tensor for each atom is the sum of 3 terms in the following The stress tensor for each atom is given by the following formula.
formula. Any of the terms can be excluded by setting the {ke}, where the ab component of stress on atom {I} is as shown where {a} and
{pair}, or {bond} keywords to {no}. The ab component of stress on {b} take on values x,y,z to generate the 6 components of the symmetric
atom {I} is as follows, where {a} and {b} take on values x,y,z to tensor:
generate the 6 components of the symmetric tensor:
:c,image(Eqs/stress_tensor.jpg) :c,image(Eqs/stress_tensor.jpg)
The first term is a kinetic energy contribution for atom {I}. The The first term is a kinetic energy contribution for atom {I}. The
second term is a pairwise energy contribution where {J} loops over the second term is a pairwise energy contribution where {N} loops over the
{Np} neighbors of atom {I}, and {Fp} is one of 3 components of force {Np} neighbors of atom {I}, {r1} and {r2} are the positions of the 2
on atom {I} due to the pairwise interaction with atom {J}. The third atoms, and {F1} and {F2} are the forces on the 2 atoms. The third
term is a bond energy contribution where {J} loops over the {Nb} bonds term is a bond contribution for the {Nb} bonds whihc atom {I} is part
which atom {I} is part of, and {Fb} is one of 3 components of force on of. And similarly for the {Na} angle, {Nd} dihedral, and {Ni}
atom {I} due to the bonded interaction with atom {J}. improper interactions atom {I} is part of.
If two atoms interact, either pairwise or in a bond, and only one of As the formula implies, a virial contribution produced by a small set
them is in the compute group, the interaction is included in the of atoms (e.g. 4 atoms in a dihedral or 3 atoms in a Tersoff 3-body
per-atom stress of the atom in the group. 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.
For force fields that include a contribution to the pairwise If no extra keywords are listed, all of the terms in this formula are
interaction that is computed as part of dihedral terms (i.e. 1-4 included in the per-atom stress tensor. If any extra keywords are
interactions), this contribution is NOT included in the per-atom listed, only those terms are summed to compute the tensor.
pairwise stress.
IMPORTANT NOTE: The per-atom stress does NOT include contributions due Note that the stress for each atom is due to its interaction with all
to angles, dihedrals, impropers that the atom is part of, or a other atoms in the simulation, not just with other atoms in the group.
long-range Coulombic contribution. Currently, there is no way in
LAMMPS to calculate per-atom stress from angles, dihedrals, improper,
or long-range interactions.
Note that as defined above, per-atom stress is the negative of the The "dihedral_style charmm"_dihedral_charmm.html style calculates
per-atom pressure tensor. It is also really a stress-volume pairwise interactions between 1-4 atoms. The virial contribution of
these terms is included in the pair virial, not the dihedral virial.
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. It would need to be divided by a per-atom volume to have formulation. It would need to be divided by a per-atom volume to have
units of stress, but an individual atom's volume is not easy to units of stress, but an individual atom's volume is not easy to
compute in a deformed solid. Thus, if you sum the diagonal components compute in a deformed solid or a liquid. Thus, if the diagonal
of the per-atom stress tensor for all atoms in the system and divide components of the per-atom stress tensor are summed for all atoms in
the sum by 3V, where V is the volume of the system, you should get -P, the system and the sum is divided by 3V, where V is the volume of the
where P is the total pressure of the system (assuming there is no system, the result should be -P, where P is the total pressure of the
angle, dihedral, improper, or long-range contribution to the total system.
pressure).
Computation of per-atom stress tensor components requires a loop thru These lines in an input script should yield that result (assuming
the pairwise and bond neighbor lists and inter-processor there is no fix or long-range contribution to the stress):
communication, so it can be inefficient to compute/dump this quantity
too frequently or to have multiple compute/dump commands, each of a compute global all pressure thermo_temp
{stress/atom} style. compute peratom all stress/atom
compute p all sum peratom
variable p equal div(add(add(c_p[1],c_p[2]),c_p[3]),mult(3.0,vol))
thermo_style custom step temp etotal c_global v_p :pre
IMPORTANT NOTE: The per-atom stress does NOT include contributions due
to fixes (e.g. "SHAKE"_fix_shake.html) or long-range Coulombic
interactions (via the "kspace_style"_kspace_style.html command). The
former needs to be added to LAMMPS. We're not sure if the latter is
possible to compute. There are also a few pair styles for manybody
potentials that are not yet instrumented to yield per-atom stress.
See the Restrictions below.
[Restrictions:] [Restrictions:]
Some pair potentials do not allow the calculation of per-atom stress These pair styles do not yet work with this compute: "airebo", "meam",
via this command. An error will be generated if this is the case. and "TIP4P".
[Related commands:] none [Related commands:]
[Default:] "compute pe"_compute_pe.html, "compute
stress/atom"_compute_stress_atom.html
The option defaults are ke = yes, pair = yes, bond = yes. [Default:] none

View File

@ -94,7 +94,6 @@ for individual fixes for info on which ones can be restarted.
<LI><A HREF = "fix_efield.html">efield</A> - impose electric field on system <LI><A HREF = "fix_efield.html">efield</A> - impose electric field on system
<LI><A HREF = "fix_enforce2d.html">enforce2d</A> - zero out z-dimension velocity and force <LI><A HREF = "fix_enforce2d.html">enforce2d</A> - zero out z-dimension velocity and force
<LI><A HREF = "fix_freeze.html">freeze</A> - freeze atoms in a granular simulation <LI><A HREF = "fix_freeze.html">freeze</A> - freeze atoms in a granular simulation
<LI><A HREF = "fix_gran_diag.html">gran/diag</A> - compute granular diagnostics
<LI><A HREF = "fix_gravity.html">gravity</A> - add gravity to atoms in a granular simulation <LI><A HREF = "fix_gravity.html">gravity</A> - add gravity to atoms in a granular simulation
<LI><A HREF = "fix_gyration.html">gyration</A> - compute radius of gyration <LI><A HREF = "fix_gyration.html">gyration</A> - compute radius of gyration
<LI><A HREF = "fix_heat.html">heat</A> - add/subtract momentum-conserving heat <LI><A HREF = "fix_heat.html">heat</A> - add/subtract momentum-conserving heat