What do you consider "previous" and "next" cell in an unstructured mesh ?
For a 1-d mesh, you can use the mesh->i_face_cells (face -> cells adjacency array, see in Doxygen documentation) can help you access the adjacent cells. For more complex cases, tou can also access those cell's centers (in cs_glob_mesh_quantities->cell_cen) for additional tests/filtering.
Thanks admin.
My grid is structured then hence the solver is unstructured you mean i have to get the values of left hand side -. right hand side by the coordinates of the cell and the distance between centers? That will be reallly time consuming and inaccurate
You do not need the coordinates if the neighboring cells are sufficient. But they may help for example when you have 6 neighbors (in 3D) and need to know which is which. Because even if you grid is initially structured, it is internally handled as an unstructured grid.