principles of grid generation