AlloyViewDocumentation
GitHub

Common neighbor analysis

Controls

Choose adaptive CNA or a fixed cutoff. The result classifies atoms as FCC, HCP, BCC, ICO or Other. Crystal legend checkboxes control display visibility; they do not change the classification calculation.

Algorithm

CNA builds a local bond graph around each atom. Each center-neighbor pair receives a signature consisting of the common-neighbor count, number of bonds among those neighbors, and longest connected bond-chain size.

StructureRequired local signatures
FCCTwelve 421 pairs
HCPSix 421 and six 422 pairs
BCCEight 666 and six 444 pairs
ICOTwelve 555 pairs

Fixed CNA requires exactly 12 or 14 neighbors inside the supplied cutoff. Adaptive CNA first tests the closest 12 atoms with cutoff mean(r₁…r₁₂) × (1 + √2)/2, then tests the 14-neighbor BCC environment with a shell-dependent scale. Neighbor-neighbor bonds use local displacement vectors without a second periodic wrapping step.

Other includes defective, surface, disordered or unsupported environments. CNA describes local geometry; it does not identify chemical ordering or uniquely determine crystal orientation.

Conventional CNA does not identify cubic or hexagonal diamond. Diamond nearest neighbors have no common neighbors, so the standard CNA signatures above cannot classify them. Use PTM with Diamond or Hex. diamond enabled; these templates are off by default. A separate diamond-identification algorithm can instead analyze neighbors of neighbors. See the OVITO diamond-identification explanation.

GPU acceleration

With Enable GPU acceleration on, both adaptive and fixed-cutoff CNA can run through WebGPU. The chosen shell convention, crystal labels, colors and visibility controls are the same as on CPU. GPU acceleration is on by default; unavailable or unsupported GPU execution falls back to the CPU Worker implementation. Switching the preference preserves completed results; click Identify structure again to calculate with the new preference.

The GPU traverses linked-cell neighbors, keeps distinct periodic images and builds each atom's local common-neighbor graph. Fixed mode uses the supplied cutoff. Adaptive mode expands the search radius until its nearest-neighbor shell is complete, then evaluates the same twelve- and fourteen-neighbor shell formulas described above. Shell selection and graph classification run on the GPU; this includes adaptive CNA.

Near a floating-point boundary, a cutoff, shell membership or neighbor-neighbor bond can be ambiguous. Those individual environments receive an exact CPU correction so the discrete crystal labels retain the CPU convention. This correction is bounded to 16,384 atoms. The GPU search also limits each atom to 50,000 image candidates and adaptive search to 24 radius attempts. Exceeding these limits, the geometry limits or available device memory uses the complete CPU calculation instead of returning an approximate classification. See performance for shared input caching and timing considerations.

Implementation

CNA signatures and adaptive shells, periodic neighbor search, GPU CNA, CNA compute shaders. The analysis implementation guide contains the full shell formulas and references.