fixed: output OPMRST file to output dir

will look in both output dir and input file dir on load
This commit is contained in:
Arne Morten Kvarving 2023-02-22 13:58:23 +01:00
parent 923f4fc8df
commit 070f3677f7

View File

@ -211,7 +211,17 @@ public:
saveFile_ = EWOMS_GET_PARAM(TypeTag, std::string, SaveFile);
if (saveFile_.empty()) {
saveFile_ = ebosSimulator_.vanguard().caseName() + ".OPMRST";
const auto& ioconfig = ebosSimulator_.vanguard().eclState().getIOConfig();
std::filesystem::path path(ioconfig.getOutputDir() + '/');
path.replace_filename(ioconfig.getBaseName() + ".OPMRST");
if (loadStep_ != -1 && !std::filesystem::exists(path)) {
saveFile_ = ioconfig.fullBasePath() + ".OPMRST";
if (!std::filesystem::exists(saveFile_)) {
OPM_THROW(std::runtime_error, "Error locating serialized restart file");
}
} else {
saveFile_ = path;
}
}
}