Skip to content

Commit

Permalink
Fix: include global offset in monotonic spline
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwoerer committed Jan 31, 2025
1 parent cd383e2 commit 2d72bab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/mesh/interpolation/hermite_spline_xz.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ void XZHermiteSplineBase<monotonic>::calcWeights(const Field3D& delta_x,
#ifdef HS_USE_PETSC
IndConverter conv{localmesh};
#endif
[[maybe_unused]] const int y_global_offset =
localmesh->getYProcIndex() * (localmesh->yend - localmesh->ystart + 1);
BOUT_FOR(i, getRegion(region)) {
const int x = i.x();
const int y = i.y();
Expand Down Expand Up @@ -303,7 +305,8 @@ void XZHermiteSplineBase<monotonic>::calcWeights(const Field3D& delta_x,
#endif
#endif
if constexpr (monotonic) {
const auto gind = gf3daccess->xyzg(i_corn, y + y_offset, k_corner(x, y, z));
const auto gind =
gf3daccess->xyzg(i_corn, y + y_offset + y_global_offset, k_corner(x, y, z));
gf3daccess->get(gind);
gf3daccess->get(gind.xp(1));
gf3daccess->get(gind.zp(1));
Expand Down
2 changes: 1 addition & 1 deletion tests/integrated/test_suite
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class Test(threading.Thread):
self.output += "\n(It is likely that a timeout occured)"
else:
# ❌ Failed
print("\u274C", end="") # No newline
print("\u274c", end="") # No newline
print(" %7.3f s" % (time.time() - self.local.start_time), flush=True)

def _cost(self):
Expand Down

0 comments on commit 2d72bab

Please sign in to comment.