I'm developing a PDE discretization algorithm that works on 3D uniform structured meshes. For this algorithm, I often have to traverse the mesh nodes and get the ids of all the faces and all the cells connected to the node. Another common operation is to traverse the cells and get the ids of their faces.
Because my grid is of the simplest type, I don't want to use a mesh generator. Instead, knowing that I have only these three operations (let's call them get_node_cells(node_id), get_node_faces(node_id), get_cell_faces(cell_id)), I would like to assume a consistent numbering system and work out explicit expressions for these. In 2D this is relatively easy to be done. I have simply sketched a simple example (5 cells x 5 cells) and figured out the general rule for these operations based on the number of cells in x and y direction. In 3D it gets complicated because you can barely visualize or sketch a simple example.
Has anyone faced a similar challenge and would be able to shed light on this problem? Maybe there's a mathematical "shortcut" to get these node and cell entities?