Skip to content
Snippets Groups Projects
Commit bb81cc9f authored by mattijs's avatar mattijs
Browse files

BUG: interpolationTable : allow for min != 0

parent c4b13069
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment