Skip to content

using cached id in GetExpIndex

Ankang Gao requested to merge gaoak/nektar:fix/cacheExpIndex into master

This merge request aims to improve the performance of GetExpIndex when there are points number is large and consecutive requests are visiting the same element which tends to happen in the interpolate field to field routines. (similar to #234 (closed))

In most applications, the successive points are not far from each other. The probability that they lie in the same element is high. So this merge request introduces a cacheId in GetExpIndex by reusing the last element index as an initial guess for the next point.

The performance of cache depends on cases. In the worst situation, the cache is not hit and one more test (ContainsPoint) is performed. This test is expensive only for curved elements. If the points are dense enough and stored in order, the benefit of cache shows up, but there is no guarantee for this.

To test this caching it has now been turned on by default in the FieldUtils::interpolator and so is typically used by default in FieldConvert

Edited by Spencer Sherwin

Merge request reports