mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
eclbasevanguard: change canonicalDeckPath to std::string
makes use of filesystem an implementation detail
This commit is contained in:
@@ -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<ProblemTypeTag>();
|
||||
|
||||
return result;
|
||||
|
||||
@@ -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 = '/';
|
||||
|
||||
@@ -414,7 +414,7 @@ namespace Opm
|
||||
|
||||
using PreVanguard = GetPropType<PreTypeTag, Properties::Vanguard>;
|
||||
try {
|
||||
deckFilename = PreVanguard::canonicalDeckPath(deckFilename).string();
|
||||
deckFilename = PreVanguard::canonicalDeckPath(deckFilename);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
if ( mpiRank == 0 ) {
|
||||
|
||||
Reference in New Issue
Block a user