A unified treatment of steady-state shallow water and two-dimensional navier-stokes equations — finite element penalty function approach