This question already has an answer here:
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.