Comparing analytical and numerical solution of nonlinear two and three-dimensional hydrostatic flows