\(\renewcommand{\AA}{\text{Å}}\)

compute contact/atom command

Accelerator Variants: contact/atom/omp

Syntax

compute ID group-ID contact/atom group2-ID
  • ID, group-ID are documented in compute command

  • contact/atom = style name of this compute command

  • group2-ID = optional argument to restrict which atoms to consider for contacts (see below)

Examples

compute 1 all contact/atom
compute 1 all contact/atom mygroup

Description

Define a computation that calculates the number of contacts for each atom in a group.

The contact number is defined for finite-size spherical particles as the number of neighbor atoms which overlap the central particle, meaning that their distance of separation is less than or equal to the sum of the radii of the two particles.

The value of the contact number will be 0.0 for atoms not in the specified compute group.

The optional group2-ID argument allows to specify from which group atoms contribute to the coordination number. Default setting is group ‘all’.

Output info

This compute calculates a per-atom vector, whose values can be accessed by any command that uses per-atom values from a compute as input. See the Howto output page for an overview of LAMMPS output options.

The per-atom vector values will be a number \(\ge 0.0\), as explained above.


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

This compute is part of the GRANULAR package. It is only enabled if LAMMPS was built with that package. See the Build package page for more info.

This compute requires that atoms store a radius as defined by the atom_style sphere command.

Default

group2-ID = all