A geometric computing method for nonlinear optimal regulator problems with singular arcs