Table interpolation for default values improved.
If there were no non-defaulted elements in the table, we would crash. Now, all defaulted elements get the value 0.0 instead. The usage pattern was encountered for the capillary pressure column of a SWOF table.
This commit is contained in:
parent
0243aebcfa
commit
2ded7e7dfe
@ -398,10 +398,17 @@ namespace
|
||||
yv.push_back(table[k][i]);
|
||||
}
|
||||
}
|
||||
// Interpolate
|
||||
for (int i=0; i<int(indx.size()); ++i) {
|
||||
table[k][indx[i]] = linearInterpolationExtrap(xv, yv, x[i]);
|
||||
}
|
||||
if (xv.empty()) {
|
||||
// Nothing specified, insert zeros.
|
||||
for (int i=0; i<int(indx.size()); ++i) {
|
||||
table[k][indx[i]] = 0.0;
|
||||
}
|
||||
} else {
|
||||
// Interpolate
|
||||
for (int i=0; i<int(indx.size()); ++i) {
|
||||
table[k][indx[i]] = linearInterpolationExtrap(xv, yv, x[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user