added: getInputDir in IOConfig
returns the input directory
This commit is contained in:
parent
1c0ddf1402
commit
ca83776c34
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user