Robust and efficient solution of the 2D shallow water equation with domains containing dry beds