GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • 1. Introduction
  • 2. Install LAMMPS
  • 3. Build LAMMPS
  • 4. Run LAMMPS
  • 5. Errors
  • 6. Commands
  • 7. Accelerate performance
  • 8. Optional packages
  • 9. Auxiliary tools
  • 10. Howto discussions
  • 11. Example scripts
  • 1. LAMMPS Library Interfaces
  • 2. Use Python with LAMMPS
  • 3. Modifying & extending LAMMPS

This view

  • Original page
  • New address

GeezerVison is showing docs.lammps.org — compute ke command — LAMMPS documentation

compute ke command

Accelerator Variants: ke/kk

Syntax

compute ID group-ID ke
  • ID, group-ID are documented in compute command

  • ke = style name of this compute command

Examples

compute 1 all ke

Description

Define a computation that calculates the translational kinetic energy of a group of particles.

The kinetic energy of each particle is computed as \(\frac{1}{2} m v^2\), where m and v are the mass and velocity of the particle, respectively.

There is a subtle difference between the quantity calculated by this compute and the kinetic energy calculated by the ke or etotal keyword used in thermodynamic output, as specified by the thermo_style command. For this compute, kinetic energy is “translational” kinetic energy, calculated by the simple formula above. For thermodynamic output, the ke keyword infers kinetic energy from the temperature of the system with \(\frac{1}{2} k_B T\) of energy for each degree of freedom. For the default temperature computation via the compute temp command, these are the same. However, different computes that calculate temperature can subtract out different non-thermal components of velocity and/or include different degrees of freedom (translational, rotational, etc.).

Output info

This compute calculates a global scalar (the summed KE). This value can be used by any command that uses a global scalar value from a compute as input. See the Howto output doc page for an overview of LAMMPS output options.

The scalar value calculated by this compute is “extensive”. The scalar value will be in energy units.

Styles with a gpu, intel, kk, omp, or opt 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 on the Accelerator packages page. The accelerated styles take the same arguments and should produce the same results, except for round-off and precision issues.

These accelerated styles are part of the GPU, INTEL, KOKKOS, OPENMP, and OPT packages, respectively. They are only enabled if LAMMPS was built with those packages. See the Build package page for more info.

You can specify the accelerated styles explicitly in your input script by including their suffix, or you can use the -suffix command-line switch when you invoke LAMMPS, or you can use the suffix command in your input script.

See the Accelerator packages page for more instructions on how to use the accelerated styles effectively.

Restrictions

none

Related commands

compute erotate/sphere

Default

none

Version release
LAMMPS Branch:
develop
stable
release
Downloads:
PDF
Source
Git Info:
13Nov2026
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.