updates of ERst api, supports multiple occurrences of array names

This commit is contained in:
Torbjørn Skille
2019-11-03 19:34:25 +01:00
parent dd8f0b2164
commit c6f8a41c43
10 changed files with 189 additions and 117 deletions

View File

@@ -195,7 +195,7 @@ void checkRestartFile( int timeStepIdx ) {
const auto& knownVec = rstFile.listOfRstArrays(i);
if (keywordExists(knownVec, "PRESSURE")) {
const auto& press = rstFile.getRst<float>("PRESSURE", i);
const auto& press = rstFile.getRst<float>("PRESSURE", i, 0);
for( auto& x : sol.data("PRESSURE") )
x /= Metric::Pressure;
@@ -203,22 +203,22 @@ void checkRestartFile( int timeStepIdx ) {
}
if (keywordExists(knownVec, "SWAT")) {
const auto& swat = rstFile.getRst<float>("SWAT", i);
const auto& swat = rstFile.getRst<float>("SWAT", i, 0);
compareErtData( sol.data("SWAT"), swat, 1e-4 );
}
if (keywordExists(knownVec, "SGAS")) {
const auto& sgas = rstFile.getRst<float>("SGAS", i);
const auto& sgas = rstFile.getRst<float>("SGAS", i, 0);
compareErtData( sol.data("SGAS"), sgas, 1e-4 );
}
if (keywordExists(knownVec, "KRO")) {
const auto& kro = rstFile.getRst<float>("KRO", i);
const auto& kro = rstFile.getRst<float>("KRO", i, 0);
BOOST_CHECK_CLOSE(1.0 * i * kro.size(), sum(kro), 1.0e-8);
}
if (keywordExists(knownVec, "KRG")) {
const auto& krg = rstFile.getRst<float>("KRG", i);
const auto& krg = rstFile.getRst<float>("KRG", i, 0);
BOOST_CHECK_CLOSE(10.0 * i * krg.size(), sum(krg), 1.0e-8);
}
}