mbuild_polybuild.aa_molecules.ion.MonatomicIon.particles_in_range

MonatomicIon.particles_in_range(compound, dmax, max_particles=20, particle_kdtree=None, particle_array=None)

Find particles within a specified range of another particle.

Parameters:
  • compound (mb.Compound) – Reference particle to find other particles in range of

  • dmax (float) – Maximum distance from ‘compound’ to look for Particles

  • max_particles (int, optional, default=20) – Maximum number of Particles to return

  • particle_kdtree (mb.PeriodicKDTree, optional) – KD-tree for looking up nearest neighbors. If not provided, a KD- tree will be generated from all Particles in self

  • particle_array (np.ndarray, shape=(n,), dtype=mb.Compound, optional) – Array of possible particles to consider for return. If not provided, this defaults to all Particles in self

Returns:

Particles in range of compound according to user-defined limits

Return type:

np.ndarray, shape=(n,), dtype=mb.Compound

See also

periodic_kdtree.PerioidicKDTree

mBuild implementation of kd-trees

scipy.spatial.kdtree

Further details on kd-trees