Merge pull request #3415 from akva2/add_ioconfig_inputdir

added: getInputDir in IOConfig
This commit is contained in:
Atgeirr Flø Rasmussen 2023-02-28 07:47:11 +01:00 committed by GitHub
commit c6b9310922
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -182,6 +182,8 @@ namespace Opm {
/// i.e. /path/to/sim/CASE
std::string fullBasePath( ) const;
std::string getInputDir() const;
bool initOnly() const;
bool operator==(const IOConfig& data) const;

View File

@ -239,7 +239,7 @@ namespace Opm {
return m_output_enabled;
}
void IOConfig::setOutputEnabled(bool enabled){
void IOConfig::setOutputEnabled(bool enabled) {
m_output_enabled = enabled;
}
@ -247,6 +247,15 @@ namespace Opm {
return m_output_dir;
}
std::string IOConfig::getInputDir() const {
std::filesystem::path path(m_deck_filename);
if (path.has_parent_path()) {
return path.parent_path();
} else {
return std::filesystem::current_path();
}
}
void IOConfig::setOutputDir(const std::string& outputDir) {
m_output_dir = outputDir;
}