Extracted timestepnning keywords from the regular handleKeyword()

This commit is contained in:
Joakim Hove 2020-01-28 20:31:24 +01:00
parent 989d643140
commit 1cdb4aa579
2 changed files with 21 additions and 15 deletions

View File

@ -400,7 +400,7 @@ namespace Opm
void handleVFPINJ(const DeckKeyword& vfpprodKeyword, const UnitSystem& unit_system, size_t currentStep);
void checkUnhandledKeywords( const SCHEDULESection& ) const;
void checkIfAllConnectionsIsShut(size_t currentStep);
void handleKeyword(size_t& currentStep,
void handleKeyword(size_t currentStep,
const SCHEDULESection& section,
size_t keywordIdx,
const DeckKeyword& keyword,

View File

@ -275,7 +275,7 @@ namespace {
}
void Schedule::handleKeyword(size_t& currentStep,
void Schedule::handleKeyword(size_t currentStep,
const SCHEDULESection& section,
size_t keywordIdx,
const DeckKeyword& keyword,
@ -309,17 +309,7 @@ namespace {
{"MULTTHT" , false},
{"MULTTHT-" , false}};
if (keyword.name() == "DATES") {
checkIfAllConnectionsIsShut(currentStep);
currentStep += keyword.size();
}
else if (keyword.name() == "TSTEP") {
checkIfAllConnectionsIsShut(currentStep);
currentStep += keyword.getRecord(0).getItem(0).data_size(); // This is a bit weird API.
}
else if (keyword.name() == "UDQ")
if (keyword.name() == "UDQ")
handleUDQ(keyword, currentStep);
else if (keyword.name() == "WLIST")
@ -516,8 +506,24 @@ namespace {
}
}
this->addACTIONX(action, currentStep);
} else
this->handleKeyword(currentStep, section, keywordIdx, keyword, parseContext, errors, grid, fp, unit_system, rftProperties);
}
else if (keyword.name() == "DATES") {
checkIfAllConnectionsIsShut(currentStep);
currentStep += keyword.size();
}
else if (keyword.name() == "TSTEP") {
checkIfAllConnectionsIsShut(currentStep);
currentStep += keyword.getRecord(0).getItem(0).data_size();
}
else {
if (currentStep >= this->m_timeMap.restart_offset())
this->handleKeyword(currentStep, section, keywordIdx, keyword, parseContext, errors, grid, fp, unit_system, rftProperties);
else
OpmLog::info("Skipping keyword: " + keyword.name() + " while loading SCHEDULE section");
}
keywordIdx++;
if (keywordIdx == section.size())