site_analysis.dynamic_voronoi_site_collection

Collection manager for dynamic Voronoi sites in crystal structures.

This module provides the DynamicVoronoiSiteCollection class, which manages a collection of DynamicVoronoiSite objects and implements methods for assigning atoms to these sites based on their positions in a crystal structure.

The DynamicVoronoiSiteCollection extends the base SiteCollection class with specific functionality for dynamic Voronoi sites, including:

  1. Calculating the dynamic centres of sites based on reference atom positions

  2. Assigning atoms to sites using Voronoi tessellation principles

For atom assignment, the collection:

  1. First updates each site’s centre by calculating the mean position of its reference atoms, with special handling for periodic boundary conditions

  2. Calculates distances from each (dynamically determined) site centre to each atom

  3. Assigns each atom to the site with the nearest centre

  4. Uses minimum-image convention distances to correctly handle periodic boundaries

This collection is particularly useful for tracking sites in frameworks that deform during simulation, as the site centres adapt to the changing positions of the reference atoms.

class DynamicVoronoiSiteCollection(sites: list[Site])[source]

Bases: SiteCollection

A collection of DynamicVoronoiSite objects.

This collection manages a set of dynamic Voronoi sites and handles the assignment of atoms to sites based on their dynamically calculated centres.

sites

list of DynamicVoronoiSite objects.

Type:

list[DynamicVoronoiSite]

analyse_structure(atoms: list[Atom], structure: Structure) None[source]

Analyse a structure to assign atoms to sites.

Assigns coordinates to atoms, calculates site centres, and assigns atoms to the nearest site.

Parameters:
  • atoms – List of atoms to be assigned to sites.

  • structure – Pymatgen Structure containing atom positions.

assign_site_occupations(atoms: list[Atom], lattice_matrix: ndarray) None[source]

Assign atoms to sites based on Voronoi tessellation.

Uses minimum-image convention distances to assign each atom to the nearest site centre.

Parameters:
  • atoms – List of atoms to be assigned to sites.

  • lattice_matrix – (3, 3) lattice matrix where rows are lattice vectors.

reset() None[source]

Reset all sites and batch PBC caches for a fresh analysis run.