Skip to content
Snippets Groups Projects
Commit fce635f9 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

BF: Fix start index selection for even order interpolation

parent 37d81a52
No related branches found
No related tags found
1 merge request!18BF: Fix bug in code controlling which adjacent spline coefficients to use when interpolating
Pipeline #25975 skipped
......@@ -760,7 +760,12 @@ unsigned int Splinterpolator<T>::get_start_indicies(const double *coord, int *si
unsigned int ni = _order+1;
for (unsigned int i=0; i<_ndim; i++) {
sinds[i] = std::ceil(coord[i]) - ni/2;
if (odd(ni)) {
sinds[i] = std::floor(coord[i] + 0.5) - ni/2;
}
else {
sinds[i] = std::ceil(coord[i]) - ni/2;
}
}
for (unsigned int i=_ndim; i<5; i++) sinds[i] = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment