Alternating direction adaptive grid generation