allow constructing IOConfig from variables
also add accessors and equality operator
This commit is contained in:
@@ -151,6 +151,16 @@ namespace Opm {
|
||||
IOConfig() = default;
|
||||
explicit IOConfig( const Deck& );
|
||||
explicit IOConfig( const std::string& input_path );
|
||||
IOConfig(bool write_init, bool write_egrid,
|
||||
bool unifin, bool unifout,
|
||||
bool fmtin, bool fmtout,
|
||||
int firstRestartStep,
|
||||
const std::string& deck_name,
|
||||
bool output_enabled,
|
||||
const std::string& output_dir,
|
||||
bool no_sim,
|
||||
const std::string& base_name,
|
||||
bool ecl_compatible_rst);
|
||||
|
||||
void setEclCompatibleRST(bool ecl_rst);
|
||||
bool getEclCompatibleRST() const;
|
||||
@@ -160,6 +170,8 @@ namespace Opm {
|
||||
bool getUNIFIN() const;
|
||||
bool getFMTIN() const;
|
||||
bool getFMTOUT() const;
|
||||
const std::string& getDeckFileName() const;
|
||||
bool getNoSim() const;
|
||||
const std::string& getEclipseInputPath() const;
|
||||
|
||||
void overrideNOSIM(bool nosim);
|
||||
@@ -188,6 +200,8 @@ namespace Opm {
|
||||
void overrideRestartWriteInterval(size_t interval);
|
||||
void setWriteInitialRestartFile(bool writeInitialRestartFile);
|
||||
|
||||
bool operator==(const IOConfig& data) const;
|
||||
|
||||
private:
|
||||
bool m_write_INIT_file = false;
|
||||
bool m_write_EGRID_file = true;
|
||||
|
||||
@@ -88,6 +88,34 @@ namespace Opm {
|
||||
this->setBaseName(basename(input_path));
|
||||
}
|
||||
|
||||
IOConfig::IOConfig(bool write_init, bool write_egrid,
|
||||
bool unifin, bool unifout,
|
||||
bool fmtin, bool fmtout,
|
||||
int firstRestartStep,
|
||||
const std::string& deck_name,
|
||||
bool output_enabled,
|
||||
const std::string& output_dir,
|
||||
bool no_sim,
|
||||
const std::string& base_name,
|
||||
bool ecl_compatible_r) :
|
||||
m_write_INIT_file(write_init),
|
||||
m_write_EGRID_file(write_egrid),
|
||||
m_UNIFIN(unifin),
|
||||
m_UNIFOUT(unifout),
|
||||
m_FMTIN(fmtin),
|
||||
m_FMTOUT(fmtout),
|
||||
m_first_restart_step(firstRestartStep),
|
||||
m_deck_filename(deck_name),
|
||||
m_output_enabled(output_enabled),
|
||||
m_output_dir(output_dir),
|
||||
m_nosim(no_sim),
|
||||
m_base_name(base_name),
|
||||
ecl_compatible_rst(ecl_compatible_r)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
static inline bool write_egrid_file( const GRIDSection& grid ) {
|
||||
if( grid.hasKeyword( "NOGGF" ) ) return false;
|
||||
if( !grid.hasKeyword( "GRIDFILE" ) ) return true;
|
||||
@@ -255,6 +283,38 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
int IOConfig::getFirstRestartStep() const {
|
||||
return m_first_restart_step;
|
||||
}
|
||||
|
||||
|
||||
const std::string& IOConfig::getDeckFileName() const {
|
||||
return m_deck_filename;
|
||||
}
|
||||
|
||||
|
||||
bool IOConfig::getNoSim() const {
|
||||
return m_nosim;
|
||||
}
|
||||
|
||||
|
||||
bool IOConfig::operator==(const IOConfig& data) const {
|
||||
return this->getWriteINITFile() == data.getWriteINITFile() &&
|
||||
this->getWriteEGRIDFile() == data.getWriteEGRIDFile() &&
|
||||
this->getUNIFIN() == data.getUNIFIN() &&
|
||||
this->getUNIFOUT() == data.getUNIFOUT() &&
|
||||
this->getFMTIN() == data.getFMTIN() &&
|
||||
this->getFMTOUT() == data.getFMTOUT() &&
|
||||
this->getFirstRestartStep() == data.getFirstRestartStep() &&
|
||||
this->getDeckFileName() == data.getDeckFileName() &&
|
||||
this->getOutputEnabled() == data.getOutputEnabled() &&
|
||||
this->getOutputDir() == data.getOutputDir() &&
|
||||
this->getNoSim() == data.getNoSim() &&
|
||||
this->getBaseName() == data.getBaseName() &&
|
||||
this->getEclCompatibleRST() == data.getEclCompatibleRST();
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************/
|
||||
/* Here at the bottom are some forwarding proxy methods which just
|
||||
forward to the appropriate RestartConfig method. They are
|
||||
|
||||
Reference in New Issue
Block a user