Trees | Indices | Help |
|
---|
|
object --+ | SpatialHash
SpatialHash provides an interface for efficient spatial queries on particle positions.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
Construct from particle positions. If ids are provided, they should be a numpy array of type uint32 and specify which rows of the Nx3 pos array are to be hashed. If box is provided, it must be a 3x3 array of doubles, and the search will be performed using periodic boundary conditions.
|
Perform voxelization such that findWithin queries with reuse_voxels=True at a radius equal to or less than the given radius can be performed accurately. For queries at radius less than the voxelization, it may be worthwhile to revoxelize at a smaller radius. Note that, by default, findWithin calls voxelize with the query radius as argument, so it is not strictly necessary ever to use this method. |
Find particles from pos which are within the given radius of some particle in the spatial hash (i.e. provided in the SpatialHash constructor). By default, voxelization is performed at the same resolution as the query radius, but this can be overridden by calling voxelize() manually, then calling findWithin() with reuse_voxels=True. pos is expected to be an Nx3 array of floats. The ids parameter defaults to arange(len(pos)); supply an array of ids to limit the search to a subset of rows in pos. |
Find at most k particles from pos with the smallest minimum distance to some particle in the spatial hash. If ids is not provided, it defaults to arange(len(pos)). |
Find pairs of particles within radius of each other. Args: radius (float): search radius pos (array[float]): positions ids (array[uint]): particle indices Returns: i, j, dists (tuple): Mx1 arrays of ids and distances. The first array corresponds to ids in the call to findContacts; the second column to the ids passed to the SpatialHash constructor. IMPORTANT: pairs with the same id in the constructor and the call the findContacts are excluded from the output set. Therefore, the positions passsed to findContacts should correspond to the same atom indices as the positions passed to the SpatialHash constructor. |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue May 2 06:33:08 2017 | http://epydoc.sourceforge.net |