OPM-250: Added method to IOConfig to support restart

This commit is contained in:
chflo
2015-12-09 14:36:09 +01:00
parent 3ba7382146
commit 43216273b4
2 changed files with 18 additions and 1 deletions
@@ -22,6 +22,9 @@
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
#include <opm/parser/eclipse/Deck/Section.hpp>
#include <ert/ecl/ecl_util.h>
namespace Opm {
@@ -295,10 +298,12 @@ namespace Opm {
return m_FMTOUT;
}
const std::string& IOConfig::getEclipseInputPath() const {
return m_eclipse_input_path;
}
void IOConfig::setWriteInitialRestartFile(bool writeInitialRestartFile) {
m_write_initial_RST_file = writeInitialRestartFile;
}
@@ -370,4 +375,16 @@ namespace Opm {
}
std::string IOConfig::getRestartFileName(const std::string& restart_base, int report_step, bool output) const {
bool unified = output ? getUNIFOUT() : getUNIFIN();
bool fmt_file = output ? getFMTOUT() : getFMTIN();
ecl_file_enum file_type = (unified) ? ECL_UNIFIED_RESTART_FILE : ECL_RESTART_FILE;
char * c_str = ecl_util_alloc_filename( NULL , restart_base.c_str() , file_type, fmt_file , report_step);
std::string restart_filename = c_str;
free( c_str );
return restart_filename;
}
} //namespace Opm
@@ -140,7 +140,7 @@ namespace Opm {
boost::gregorian::date getTimestepDate(size_t timestep) const;
void dumpRestartConfig() const;
std::string getRestartFileName(const std::string& restart_base, int report_step, bool output) const;
private: