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 separationcontact/atom/gran= style name for mechanical contact evaluation based on contact forces and granular historyzero or more keyword/value pairs may be appended:
Keyword |
Values |
Description |
|---|---|---|
|
\(s \ge 0.0\) |
Additional skin distance added to particle contact threshold (default: 0.0) |
|
|
Whether to tally particle-wall contacts from active granular wall fixes (default: |
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 |
|---|---|---|
|
Geometric surface touch |
Spheres: \(r_{ij} \le r_i + r_j + s\) Superquadrics: Physical surface intersection |
|
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\)) |
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:
Primitive Walls: fix wall/gran … primitive (planar, cylindrical, conical)
Triangulated Mesh Walls: fix wall/gran … mesh (CAD surface meshes)
Signed Distance Function (SDF) Walls: fix wall/gran/sdf (Cartesian Eulerian distance fields)
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:
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:
dump custom via
c_IDcompute reduce (e.g., to compute the mean coordination number across the entire particle bed)
Variable evaluations (e.g.,
c_ID[1])
Restrictions#
Requires
atom_style sphereoratom_style superquadric.compute contact/atom/granrequires a granular pair style (pair_style gran) to be defined.For superquadric particles,
compute contact/atom/granrequires contact history tracking (such astangential history).For multisphere models (fix particletemplate/multisphere), each constituent sub-sphere is treated individually.
Default#
skin= 0.0wall= no