Python calculator difference between two datasets is wrong

(Walter Alan Scott) #1

I have a user that is trying to subtract two datasets. Say one dataset is a sphere on a stand, and the second dataset is a sphere on a different stand. I turn off the blocks for the stand, and have only a sphere per dataset. These spheres are heating up. I want to subtract one dataset temperature from the other. I am using the following command: inputs[1].CellData[‘Temp’]-inputs[0].CellData[‘Temp’].

The issue, I suspect, is that ParaView is using GlobalNodeIds (or possibly cell count) for this comparison.

My initial question is, how does the Python Calculator step through cells? By GlobalNodeId? By CellId? Just by location of cells in the dataset? Can this be controlled?

A competing product gets this correct, so I believe that the datasets are correct.



(Cory Quammen (Kitware)) #2

Cells with the same cell ID will have the subtraction applied to them. The assumption is that these cells are ordered in a way that lets you meaningfully compare values when you do cell-wise operations. In this case, the cell centers should be the same is my guess.

One way to check is to run the Generate Ids filter to generate cell IDs and visually compare them when coloring by the cell array “Ids”. If they match, then the expression you’ve given should work fine.

(Walter Alan Scott) #3

Thanks Cory. This gives me the same thing as not runing the Cell Id filter. I need to ask the user what is expected. I believe ParaView is doing the right thing.