compute contact/atom and contact/atom/gran#

Syntax#

compute ID group-ID contact/atom [keyword value ...]
compute ID group-ID contact/atom/gran [keyword value ...]
  • ID, group-ID are documented in compute command

  • contact/atom = style name for geometric contact evaluation based on surface separation

  • contact/atom/gran = style name for mechanical contact evaluation based on contact forces and granular history

  • zero or more keyword/value pairs may be appended:

Keyword

Values

Description

skin

\(s \ge 0.0\)

Additional skin distance added to particle contact threshold (default: 0.0)

wall

yes or no

Whether to tally particle-wall contacts from active granular wall fixes (default: no)

Examples#

# Standard particle-particle contact count for spheres or superquadrics
compute c_num all contact/atom

# Contact count based on active granular contact forces and history
compute c_gran all contact/atom/gran

# Include a skin threshold distance of 1 mm
compute c_skin all contact/atom skin 0.001

# Tally both particle-particle and particle-wall contacts
compute c_total all contact/atom/gran wall yes

# Output contact count in custom dump file
dump dmp all custom 500 post/dump.*.txt id type x y z c_total

Description#

These compute styles calculate the per-atom coordination number (number of contacts) for each atom in the specified group. Atoms outside the group receive a contact count of 0.0.

WASHLIGGGHTS provides extended contact evaluation capabilities including native non-spherical superquadric particle support and particle-wall contact counting.

Comparison of Compute Styles#

Style

Contact Condition

Underlying Formula / Criteria

compute contact/atom

Geometric surface touch

Spheres: \(r_{ij} \le r_i + r_j + s\) Superquadrics: Physical surface intersection

compute contact/atom/gran

Mechanical interaction force or bond

Spheres: \(r_{ij} \le r_i + r_j + s\) or contact history flag set (\(f_{ij} > 0\)) Superquadrics: Granular contact history state (\(\text{state} = 2\))

compute coord/atom

Proximity within cut-off radius

Center-to-center distance \(r_{ij} < r_{\text{cutoff}}\)

Superquadric Particle Support#

Both compute contact/atom and compute contact/atom/gran natively support non-spherical superquadric particles (gran surface superquadric model with atom_style superquadric).

For superquadrics, contacts are evaluated from the physical narrow-phase contact solver and stored in the granular contact history neighbor list:

  • Naive bounding-sphere methods produce large numbers of false positives when elongated or platy superquadrics have overlapping bounding spheres without actual surface touch.

  • WASHLIGGGHTS checks the physical contact state from the granular contact history (\(\text{state} = 2\)), ensuring that only particles whose physical superquadric surfaces actually intersect are counted.

Particle-Wall Contact Tallying (wall Keyword)#

By default (wall no), these computes only count particle-particle collisions. Specifying wall yes enables automatic tallying of active physical particle-wall contacts from all active granular wall fixes in the simulation:

When wall yes is active:

  • Spherical particles in contact with any wall surface increment their contact count by 1 per wall intersection.

  • Superquadric particles interacting with primitive, mesh, or SDF walls are evaluated against their exact oriented surfaces, correctly adding 1 per physical wall contact.

  • Multiple independent walls and mixed particle types are supported seamlessly.

Skin Parameter (skin Keyword)#

The optional skin parameter specifies an extra distance \(s\) added to the contact detection threshold:

\[r_{ij} \le r_i + r_j + s\]

This is useful for detecting near-contact neighbors or modeling cohesive influence shells around particles.

Output Info#

This compute calculates a per-atom vector whose values represent the total number of contacts for each particle. The values are non-negative floating-point numbers (\(\ge 0.0\)).

The per-atom values can be accessed by any command that consumes per-atom data:

Restrictions#

  • Requires atom_style sphere or atom_style superquadric.

  • compute contact/atom/gran requires a granular pair style (pair_style gran) to be defined.

  • For superquadric particles, compute contact/atom/gran requires contact history tracking (such as tangential history).

  • For multisphere models (fix particletemplate/multisphere), each constituent sub-sphere is treated individually.

Default#

  • skin = 0.0

  • wall = no