porereax.density

Module for sampling atomic and bond densities.

The module provides: 1. DensitySampler: A class to sample atomic densities of specified atom structures. 2. BondDensitySampler: A class to sample bond densities of specified bonds. Both samplers support multiple dimensions for density sampling: - “Cartesian1D”: Samples the density histogram along a specified Cartesian direction for the whole simulation box. - “Cartesian2D”: Samples the density histogram in a specified plane for the whole simulation box. - “Time”: Samples the number of atoms (with given bonds) or bonds per frame

Classes

DensitySampler

Sampler class for atomic densities.

BondDensitySampler

Sampler class for bond densities.

ReactionSampler

Sampler class for reactions.

Module Contents

class porereax.density.DensitySampler(name_out: str, atoms: list, dimension: str, region, process_id: int, atom_lib: dict, masses: dict, num_frames: int, box: numpy.ndarray, system_properties: dict, num_bins: int, direction: str, conditions: dict = {})[source]

Bases: porereax.meta_sampler.AtomSampler

Sampler class for atomic densities.

sample(frame_id: int, mol_index: dict, mol_bonds: dict, bond_mask: dict, frame: object, bond_enum: object, positions_transformed: numpy.ndarray)[source]

Sample data for the current frame. Must be implemented by subclasses.

join_samplers(num_cores)[source]

Join data from multiple samplers after parallel processing.

Parameters:

num_cores (int) – Number of parallel processes used.

class porereax.density.BondDensitySampler(name_out: str, bonds: list, dimension: str, region, process_id: int, atom_lib: dict, masses: dict, num_frames: int, box: numpy.ndarray, system_properties: dict, num_bins: int, direction: str, conditions: dict = {})[source]

Bases: porereax.meta_sampler.BondSampler

Sampler class for bond densities.

sample(frame_id: int, mol_index: dict, mol_bonds: dict, bond_mask: dict, frame: object, bond_enum: object, positions_transformed: numpy.ndarray)[source]

Sample data for the current frame. Must be implemented by subclasses.

join_samplers(num_cores: int) None[source]

Join data from multiple samplers after parallel processing.

Parameters:

num_cores (int) – Number of parallel processes used.

class porereax.density.ReactionSampler(name_out: str, reactions: list, dimension: str, region, process_id: int, atom_lib: dict, masses: dict, num_frames: int, box: numpy.ndarray, system_properties: dict, num_bins: int, direction: str, position: str)[source]

Bases: porereax.meta_sampler.AtomSampler

Sampler class for reactions.

sample(frame_id: int, mol_index: dict, mol_bonds: dict, bond_mask: dict, frame: object, bond_enum: object, positions_transformed: numpy.ndarray)[source]

Sample data for the current frame. Must be implemented by subclasses.

join_samplers(num_cores: int) None[source]

Join data from multiple samplers after parallel processing.

Parameters:

num_cores (int) – Number of parallel processes used.