How to get a single value result from the calculator?

Hello,
If my expression in Calculator or Python Calculator filter returns a single value (i.e. averaging a variable over the entire domain), how can I see that single value (without plotting or exporting the data)?

The Calculator filter does not have the ability to do reduction operations like average, so the point is moot there. The Python Calculator can do operations like mean, sum, and min/max, but the result is going to replicated on every point or cell in the domain.

The easiest way to see the result is to go to the Information tab behind the Properties panel and look at the information in the Data Arrays. It will give the range of the values calculated, which of course will be a single value.

For more detailed information about the data in a dataset, you can open the SpreadSheet view. Click the Split Vertical button over the view and then create a SpreadSheet view.

1 Like

Thanks for the reply Mr. Moreland. My ultimate goal is to plot (or export) the sum of a variable in the entire domain versus time. Can you suggest a practical way of doing this?

This is not exactly what you asked for, but it is very easy to plot the average of a variable (along with the min, max, and quartiles) by applying the Plot Data Over Time filter. (You need the most recent ParaView 5.6 for this to be available.)

If you really need to plot the sum over time, probably the easiest way to do that is to compute the sum with the Python Calculator as previously described, then selecting a single point (or cell) and then apply the Plot Selection Over Time filter.

1 Like