1
$\begingroup$

Given a 3D unstructured grid consisting of mixed types of shapes (hex, tet, ...), is there a method to know how many faces (including boundary faces) are contained in the grid?

$\endgroup$
  • 1
    $\begingroup$ Besides counting them? For instance, 3D tet mesh generators will return lists of faces. I'd be surprised if face information weren't returned, because it is useful for surface integration. $\endgroup$ – Geoff Oxberry Jun 23 '14 at 0:20
  • $\begingroup$ I think Shibli is asking about the number of all faces (boundary and interior). In my experience, mesh generators usually don't output this information. $\endgroup$ – Martin Vymazal Jun 23 '14 at 11:51
  • $\begingroup$ @MartinVymazal: Yes, I interpreted the question as calculating the total number of faces. TetGen, for instance, returns a list of faces as a list of 4-tuples of vertices. If only elements are returned, it is straightforward -- if tedious -- to decompose elements into faces. $\endgroup$ – Geoff Oxberry Jun 23 '14 at 17:04
  • $\begingroup$ Is the grid conforming? If that is true, and you have the number of boundary faces available, you can iterate over all grid cells, accumulating the total faces, add the number of boundary faces and divide by two (since each internal face is shared between exactly two cells, and you explicitly double-counted the boundary faces). $\endgroup$ – Patrick Sanan Jul 23 '14 at 15:43
1
$\begingroup$

You might be interested in Euler's characteristic, which relates the number of vertices, edges and faces in a planar graph, that you can also interpret as a 2D mesh. There is a similar relation for 3D meshes (see for example here (section about tetrahedral meshes) or here. The problem is that in 3 dimensions, this (single) formula relates the number of vertices, edges, faces and elements in your mesh. Most mesh generators give you immediately number of elements and vertices, but not the number of faces and edges, so you are left with one equation and two unknowns. I'm afraid there's no easier way than counting the edges or faces.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.