Skip to content

Commit

Permalink
I was querying the grids in the wrong order, so my indices and weight…
Browse files Browse the repository at this point in the history
…s were all wrong.
  • Loading branch information
BrendanKKrueger committed Oct 1, 2024
1 parent e38eaa6 commit cebc8e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spiner/databox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ DataBox<T, Grid_t, Concept>::interpToReal_alt(const Coords... coords) const noex
int indices[N];
weights_t<T> weights[N];
for (std::size_t n = 0; n < N; ++n) {
grids_[n].weights(get_value(n, coords...), indices[n], weights[n]);
grids_[N - 1 - n].weights(get_value(n, coords...), indices[n], weights[n]);
}
return interpToReal_core<N>(
[this](auto ...ii) { return this->dataView_(ii...); },
Expand All @@ -496,12 +496,12 @@ PORTABLE_FORCEINLINE_FUNCTION T
DataBox<T, Grid_t, Concept>::interpToReal_core(Callable && callable,
const weights_t<T> * weightlist,
const int * indices) const noexcept {
const weights_t<T> & w = weightlist[0];
if constexpr (N == 0) {
// base case
return callable();
} else {
// recursive case
const weights_t<T> & w = weightlist[0];
return w[0] * interpToReal_core<N-1>(
[&c=callable, i=indices[0]](auto ...ii) { return c(i, ii...); },
weightlist + 1,
Expand Down

0 comments on commit cebc8e6

Please sign in to comment.