7.7. Experimental API
Warning
These functions are still under development and may be removed or changed without deprecation. Use with caution.
Periodic boundary condition utilities
- tile_pbc(pts, L, r=None)[source]
Periodic tiling of pts (N,2), with bookkeeping.
- Parameters:
- Returns:
An (M,2) array containing the tiled positions and an (M,) array containing indices mapping each tiled point back to its original index in 0..N-1.
- Return type:
Connectivity utilities
- rebuild_connection_matrix(N, connect)[source]
Build a symmetric sparse adjacency matrix from a cell-cell edge list.
- Parameters:
- Returns:
An (N,N) boolean adjacency matrix, symmetrized so that both
(i,j)and(j,i)are set for every input edge.- Return type:
- select_daughter_cluster(N, connect)[source]
Randomly pick one connected component (“daughter cluster”) from the connectivity graph.
- Parameters:
- Returns:
A tuple containing: an (N_sub,)
numpy.ndarrayof global indices for cells in the chosen cluster, the cluster sizeN_sub, and the (E_sub,2)numpy.ndarrayof edges re-indexed to local0..N_sub-1. If the graph has only one connected component, returns(None, N, connect)unchanged.- Return type:
- get_cluster_sizes(N, connect)[source]
Compute the sizes of all connected components in the connectivity graph.
- Parameters:
- Returns:
A tuple containing: an (n_components,)
numpy.ndarrayof component sizes, the number of connected components, and an (N,)numpy.ndarrayof component labels for each cell.- Return type: