Voronoi Analysis

Dear Ovito members,

I am contacting you because I want to combine Python and Ovito to do Voronoi analysis on a configuration of 5000 polydisperse particles closed in a cubic simulation box with periodic boundary conditions. In particular, I would like to compute the Cavity Radius. However, I need help finding out how. At the moment, I am doing the following:

def assign_particle_radii(frame, data):
    atom_types = data.particles_.particle_types_
    atom_types.type_by_id_(1).radius = 0.42
    atom_types.type_by_id_(2).radius = 0.475
    atom_types.type_by_id_(3).radius = 0.50
    atom_types.type_by_id_(4).radius = 0.56

pipeline = import_file(input)
celldata = pipeline.compute()
pipeline.source.data.cell_.pbc = (True,True,True)
pipeline.modifiers.append(assign_particle_radii)

voro = VoronoiAnalysisModifier(
       compute_indices = True,
       use_radii = True,
       edge_threshold = 0.1,
       )
pipeline.modifiers.append(voro)

data = pipeline.compute()

voro_volume = data.particles['Atomic Volume']
voro_cavity = data.particles['Cavity Radius']

However, it seems that ‘Cavity Radius’ is not contained in data.particles. Could you indicate or provide me with information about what I should introduce in data.particles to compute the cavity radius?

Thank you so much in advance for your time.

Regards,
Jose

Are you using an OVITO version >= 3.7.9? The cavity radius calculation feature has been added to the Voronoi Analysis modifier in Sep 2022. https://www.ovito.org/docs/current/new_features.html#version-3-7-9-12-sep-2022

I am using OVITO version 3.7.12

I have reinstalled the version, and now I can do it.
To be sure, version 3.7.12 no longer introduces a factor of two in the cavity calculation, right?

Thank you very much for your help!

Yes, that’s correct. Changelog — OVITO User Manual 3.9.2 documentation

Hi all,

I want to do Voronoi Analysis for a single layer of atoms whose minimum distance is at least 5 angstrom. Currently, the code will give the Voronoi index as (0,0,0) for all atoms. I want to change the cutoff radius to 6, so that some of them are grouped as pairs, and some are grouped as triplets. Is there any way for me to change the cutoff radius?

Best,
Jinxing Gu

I’m not sure Voronoi Analysis is the right tool for that. Have you considered using the Cluster analysis modifier instead?
https://www.ovito.org/docs/current/reference/pipelines/modifiers/cluster_analysis.html