<HTML>
<CENTER><A HREF = "https://sparta.github.io">SPARTA WWW Site</A> - <A HREF = "Manual.html">SPARTA Documentation</A> - <A HREF = "Section_commands.html#comm">SPARTA Commands</A> 
</CENTER>






<HR>

<H3>compute ke/particle command 
</H3>
<H3>compute ke/particle/kk command 
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID ke/particle 
</PRE>
<UL><LI>ID is documented in <A HREF = "compute.html">compute</A> command
<LI>ke/particle = style name of this compute command 
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 ke/particle 
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the per-atom translational
kinetic energy for each particle.
</P>
<P>The results of this compute can be used by different commands in
different ways.  The values for a single timestep can be output by the
<A HREF = "dump.html">dump particle</A> command.
</P>
<P>The kinetic energy is
</P>
<PRE>Vsq = Vx*Vx + Vy*Vy + Vz*Vz
KE = 1/2 m Vsq 
</PRE>
<P>where m is the mass and (Vx,Vy,Vz) are the velocity components of the
particle.
</P>
<P><B>Output info:</B>
</P>
<P>This compute calculates a per-particle vector, which can be accessed
by any command that uses per-particle values from a compute as input.
</P>
<P>The vector can be accessed by any command that uses per-particle
values from a compute as input.  See <A HREF = "Section_howto.html#howto_4">Section
4.4</A> for an overview of SPARTA output
options.
</P>
<P>The per-particle vector values will be in energy <A HREF = "units.html">units</A>.
</P>
<HR>

<P>Styles with a <I>kk</I> suffix are functionally the same as the
corresponding style without the suffix.  They have been optimized to
run faster, depending on your available hardware, as discussed in the
<A HREF = "Section_accelerate.html">Accelerating SPARTA</A> section of the manual.
The accelerated styles take the same arguments and should produce the
same results, except for different random number, round-off and
precision issues.
</P>
<P>These accelerated styles are part of the KOKKOS package. They are only
enabled if SPARTA was built with that package.  See the <A HREF = "Section_start.html#start_3">Making
SPARTA</A> section for more info.
</P>
<P>You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the <A HREF = "Section_start.html#start_7">-suffix command-line
switch</A> when you invoke SPARTA, or you can
use the <A HREF = "suffix.html">suffix</A> command in your input script.
</P>
<P>See the <A HREF = "Section_accelerate.html">Accelerating SPARTA</A> section of the
manual for more instructions on how to use the accelerated styles
effectively.
</P>
<HR>

<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "dump.html">dump particle</A>
</P>
<P><B>Default:</B> none
</P>
</HTML>
