mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-01 21:39:09 -06:00
Main: remove unused method and associated filesystem include
This commit is contained in:
parent
8dcab4b236
commit
fef009f792
@ -77,7 +77,6 @@
|
|||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <filesystem>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -539,34 +538,6 @@ private:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::filesystem::path simulationCaseName_(const std::string& casename)
|
|
||||||
{
|
|
||||||
namespace fs = ::std::filesystem;
|
|
||||||
|
|
||||||
auto exists = [](const fs::path& f)
|
|
||||||
{
|
|
||||||
return (fs::exists(f) && fs::is_regular_file(f))
|
|
||||||
|| (fs::is_symlink(f) &&
|
|
||||||
fs::is_regular_file(fs::read_symlink(f)));
|
|
||||||
};
|
|
||||||
|
|
||||||
auto simcase = fs::path { casename };
|
|
||||||
|
|
||||||
if (exists(simcase)) {
|
|
||||||
return simcase;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& ext : { std::string("DATA"), std::string("data") }) {
|
|
||||||
if (exists(simcase.replace_extension(ext))) {
|
|
||||||
return simcase;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw std::invalid_argument {
|
|
||||||
"Cannot find input case '" + casename + '\''
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// This function is an extreme special case, if the program has been invoked
|
// This function is an extreme special case, if the program has been invoked
|
||||||
// *exactly* as:
|
// *exactly* as:
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user