Select a subset of particles and sites by storing their respective indices. For optimization, all input lists of indices are assumed to be sorted.