Get cell center coordinates in a python script
Hi all,
I've made a python script that create a slice and extract the points coordinates of the vertex as well as the velocity components. But I'm unable to obtain the cell center coordinates, howto do that ? You will see below my script which can extract the points coordinates. Code:
import numpy as np Thanks ! François |
Hi,
To obtain the cell center coordinates, I 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. 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, Thomas |
Indeed the writeCellCentres do the trick.
But my goal is to obtain the cell centers in a Python script using the paraview.simple module. Anyway thank you very much Thomas for your advice, it's very nice from you. Have a good day. François |
All times are GMT -4. The time now is 05:54. |