Optimize structured cell gradient calculations
While benchmarking the gradient filter, we noticed what looks like a missed optimization:
Calculation | Time (s) |
---|---|
PointGradient,ScalarField | 1.0327700 |
CellGradient,VectorField | 12.829300 |
The cell gradient should be faster, as it has to process less data than the point gradient, but it is an order of magnitude slower.
This is because for structured data, the point gradient goes through the StructuredPointGradient
worklet (which is optimized for regular grids) while the cell gradient uses vtkm::exec::CellDerivative
, which is generalized for arbitrary hexahedra.
There should be some way to optimize the cell gradient calculation to similarly take advantage of the regularity of the dataset and improve execution time.