Separated the rigid-body and atomic versions of periodic_mindist.