From 9301cc4f64a755630f28ac9cd138cb1c9e4e3cfe Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 19 Apr 2012 16:47:59 +0100 Subject: [PATCH] ENH: linearInterpolationWeights: handle values equal to table range --- .../linearInterpolationWeights.C | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/interpolations/interpolationWeights/linearInterpolationWeights/linearInterpolationWeights.C b/src/OpenFOAM/interpolations/interpolationWeights/linearInterpolationWeights/linearInterpolationWeights.C index 18233f1825..89497fba37 100644 --- a/src/OpenFOAM/interpolations/interpolationWeights/linearInterpolationWeights/linearInterpolationWeights.C +++ b/src/OpenFOAM/interpolations/interpolationWeights/linearInterpolationWeights/linearInterpolationWeights.C @@ -167,8 +167,11 @@ bool linearInterpolationWeights::integrationWeights << exit(FatalError); } - // Currently no fancy logic on cached index - label i1 = findLower(samples_, t1); + // Currently no fancy logic on cached index like in value + + //- Find lower or equal index + label i1 = findLower(samples_, t1, 0, lessEqOp()); + //- Find lower index label i2 = findLower(samples_, t2); // For now just fail if any outside table