mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 16:32:12 -05:00
#7335 Dual poro models : Throw exception if invalid data is detected
This commit is contained in:
1 parent
b77da64b6d
commit
7aa3a47b36
5 files changed
+46
-9
No files matched your search
Vendored
+6
-1
@@ -309,7 +309,12 @@ Opm::ECLPVT::surfaceMassDensity(const ECLInitFileData& init,
|
||||
const auto& tab = init.keywordData<double>("TAB");
|
||||
|
||||
// Subtract one to account for 1-based indices.
|
||||
const auto start = std::max(tabdims[ TABDIMS_IBDENS_OFFSET_ITEM ] - 1, 0);
|
||||
const auto start = tabdims[ TABDIMS_IBDENS_OFFSET_ITEM ] - 1;
|
||||
if (start < 0) {
|
||||
throw std::invalid_argument(
|
||||
"Invalid table offset for TABDIMS_IBDENS_OFFSET_ITEM");
|
||||
}
|
||||
|
||||
const auto nreg = tabdims[ TABDIMS_NTDENS_ITEM ];
|
||||
|
||||
// Phase densities for 'phase' constitute 'nreg' consecutive entries
|
||||
|
||||
Vendored
+10
-2
@@ -641,7 +641,11 @@ fromECLOutput(const ECLInitFileData& init)
|
||||
const auto nTabElem = raw.numPrimary * raw.numTables;
|
||||
|
||||
// Subtract one to account for 1-based indices.
|
||||
const auto start = std::max(tabdims[ TABDIMS_JBPVTG_OFFSET_ITEM ] - 1, 0);
|
||||
const auto start = tabdims[ TABDIMS_JBPVTG_OFFSET_ITEM ] - 1;
|
||||
if (start < 0) {
|
||||
throw std::invalid_argument(
|
||||
"Invalid table offset for TABDIMS_JBPVTG_OFFSET_ITEM");
|
||||
}
|
||||
|
||||
raw.primaryKey.assign(&tab[start], &tab[start] + nTabElem);
|
||||
}
|
||||
@@ -652,7 +656,11 @@ fromECLOutput(const ECLInitFileData& init)
|
||||
raw.numPrimary * raw.numRows * raw.numCols * raw.numTables;
|
||||
|
||||
// Subtract one to account for 1-based indices.
|
||||
const auto start = std::max(tabdims[ TABDIMS_IBPVTG_OFFSET_ITEM ] - 1, 0);
|
||||
const auto start = tabdims[ TABDIMS_IBPVTG_OFFSET_ITEM ] - 1;
|
||||
if (start < 0) {
|
||||
throw std::invalid_argument(
|
||||
"Invalid table offset for TABDIMS_IBPVTG_OFFSET_ITEM");
|
||||
}
|
||||
|
||||
raw.data.assign(&tab[start], &tab[start] + nTabElem);
|
||||
}
|
||||
|
||||
Vendored
+10
-2
@@ -836,7 +836,11 @@ fromECLOutput(const ECLInitFileData& init)
|
||||
const auto nTabElem = raw.numPrimary * raw.numTables;
|
||||
|
||||
// Subtract one to account for 1-based indices.
|
||||
const auto start = std::max(tabdims[ TABDIMS_JBPVTO_OFFSET_ITEM ] - 1, 0);
|
||||
const auto start = tabdims[ TABDIMS_JBPVTO_OFFSET_ITEM ] - 1;
|
||||
if (start < 0) {
|
||||
throw std::invalid_argument(
|
||||
"Invalid table offset for TABDIMS_JBPVTO_OFFSET_ITEM");
|
||||
}
|
||||
|
||||
raw.primaryKey.assign(&tab[start], &tab[start] + nTabElem);
|
||||
}
|
||||
@@ -847,7 +851,11 @@ fromECLOutput(const ECLInitFileData& init)
|
||||
raw.numPrimary * raw.numRows * raw.numCols * raw.numTables;
|
||||
|
||||
// Subtract one to account for 1-based indices.
|
||||
const auto start = std::max(tabdims[ TABDIMS_IBPVTO_OFFSET_ITEM ] - 1, 0);
|
||||
const auto start = tabdims[ TABDIMS_IBPVTO_OFFSET_ITEM ] - 1;
|
||||
if (start < 0) {
|
||||
throw std::invalid_argument(
|
||||
"Invalid table offset for TABDIMS_IBPVTO_OFFSET_ITEM");
|
||||
}
|
||||
|
||||
raw.data.assign(&tab[start], &tab[start] + nTabElem);
|
||||
}
|
||||
|
||||
Vendored
+5
-1
@@ -363,7 +363,11 @@ fromECLOutput(const ECLInitFileData& init)
|
||||
raw.numPrimary * raw.numRows * raw.numCols * raw.numTables;
|
||||
|
||||
// Subtract one to account for 1-based indices.
|
||||
const auto start = std::max(tabdims[ TABDIMS_IBPVTW_OFFSET_ITEM ] - 1, 0);
|
||||
const auto start = tabdims[ TABDIMS_IBPVTW_OFFSET_ITEM ] - 1;
|
||||
if (start < 0) {
|
||||
throw std::invalid_argument(
|
||||
"Invalid table offset for TABDIMS_IBPVTW_OFFSET_ITEM");
|
||||
}
|
||||
|
||||
raw.data.assign(&tab[start], &tab[start] + nTabElem);
|
||||
}
|
||||
|
||||
+15
-3
@@ -597,7 +597,11 @@ Gas::Details::tableData(const std::vector<int>& tabdims,
|
||||
const auto nTabElems = t.numRows * t.numTables * t.numCols;
|
||||
|
||||
// Subtract one to account for offset being one-based index.
|
||||
const auto start = std::max(tabdims[ TABDIMS_IBSGFN_OFFSET_ITEM ] - 1, 0);
|
||||
const auto start = tabdims[ TABDIMS_IBSGFN_OFFSET_ITEM ] - 1;
|
||||
if (start < 0) {
|
||||
throw std::invalid_argument(
|
||||
"Invalid table offset for TABDIMS_IBSGFN_OFFSET_ITEM");
|
||||
}
|
||||
|
||||
t.data.assign(&tab[start], &tab[start] + nTabElems);
|
||||
|
||||
@@ -648,7 +652,11 @@ Oil::Details::tableData(const std::vector<int>& tabdims,
|
||||
const auto nTabElems = t.numRows * t.numTables * t.numCols;
|
||||
|
||||
// Subtract one to account for offset being one-based index.
|
||||
const auto start = std::max(tabdims[ TABDIMS_IBSOFN_OFFSET_ITEM ] - 1, 0);
|
||||
const auto start = tabdims[ TABDIMS_IBSOFN_OFFSET_ITEM ] - 1;
|
||||
if (start < 0) {
|
||||
throw std::invalid_argument(
|
||||
"Invalid table offset for TABDIMS_IBSOFN_OFFSET_ITEM");
|
||||
}
|
||||
|
||||
t.data.assign(&tab[start], &tab[start] + nTabElems);
|
||||
|
||||
@@ -688,7 +696,11 @@ Water::Details::tableData(const std::vector<int>& tabdims,
|
||||
const auto nTabElems = t.numRows * t.numTables * t.numCols;
|
||||
|
||||
// Subtract one to account for offset being one-based index.
|
||||
const auto start = std::max(tabdims[ TABDIMS_IBSWFN_OFFSET_ITEM ] - 1, 0);
|
||||
const auto start = tabdims[ TABDIMS_IBSWFN_OFFSET_ITEM ] - 1;
|
||||
if (start < 0) {
|
||||
throw std::invalid_argument(
|
||||
"Invalid table offset for TABDIMS_IBSWFN_OFFSET_ITEM");
|
||||
}
|
||||
|
||||
t.data.assign(&tab[start], &tab[start] + nTabElems);
|
||||
|
||||
|
||||
Reference in new issue
Block a user