Integrating code for uniform and non-uniform grids