visit-dav / visit

VisIt - Visualization and Data Analysis for Mesh-based Scientific Data
https://visit.llnl.gov
BSD 3-Clause "New" or "Revised" License
436 stars 114 forks source link

Average Value Query doesn't make sense #19952

Open JustinPrivitera opened 4 hours ago

JustinPrivitera commented 4 hours ago

VisIt 3.4.1

I am looking at curv2d.silo variables d and u. d is zonal and u is nodal.

I have run Variable Sum queries for both, a NumZones query, a NumNodes query, and Average Value queries for both. Below are the results:

image

If I was computing the average for d, I would take the total d = 3453.26 and divide it by the number of zones = 988. This yields 3.495, which is off from the Average Value query, which gives 3.861.

If I was computing the average for u, I would take the total u = 67.7007 and divide it by the number of nodes = 1053. This yields 0.0685, which is off from the Average Value query, which gives 0.0222.

This isn't unique to curv2d.silo, which has ghosts. It happens in curv3d.silo as well: image

You can verify that the averages are again wrong.

Is the Average Value query doing something with weights? How do I just get the mean value? We should either correct what looks like faulty behavior or make it clear to users what the Average Value query is actually doing.

biagas commented 4 hours ago

AverageValue query is a subclass off avtWeightedVariableSummationQuery, you would have to look at the parent source to determine which weighting is being applied, I don't recall offhand.

JustinPrivitera commented 4 hours ago

I saw that in the source code and I didn't go down the rabbit hole of trying to understand how it was applying weighting.

I think this is opaque to users and the average value query should either work as you'd expect it to or we can provide controls for the weighting.