Benchmarking CT-INT revealed that this code is incredibly hot, so it is worthwhile to spend some time micro optimizing it. We make use of the fact that this function only properly works for mesh points that are within the range of the mesh. This allows to completely elide the call to std::floor since for positive values this is equivalent to truncation. Futhermore division is replaced by multiplication with the precomputed inverse.
Benchmarking CT-INT revealed that this code is incredibly hot, so it is worthwhile to spend some time micro optimizing it. We make use of the fact that this function only properly works for mesh points that are within the range of the mesh. This allows to completely elide the call to std::floor since for positive values this is equivalent to truncation. Futhermore division is replaced by multiplication with the precomputed inverse.
Co-authored-by: @Wentzell