Automatic detection of particle aggregation in particle code simulations of rock deformation