From 7ec78f6d6d28b64387bd9ed98165fe3edc6c7d21 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Thu, 4 Jul 2024 15:53:06 +0100
Subject: [PATCH] BUG: interpolation: handling of bounds. Fixes #3191

---
 .../interpolations/interpolateSplineXY/interpolateSplineXY.C | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.C b/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.C
index a322ff52aff..65e9318ab30 100644
--- a/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.C
+++ b/src/OpenFOAM/interpolations/interpolateSplineXY/interpolateSplineXY.C
@@ -6,6 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011 OpenFOAM Foundation
+    Copyright (C) 2024 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -60,11 +61,11 @@ Type Foam::interpolateSplineXY
     label n = xOld.size();
 
     // early exit if out of bounds or only one value
-    if (n == 1 || x < xOld[0])
+    if (n == 1 || x <= xOld[0])
     {
         return yOld[0];
     }
-    if (x > xOld[n - 1])
+    if (x >= xOld[n - 1])
     {
         return yOld[n - 1];
     }
-- 
GitLab