CFD Online Discussion Forums

CFD Online Discussion Forums (
-   ParaView (
-   -   extract the cell center coordinates if the CELLID is know (

openfoammaofnepo August 26, 2013 14:55

extract the cell center coordinates if the CELLID is know
Hi All,

If I know the cell ID, how can I know the cell centroid coordinates in paraview? Thank you very much.

wyldckat August 31, 2013 13:02

Hi openfoammaofnepo,

There are probably a few ways you can do this.

I suggest using the following steps:
  1. Use the "Threshold" filter and isolate the value in question for the field "cellID".
  2. Then apply to it the filter "Cell Centers", with the option "Vertex Cells" selected.
  3. Then use the view splitting button on the upper right corner of the 3D display and choose to see the spreadsheet view.
  4. On the spreadsheet view, make sure you are seeing the "CellCenters1" entry.
  5. You can also use from the menu "File -> Export data" to export the values from this entry "CellCenters1".
There is nonetheless a situation you have to be careful about. If you are using OpenFOAM data, then it is very likely that your mesh has been decomposed into tetrahedral cells. So make sure you turn on the "Polyhedron" option, so that it will not decompose the mesh cells.

Best regards,

t.oliveira January 12, 2017 07:54


Another way to obtain the cell center coordinates is to run the standard utility writeCellCentres. It creates fields ccx, ccy and ccz with the x, y and z components of the cell center coordinates, which can be loaded in Paraview.

The users interested in writeCellCentres may want to know that there is also the cellCenters utility created by @opedrofunk, which is "similar to the writeCellCentres utility[...], except that it outputs a single file with the vector coordinates of the cell center positions".

Best wishes,

All times are GMT -4. The time now is 16:48.