site_analysis.voronoi_site_collection
Collection manager for Voronoi sites in crystal structures.
This module provides the VoronoiSiteCollection class, which manages a collection of VoronoiSite objects and implements methods for assigning atoms to these sites based on their positions in a crystal structure.
The VoronoiSiteCollection extends the base SiteCollection class with specific functionality for Voronoi sites, implementing a different assignment logic than other site collections:
For atom assignment, the collection:
Calculates distances from each site centre to each atom
Assigns each atom to the site with the nearest centre
Uses minimum-image convention distances to correctly handle periodic boundaries
Unlike other site types where individual sites can determine containment, Voronoi site assignment is a global operation that depends on the relative positions of all sites. This collection efficiently implements the Voronoi tessellation logic using distance calculations rather than explicit geometric construction of the Voronoi cells.
- class VoronoiSiteCollection(sites: list[Site])[source]
Bases:
SiteCollection- analyse_structure(atoms: list[Atom], structure: Structure) None[source]
Analyse a structure to assign atoms to Voronoi sites.
This method:
Assigns fractional coordinates to each atom based on the structure
Delegates to assign_site_occupations to determine which atoms belong in which sites based on Voronoi tessellation principles
- Parameters:
atoms – List of Atom objects to be assigned to sites
structure – Pymatgen Structure containing the atom positions
- Returns:
None
- assign_site_occupations(atoms: list[Atom], lattice_matrix: ndarray) None[source]
Assign atoms to Voronoi sites based on closest site centres.
Uses minimum-image convention distances to assign each atom to the nearest site centre.
- Parameters:
atoms – List of Atom objects to be assigned to sites.
lattice_matrix – (3, 3) lattice matrix where rows are lattice vectors.