hpmc.compute

Overview

FreeVolume

Compute the free volume available to a test particle.

Details

Compute properties of hard particle configurations.

class hoomd.hpmc.compute.FreeVolume(test_particle_type, num_samples)

Compute the free volume available to a test particle.

Parameters
  • test_particle_type (str) – Test particle type.

  • num_samples (int) – Number of samples to evaluate.

FreeVolume computes the free volume in the simulation state available to a given test particle using Monte Carlo integration. It must be used in combination with an HPMC integrator, which defines the particle shape parameters.

FreeVolume generates num_samples uniform random test particle placements (position and orientation) inside the box and counts the number of times these test placements overlap with the particles in the simulation state. It then computes the free volume with:

\[V_\mathrm{free} = \left( \frac{n_\mathrm{samples} - n_\mathrm{overlaps}} {n_\mathrm{samples}} \right) V_\mathrm{box}\]

where \(V_\mathrm{free}\) is the estimated free volume free_volume, \(n_\mathrm{samples}\) is the number of samples num_samples, \(n_\mathrm{overlaps}\) is the number of overlapping test placements, and \(V_\mathrm{box}\) is the volume of the simulation box.

Note

The test particle type must exist in the simulation state and its shape parameters must be set in the simulation’s HPMC integrator. Particles with this type may or may not be present in the simulation state.

Note

FreeVolume respects the interaction_matrix set in the HPMC integrator.

Examples:

fv = hoomd.hpmc.compute.FreeVolume(test_particle_type='B',
                                   num_samples=1000)
test_particle_type

Test particle type.

Type

str

num_samples

Number of samples to evaluate.

Type

int

property free_volume

Free volume available to the test particle.

(Loggable: category=”scalar”)