Add the cell center coordinates to the cell data

I ended up revisiting this topic while answering a different question. I found my original solution is behaving a little wonky. @banesullivan’s plugin script works great, but fails on multiblock data sets. I found a slightly simpler solution.

  1. Add the Calculator filter. Set the Attribute Type to Point Data. Set the Result Array name to Cell Center. Set the expression to coords. Apply.
  2. Add the Point Data to Cell Data filter. Uncheck Process All Arrays. Uncheck all point arrays except Cell Center. Check Pass Point Data. Apply.

The result should be one more cell field with the cell centers. This should work with any data set whether multi-block or single data set. To make this even easier, here is a custom filter that just adds the Cell Center array as a single filter.

AppendCellCenters.cpd (5.2 KB)

To load this, go to ToolsManage Custom Filters.... Then click the Import button to load this file.

1 Like