View Issue Details

IDProjectCategoryView StatusLast Update
0000105OpenFOAMBugpublic2010-12-13 10:35
Reporteruser19Assigned Touser4 
PrioritynormalSeveritymajorReproducibilityN/A
Status resolvedResolutionfixed 
Summary0000105: Wrong REPEAT bounds handling in case of underflow in interpolationTable
DescriptionIn the case of underflow with REPEAT bounds handling the interpolation point is increased by the maximum value until it is >= 0 instead of >= minimum value. In case of overflow the handling is correct.
Additional InformationAttached patch fixes this.
TagsNo tags attached.

Activities

user19

2010-12-11 05:40

 

0001-FIX-underflow-REPEAT-handling-in-interpolationTable.patch (1,123 bytes)   
From c6c9cb89b6687ed9960cbd3c0fb0b29ce1dff0d4 Mon Sep 17 00:00:00 2001
From: Michael Wild <themiwi@users.sourceforge.net>
Date: Sat, 11 Dec 2010 06:38:47 +0100
Subject: [PATCH] FIX: underflow REPEAT handling in interpolationTable

Signed-off-by: Michael Wild <themiwi@users.sourceforge.net>
---
 .../interpolationTable/interpolationTable.C        |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C
index 2bdf04c..a59f703 100644
--- a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C
+++ b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C
@@ -381,7 +381,7 @@ Type Foam::interpolationTable<Type>::operator()(const scalar value) const
             case interpolationTable::REPEAT:
             {
                 // adjust lookupValue to >= 0
-                while (lookupValue < 0)
+                while (lookupValue < minLimit)
                 {
                     lookupValue += maxLimit;
                 }
-- 
1.7.1

user4

2010-12-13 10:35

  ~0000175

2dcf8751b980bb7c1bbffd7ce1c00438ee2d4c96

Thanks for fix. I've changed it to use modulo arithmetic.

Issue History

Date Modified Username Field Change
2010-12-11 05:40 user19 New Issue
2010-12-11 05:40 user19 File Added: 0001-FIX-underflow-REPEAT-handling-in-interpolationTable.patch
2010-12-13 10:35 user4 Note Added: 0000175
2010-12-13 10:35 user4 Status new => resolved
2010-12-13 10:35 user4 Fixed in Version => 1.7.x
2010-12-13 10:35 user4 Resolution open => fixed
2010-12-13 10:35 user4 Assigned To => user4