# Computing node, cell and face incidence in 3D structured meshes

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 24, 2020, 07:30 Computing node, cell and face incidence in 3D structured meshes #1 New Member   Rafael March Join Date: Mar 2020 Posts: 5 Rep Power: 6 I'm developing a PDE discretization algorithm for fluid flow in porous media 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? Thanks!

March 24, 2020, 12:01
#2
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
Quote:
 Originally Posted by rafaelmarch3 I'm developing a PDE discretization algorithm for fluid flow in porous media 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? Thanks!

I think that the topology on uniform cartesian grid is very simple, you just assume that one of the i,j,k integers represent a spatial position x(i),y(j),z(k). To each position you can associate the faces face_x(i,j,k), face_y(i,j,k), face_z(i,j,k), for example using the notation that are staggered backward. A generic non-nodal position can be located into the volume built by the faces face_x(i,j,k),face_x(i+1,j,k),face_y(i,j,k),face_y (i,j+1,k),face_z(i,j,k),face_z(i,j,k+1)

 April 1, 2020, 10:38 #3 Senior Member     Paolo Lampitella Join Date: Mar 2009 Location: Italy Posts: 2,152 Blog Entries: 29 Rep Power: 39 As mentioned by Filippo, they are just staggered, nothing really fancy, unless you stored them in some non obvious way for a fully structured grid. However, let me add that, today, if it actually still makes sense to use structured grids, is because they allow to avoid storing stuff here and there, because you can easily calculate them. That is, if you need something on a node, you should be able to compute it on the fly, exactly because you know exactly where the node is with respect to its neighbors.

 Tags finite volume method, mesh and grid, structured mesh.