Commit bb81cc9f authored by mattijs's avatar mattijs
Browse files

BUG: interpolationTable : allow for min != 0

parent c4b13069
......@@ -284,10 +284,8 @@ Type Foam::interpolationTable<Type>::rateOfChange(const scalar value) const
case interpolationTable::REPEAT:
{
// adjust lookupValue to >= minLimit
while (lookupValue < minLimit)
{
lookupValue += maxLimit;
}
scalar span = maxLimit-minLimit;
lookupValue = fmod(lookupValue-minLimit, span) + minLimit;
break;
}
}
......@@ -325,10 +323,8 @@ Type Foam::interpolationTable<Type>::rateOfChange(const scalar value) const
case interpolationTable::REPEAT:
{
// adjust lookupValue <= maxLimit
while (lookupValue > maxLimit)
{
lookupValue -= maxLimit;
}
scalar span = maxLimit-minLimit;
lookupValue = fmod(lookupValue-minLimit, span) + minLimit;
break;
}
}
......@@ -540,11 +536,9 @@ Type Foam::interpolationTable<Type>::operator()(const scalar value) const
}
case interpolationTable::REPEAT:
{
// adjust lookupValue to >= minLimin
while (lookupValue < minLimit)
{
lookupValue += maxLimit;
}
// adjust lookupValue to >= minLimit
scalar span = maxLimit-minLimit;
lookupValue = fmod(lookupValue-minLimit, span) + minLimit;
break;
}
}
......@@ -582,10 +576,8 @@ Type Foam::interpolationTable<Type>::operator()(const scalar value) const
case interpolationTable::REPEAT:
{
// adjust lookupValue <= maxLimit
while (lookupValue > maxLimit)
{
lookupValue -= maxLimit;
}
scalar span = maxLimit-minLimit;
lookupValue = fmod(lookupValue-minLimit, span) + minLimit;
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment