fix a test failure for the 2D tables test

this was caused by trying to get a value outside of the tabulated
region. for some reason I do not fully understand, this did not
trigger until now...
This commit is contained in:
Andreas Lauser 2015-10-29 13:54:37 +01:00
parent 812f556e97
commit 2f68011270

View File

@ -110,6 +110,8 @@ createUniformXTabulatedFunction2(Fn &f)
Scalar xMax = 3.0;
Scalar m = 50;
Scalar yMin = - 4.0;
Scalar yMax = 5.0;
auto tab = std::make_shared<Opm::UniformXTabulated2DFunction<Scalar>>();
for (unsigned i = 0; i < m; ++i) {
@ -117,8 +119,6 @@ createUniformXTabulatedFunction2(Fn &f)
tab->appendXPos(x);
Scalar n = i + 10;
Scalar yMin = - (x + 1);
Scalar yMax = (x + 1);
for (unsigned j = 0; j < n; ++j) {
Scalar y = yMin + Scalar(j)/(n -1) * (yMax - yMin);
@ -345,8 +345,8 @@ int main()
uniformXTab = createUniformXTabulatedFunction2(testFn3);
if (!compareTableWithAnalyticFn(uniformXTab,
-10, 10, 100,
-10, 10, 100,
-2.0, 3.0, 100,
-4.0, 5.0, 100,
testFn3,
/*tolerance=*/1e-2))
return 1;