Skip to content

Commit cebc8e6

Browse files
I was querying the grids in the wrong order, so my indices and weights were all wrong.
1 parent e38eaa6 commit cebc8e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spiner/databox.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ DataBox<T, Grid_t, Concept>::interpToReal_alt(const Coords... coords) const noex
482482
int indices[N];
483483
weights_t<T> weights[N];
484484
for (std::size_t n = 0; n < N; ++n) {
485-
grids_[n].weights(get_value(n, coords...), indices[n], weights[n]);
485+
grids_[N - 1 - n].weights(get_value(n, coords...), indices[n], weights[n]);
486486
}
487487
return interpToReal_core<N>(
488488
[this](auto ...ii) { return this->dataView_(ii...); },
@@ -496,12 +496,12 @@ PORTABLE_FORCEINLINE_FUNCTION T
496496
DataBox<T, Grid_t, Concept>::interpToReal_core(Callable && callable,
497497
const weights_t<T> * weightlist,
498498
const int * indices) const noexcept {
499-
const weights_t<T> & w = weightlist[0];
500499
if constexpr (N == 0) {
501500
// base case
502501
return callable();
503502
} else {
504503
// recursive case
504+
const weights_t<T> & w = weightlist[0];
505505
return w[0] * interpToReal_core<N-1>(
506506
[&c=callable, i=indices[0]](auto ...ii) { return c(i, ii...); },
507507
weightlist + 1,

0 commit comments

Comments
 (0)