fixed a small bug in mesh_class with regular grid generation