@@ -101,8 +101,8 @@ class IndConverter {
101101 }
102102};
103103
104- XZHermiteSpline::XZHermiteSpline (int y_offset, Mesh* mesh )
105- : XZInterpolation(y_offset, mesh ), h00_x(localmesh), h01_x(localmesh),
104+ XZHermiteSpline::XZHermiteSpline (int y_offset, Mesh* meshin )
105+ : XZInterpolation(y_offset, meshin ), h00_x(localmesh), h01_x(localmesh),
106106 h10_x(localmesh), h11_x(localmesh), h00_z(localmesh), h01_z(localmesh),
107107 h10_z(localmesh), h11_z(localmesh) {
108108
@@ -346,6 +346,9 @@ Field3D XZHermiteSpline::interpolate(const Field3D& f, const std::string& region
346346 ASSERT1 (f.getMesh () == localmesh);
347347 Field3D f_interp{emptyFrom (f)};
348348
349+ const auto region2 =
350+ y_offset == 0 ? " RGN_NOY" : fmt::format (" RGN_YPAR_{:+d}" , y_offset);
351+
349352#if USE_NEW_WEIGHTS
350353#ifdef HS_USE_PETSC
351354 BoutReal* ptr;
@@ -355,7 +358,6 @@ Field3D XZHermiteSpline::interpolate(const Field3D& f, const std::string& region
355358 VecRestoreArray (rhs, &ptr);
356359 MatMult (petscWeights, rhs, result);
357360 VecGetArrayRead (result, &cptr);
358- const auto region2 = y_offset == 0 ? region : fmt::format (" RGN_YPAR_{:+d}" , y_offset);
359361 BOUT_FOR (i, f.getRegion (region2)) {
360362 f_interp[i] = cptr[int (i)];
361363 ASSERT2 (std::isfinite (cptr[int (i)]));
@@ -375,11 +377,10 @@ Field3D XZHermiteSpline::interpolate(const Field3D& f, const std::string& region
375377 }
376378 }
377379#endif
378- return f_interp;
379380#else
380381 // Derivatives are used for tension and need to be on dimensionless
381382 // coordinates
382- const auto region2 = fmt::format ( " RGN_YPAR_{:+d} " , y_offset);
383+
383384 // f has been communcated, and thus we can assume that the x-boundaries are
384385 // also valid in the y-boundary. Thus the differentiated field needs no
385386 // extra comms.
@@ -418,8 +419,10 @@ Field3D XZHermiteSpline::interpolate(const Field3D& f, const std::string& region
418419 ASSERT2 (std::isfinite (f_interp[iyp]) || i.x () < localmesh->xstart
419420 || i.x () > localmesh->xend );
420421 }
421- return f_interp;
422422#endif
423+ f_interp.setRegion (region2);
424+ ASSERT2 (f_interp.getRegionID ());
425+ return f_interp;
423426}
424427
425428Field3D XZHermiteSpline::interpolate (const Field3D& f, const Field3D& delta_x,
0 commit comments