GNS: A generalizable Graph Neural Network-based simulator for particulate and fluid modeling