From 86bc095e3a1c9ec35b7796570767a4b1832e8b9c Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 4 May 2021 08:56:41 +0200 Subject: [PATCH] eclbasevanguard: change canonicalDeckPath to std::string makes use of filesystem an implementation detail --- ebos/ebos_blackoil.cc | 2 +- ebos/eclbasevanguard.hh | 8 ++++---- opm/simulators/flow/Main.hpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ebos/ebos_blackoil.cc b/ebos/ebos_blackoil.cc index 3d84dde95..4fd8ad280 100644 --- a/ebos/ebos_blackoil.cc +++ b/ebos/ebos_blackoil.cc @@ -64,7 +64,7 @@ std::string ebosBlackOilGetDeckFileName(int argc, char** argv) /*allowUnused=*/true, /*handleHelp=*/false); std::string rawDeckFileName = EWOMS_GET_PARAM(ProblemTypeTag, std::string, EclDeckFileName); - std::string result = Vanguard::canonicalDeckPath(rawDeckFileName).string(); + std::string result = Vanguard::canonicalDeckPath(rawDeckFileName); Parameters::reset(); return result; diff --git a/ebos/eclbasevanguard.hh b/ebos/eclbasevanguard.hh index f91407a70..be28fc35e 100644 --- a/ebos/eclbasevanguard.hh +++ b/ebos/eclbasevanguard.hh @@ -252,7 +252,7 @@ public: * The input can either be the canonical deck file name or the name of the case * (i.e., without the .DATA extension) */ - static filesystem::path canonicalDeckPath(const std::string& caseName) + static std::string canonicalDeckPath(const std::string& caseName) { const auto fileExists = [](const filesystem::path& f) -> bool { @@ -267,11 +267,11 @@ public: auto simcase = filesystem::path(caseName); if (fileExists(simcase)) - return simcase; + return simcase.string(); for (const auto& ext : { std::string("data"), std::string("DATA") }) { if (fileExists(simcase.replace_extension(ext))) - return simcase; + return simcase.string(); } throw std::invalid_argument("Cannot find input case '"+caseName+"'"); @@ -386,7 +386,7 @@ public: throw std::runtime_error("No input deck file has been specified as a command line argument," " or via '--ecl-deck-file-name=CASE.DATA'"); - fileName = canonicalDeckPath(fileName).string(); + fileName = canonicalDeckPath(fileName); // compute the base name of the input file name const char directorySeparator = '/'; diff --git a/opm/simulators/flow/Main.hpp b/opm/simulators/flow/Main.hpp index b1876b15c..950295cc2 100644 --- a/opm/simulators/flow/Main.hpp +++ b/opm/simulators/flow/Main.hpp @@ -414,7 +414,7 @@ namespace Opm using PreVanguard = GetPropType; try { - deckFilename = PreVanguard::canonicalDeckPath(deckFilename).string(); + deckFilename = PreVanguard::canonicalDeckPath(deckFilename); } catch (const std::exception& e) { if ( mpiRank == 0 ) {