0
$\begingroup$

The polyMesh format used in OpenFOAM is an intelligent format for which 'cells' file, i.e. the file giving list of nodes that make a cell, is not needed. The way to reconstruct geometry data such as cell centroids and cell volume is by using divergence theorem an therefore only face data is needed.

If the OpenFOAM is used, the post-processing tool Paraview knows how to build a geometry for visualization given the OpenFOAM case.

However, if I want, with my own code that can read and process polyMesh format, to write a Paraview ".vtu" format (a format for unstructured mesh) I need to give cell data.

This is where I found a problem, and still can't find proper resolution.

A side note is that I use CSR format for sparse matrices, which I create using 'owner' and 'neighbour' polyMesh data. From CSR format I can easily find cell neighbour indices in the form of ja(ia(icell)),..,ja(ia(icell+1)-1), except the diagonal element, which is the particular cell. The 'ja', 'ia' are typical CSR sparse matrix format arrays.

To make it precise: I'm looking for a list of nodes for each cell (or element), given the list of nodes for each cell face (element face), two lists of cells (elements) that share the face, a list for each side of the face, and of course the list of nodal coordinates. The list of nodes for each cell should be in correct order, consistent with faces list.

$\endgroup$

marked as duplicate by Anton Menshov Jun 6 at 21:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ I'm unsure of what you are asking, but if this is reconstructing combinatorial information, my anwser to this question may help: scicomp.stackexchange.com/questions/21163/… $\endgroup$ – BrunoLevy Oct 9 '17 at 8:05
  • $\begingroup$ I'm looking for a list of nodes for each cell (or element), given the list of nodes for each cell face (element face), two lists of cells (elements) that share the face, a list for each side of the face, and of course the list of nodal coordinates. The list of nodes for each cell should be in correct order, consistent with faces list. $\endgroup$ – Johntra Volta Oct 9 '17 at 9:01
  • $\begingroup$ Thanks, it is more or less what I understood (and my previous answer gives an algorirthm to do that). $\endgroup$ – BrunoLevy Oct 9 '17 at 10:43