A patchy dynamic programming scheme for a class of Hamilton-Jacobi-Bellman equations