https://insu.hal.science/insu-03644932Bleuler, AndreasAndreasBleulerTeyssier, RomainRomainTeyssierCarassou, SébastienSébastienCarassouIAP - Institut d'Astrophysique de Paris - INSU - CNRS - Institut national des sciences de l'Univers - SU - Sorbonne Université - CNRS - Centre National de la Recherche ScientifiqueMartizzi, DavideDavideMartizziPHEW: a parallel segmentation algorithm for three-dimensional AMR datasets. Application to structure detection in self-gravitating flowsHAL CCSD2015Astrophysics - Instrumentation and Methods for AstrophysicsAstrophysics - Cosmology and Nongalactic Astrophysics[SDU] Sciences of the Universe [physics]Sorbonne Université, Gestionnaire HAL 42022-04-27 14:52:242023-05-01 03:58:062022-04-27 14:52:25enJournal articleshttps://insu.hal.science/insu-03644932/document10.1186/s40668-015-0009-7application/pdf1We introduce phew ( Parallel Hi Erarchical Watershed), a new segmentation algorithm to detect structures in astrophysical fluid simulations, and its implementation into the adaptive mesh refinement (AMR) code ramses. phew works on the density field defined on the adaptive mesh, and can thus be used on the gas density or the dark matter density after a projection of the particles onto the grid. The algorithm is based on a `watershed' segmentation of the computational volume into dense regions, followed by a merging of the segmented patches based on the saddle point topology of the density field. phew is capable of automatically detecting connected regions above the adopted density threshold, as well as the entire set of substructures within. Our algorithm is fully parallel and uses the MPI library. We describe in great detail the parallel algorithm and perform a scaling experiment which proves the capability of phew to run efficiently on massively parallel systems. Future work will add a particle unbinding procedure and the calculation of halo properties onto our segmentation algorithm, thus expanding the scope of phew to genuine halo finding.