Merge pull request #1349 from akva2/noecl_flush
Another round of serialization preparation
This commit is contained in:
@@ -19,9 +19,13 @@ namespace Opm {
|
||||
bool wetGasInitConstantRv() const;
|
||||
int initializationTargetAccuracy() const;
|
||||
|
||||
EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy);
|
||||
private:
|
||||
EquilRecord();
|
||||
|
||||
EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy);
|
||||
|
||||
bool operator==(const EquilRecord& data) const;
|
||||
|
||||
private:
|
||||
double datum_depth;
|
||||
double datum_depth_ps;
|
||||
double water_oil_contact_depth;
|
||||
@@ -40,8 +44,10 @@ namespace Opm {
|
||||
|
||||
Equil() = default;
|
||||
explicit Equil( const DeckKeyword& );
|
||||
Equil(const std::vector<EquilRecord>& records);
|
||||
|
||||
const EquilRecord& getRecord( size_t id ) const;
|
||||
const std::vector<EquilRecord>& records() const;
|
||||
|
||||
size_t size() const;
|
||||
bool empty() const;
|
||||
@@ -49,8 +55,10 @@ namespace Opm {
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
|
||||
bool operator==(const Equil& data) const;
|
||||
|
||||
private:
|
||||
std::vector< EquilRecord > records;
|
||||
std::vector< EquilRecord > m_records;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -33,8 +33,14 @@ class DeckRecord;
|
||||
class FoamData
|
||||
{
|
||||
public:
|
||||
FoamData();
|
||||
FoamData(const DeckRecord& FOAMFSC_record, const DeckRecord& FOAMROCK_record);
|
||||
explicit FoamData(const DeckRecord& FOAMROCK_record);
|
||||
FoamData(double reference_surfactant_concentration,
|
||||
double exponent,
|
||||
double minimum_surfactant_concentration,
|
||||
bool allow_desorption,
|
||||
double rock_density);
|
||||
|
||||
double referenceSurfactantConcentration() const;
|
||||
double exponent() const;
|
||||
@@ -43,6 +49,8 @@ public:
|
||||
bool allowDesorption() const;
|
||||
double rockDensity() const;
|
||||
|
||||
bool operator==(const FoamData& data) const;
|
||||
|
||||
private:
|
||||
double reference_surfactant_concentration_;
|
||||
double exponent_;
|
||||
@@ -57,8 +65,10 @@ class FoamConfig
|
||||
public:
|
||||
FoamConfig() = default;
|
||||
explicit FoamConfig(const Deck&);
|
||||
FoamConfig(const std::vector<FoamData>& data);
|
||||
|
||||
const FoamData& getRecord(std::size_t index) const;
|
||||
const std::vector<FoamData>& records() const;
|
||||
|
||||
std::size_t size() const;
|
||||
bool empty() const;
|
||||
@@ -67,6 +77,8 @@ public:
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
|
||||
bool operator==(const FoamConfig& data) const;
|
||||
|
||||
private:
|
||||
std::vector<FoamData> data_;
|
||||
};
|
||||
|
||||
@@ -32,7 +32,11 @@ namespace Opm {
|
||||
class InitConfig {
|
||||
|
||||
public:
|
||||
InitConfig();
|
||||
explicit InitConfig(const Deck& deck);
|
||||
InitConfig(const Equil& equil, const FoamConfig& foam,
|
||||
bool filleps, bool restartReq, int restartStep,
|
||||
const std::string& restartRootName);
|
||||
|
||||
void setRestart( const std::string& root, int step);
|
||||
bool restartRequested() const;
|
||||
@@ -50,6 +54,8 @@ namespace Opm {
|
||||
return this->m_filleps;
|
||||
}
|
||||
|
||||
bool operator==(const InitConfig& config) const;
|
||||
|
||||
private:
|
||||
Equil equil;
|
||||
FoamConfig foamconfig;
|
||||
|
||||
@@ -32,10 +32,13 @@ namespace Opm {
|
||||
|
||||
public:
|
||||
|
||||
SimulationConfig();
|
||||
SimulationConfig(bool restart,
|
||||
const Deck& deck,
|
||||
const FieldPropsManager& fp,
|
||||
const Eclipse3DProperties& gridProperties);
|
||||
SimulationConfig(const ThresholdPressure& thresholdPressure,
|
||||
bool useCPR, bool DISGAS, bool VAPOIL, bool isThermal);
|
||||
|
||||
const ThresholdPressure& getThresholdPressure() const;
|
||||
bool useThresholdPressure() const;
|
||||
@@ -44,6 +47,8 @@ namespace Opm {
|
||||
bool hasVAPOIL() const;
|
||||
bool isThermal() const;
|
||||
|
||||
bool operator==(const SimulationConfig& data) const;
|
||||
|
||||
private:
|
||||
ThresholdPressure m_ThresholdPressure;
|
||||
bool m_useCPR;
|
||||
|
||||
@@ -37,7 +37,14 @@ namespace Opm {
|
||||
public:
|
||||
SimpleTable() = default;
|
||||
SimpleTable(TableSchema, const DeckItem& deckItem);
|
||||
SimpleTable(const TableSchema& schema,
|
||||
const OrderedMap<std::string, TableColumn>& columns,
|
||||
bool jfunc);
|
||||
explicit SimpleTable( TableSchema );
|
||||
|
||||
const TableSchema& schema() const;
|
||||
const OrderedMap<std::string, TableColumn>& columns() const;
|
||||
bool jfunc() const;
|
||||
void addColumns();
|
||||
void init(const DeckItem& deckItem );
|
||||
size_t numColumns() const;
|
||||
@@ -63,6 +70,8 @@ namespace Opm {
|
||||
/// throws std::invalid_argument if jf != m_jfunc
|
||||
void assertJFuncPressure(const bool jf) const;
|
||||
|
||||
bool operator==(const SimpleTable& data) const;
|
||||
|
||||
protected:
|
||||
TableSchema m_schema;
|
||||
OrderedMap<std::string, TableColumn> m_columns;
|
||||
|
||||
@@ -31,9 +31,19 @@ namespace Opm {
|
||||
|
||||
class TableColumn {
|
||||
public:
|
||||
TableColumn();
|
||||
explicit TableColumn( const ColumnSchema& schema );
|
||||
TableColumn(const ColumnSchema& schema,
|
||||
const std::string& name,
|
||||
const std::vector<double>& values,
|
||||
const std::vector<bool>& defaults,
|
||||
size_t defaultCount);
|
||||
size_t size( ) const;
|
||||
const ColumnSchema& schema() const;
|
||||
const std::string& name() const;
|
||||
const std::vector<double>& values() const;
|
||||
const std::vector<bool>& defaults() const;
|
||||
size_t defaultCount() const;
|
||||
void assertOrder(double value1 , double value2) const;
|
||||
void addValue(double);
|
||||
void addDefault();
|
||||
@@ -60,6 +70,9 @@ namespace Opm {
|
||||
std::vector<double> vectorCopy() const;
|
||||
std::vector<double>::const_iterator begin() const;
|
||||
std::vector<double>::const_iterator end() const;
|
||||
|
||||
bool operator==(const TableColumn& data) const;
|
||||
|
||||
private:
|
||||
void assertUpdate(size_t index, double value) const;
|
||||
void assertPrevious(size_t index , double value) const;
|
||||
|
||||
@@ -59,6 +59,9 @@ namespace Opm {
|
||||
container.gteTable(10 ) ==> exception
|
||||
*/
|
||||
public:
|
||||
using TableMap = std::map<size_t, std::shared_ptr<const SimpleTable>>;
|
||||
|
||||
TableContainer();
|
||||
explicit TableContainer( size_t maxTables );
|
||||
bool empty() const;
|
||||
|
||||
@@ -66,6 +69,9 @@ namespace Opm {
|
||||
This is the number of actual tables in the container.
|
||||
*/
|
||||
size_t size() const;
|
||||
|
||||
size_t max() const;
|
||||
const TableMap& tables() const;
|
||||
void addTable(size_t tableNumber , std::shared_ptr<const SimpleTable> table);
|
||||
|
||||
|
||||
@@ -84,9 +90,11 @@ namespace Opm {
|
||||
return *table;
|
||||
}
|
||||
|
||||
bool operator==(const TableContainer& data) const;
|
||||
|
||||
private:
|
||||
size_t m_maxTables;
|
||||
std::map<size_t , std::shared_ptr<const SimpleTable> > m_tables;
|
||||
TableMap m_tables;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
EquilRecord::EquilRecord() :
|
||||
EquilRecord(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, false, 0.0)
|
||||
{
|
||||
}
|
||||
|
||||
EquilRecord::EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy) :
|
||||
datum_depth(datum_depth_arg),
|
||||
datum_depth_ps(datum_depth_pc_arg),
|
||||
@@ -51,6 +56,20 @@ namespace Opm {
|
||||
return this->init_target_accuracy;
|
||||
}
|
||||
|
||||
bool EquilRecord::operator==(const EquilRecord& data) const {
|
||||
return datum_depth == data.datum_depth &&
|
||||
datum_depth_ps == data.datum_depth_ps &&
|
||||
water_oil_contact_depth == data.water_oil_contact_depth &&
|
||||
water_oil_contact_capillary_pressure ==
|
||||
data.water_oil_contact_capillary_pressure &&
|
||||
data.gas_oil_contact_depth == data.gas_oil_contact_depth &&
|
||||
gas_oil_contact_capillary_pressure ==
|
||||
data.gas_oil_contact_capillary_pressure &&
|
||||
live_oil_init_proc == data.live_oil_init_proc &&
|
||||
wet_gas_init_proc == data.wet_gas_init_proc &&
|
||||
init_target_accuracy == data.init_target_accuracy;
|
||||
}
|
||||
|
||||
/* */
|
||||
|
||||
Equil::Equil( const DeckKeyword& keyword )
|
||||
@@ -66,27 +85,40 @@ namespace Opm {
|
||||
auto wet_gas_init = record.getItem(7).get<int>(0) <= 0;
|
||||
auto target_accuracy = record.getItem(8).get<int>(0);
|
||||
|
||||
this->records.push_back( EquilRecord(datum_depth_arg, datum_depth_pc_arg, woc_depth, woc_pc, goc_depth, goc_pc, live_oil_init, wet_gas_init, target_accuracy) );
|
||||
this->m_records.push_back( EquilRecord(datum_depth_arg, datum_depth_pc_arg, woc_depth, woc_pc, goc_depth, goc_pc, live_oil_init, wet_gas_init, target_accuracy) );
|
||||
}
|
||||
}
|
||||
|
||||
Equil::Equil(const std::vector<EquilRecord>& records) :
|
||||
m_records(records)
|
||||
{
|
||||
}
|
||||
|
||||
const EquilRecord& Equil::getRecord( size_t id ) const {
|
||||
return this->records.at( id );
|
||||
return this->m_records.at( id );
|
||||
}
|
||||
|
||||
const std::vector<EquilRecord>& Equil::records() const {
|
||||
return m_records;
|
||||
}
|
||||
|
||||
size_t Equil::size() const {
|
||||
return this->records.size();
|
||||
return this->m_records.size();
|
||||
}
|
||||
|
||||
bool Equil::empty() const {
|
||||
return this->records.empty();
|
||||
return this->m_records.empty();
|
||||
}
|
||||
|
||||
Equil::const_iterator Equil::begin() const {
|
||||
return this->records.begin();
|
||||
return this->m_records.begin();
|
||||
}
|
||||
|
||||
Equil::const_iterator Equil::end() const {
|
||||
return this->records.end();
|
||||
return this->m_records.end();
|
||||
}
|
||||
|
||||
bool Equil::operator==(const Equil& data) const {
|
||||
return this->records() == data.records();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,14 @@ namespace Opm
|
||||
|
||||
// FoamData member functions.
|
||||
|
||||
FoamData::FoamData()
|
||||
: FoamData(0.0,
|
||||
ParserKeywords::FOAMFSC::EXPONENT::defaultValue,
|
||||
ParserKeywords::FOAMFSC::MIN_SURF_CONC::defaultValue,
|
||||
false, 1.0)
|
||||
{
|
||||
}
|
||||
|
||||
FoamData::FoamData(const DeckRecord& FOAMFSC_record, const DeckRecord& FOAMROCK_record)
|
||||
: reference_surfactant_concentration_(FOAMFSC_record.getItem(0).getSIDouble(0))
|
||||
, exponent_(FOAMFSC_record.getItem(1).getSIDouble(0))
|
||||
@@ -59,6 +67,19 @@ FoamData::FoamData(const DeckRecord& FOAMROCK_record)
|
||||
allow_desorption_ = (ads_ind == 1);
|
||||
}
|
||||
|
||||
FoamData::FoamData(double reference_surfactant_concentration,
|
||||
double exponent,
|
||||
double minimum_surfactant_concentration,
|
||||
bool allow_desorption,
|
||||
double rock_density)
|
||||
: reference_surfactant_concentration_(reference_surfactant_concentration)
|
||||
, exponent_(exponent)
|
||||
, minimum_surfactant_concentration_(minimum_surfactant_concentration)
|
||||
, allow_desorption_(allow_desorption)
|
||||
, rock_density_(rock_density)
|
||||
{
|
||||
}
|
||||
|
||||
double
|
||||
FoamData::referenceSurfactantConcentration() const
|
||||
{
|
||||
@@ -89,6 +110,18 @@ FoamData::rockDensity() const
|
||||
return this->rock_density_;
|
||||
}
|
||||
|
||||
bool
|
||||
FoamData::operator==(const FoamData& data) const
|
||||
{
|
||||
return reference_surfactant_concentration_ ==
|
||||
data.reference_surfactant_concentration_ &&
|
||||
exponent_ == data.exponent_ &&
|
||||
minimum_surfactant_concentration_ ==
|
||||
data.minimum_surfactant_concentration_ &&
|
||||
allow_desorption_ == data.allow_desorption_ &&
|
||||
rock_density_ == data.rock_density_;
|
||||
}
|
||||
|
||||
// FoamConfig member functions.
|
||||
|
||||
FoamConfig::FoamConfig(const Deck& deck)
|
||||
@@ -128,12 +161,23 @@ FoamConfig::FoamConfig(const Deck& deck)
|
||||
}
|
||||
}
|
||||
|
||||
FoamConfig::FoamConfig(const std::vector<FoamData>& data)
|
||||
: data_(data)
|
||||
{
|
||||
}
|
||||
|
||||
const FoamData&
|
||||
FoamConfig::getRecord(std::size_t index) const
|
||||
{
|
||||
return this->data_.at(index);
|
||||
}
|
||||
|
||||
const std::vector<FoamData>&
|
||||
FoamConfig::records() const
|
||||
{
|
||||
return this->data_;
|
||||
}
|
||||
|
||||
std::size_t
|
||||
FoamConfig::size() const
|
||||
{
|
||||
@@ -157,4 +201,11 @@ FoamConfig::end() const
|
||||
{
|
||||
return this->data_.end();
|
||||
}
|
||||
|
||||
bool
|
||||
FoamConfig::operator==(const FoamConfig& data) const
|
||||
{
|
||||
return data_ == data.data_;
|
||||
}
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
@@ -38,6 +38,11 @@ namespace Opm {
|
||||
return Equil( deck.getKeyword<ParserKeywords::EQUIL>( ) );
|
||||
}
|
||||
|
||||
InitConfig::InitConfig()
|
||||
: m_filleps(false)
|
||||
{
|
||||
}
|
||||
|
||||
InitConfig::InitConfig(const Deck& deck)
|
||||
: equil(equils(deck))
|
||||
, foamconfig(deck)
|
||||
@@ -71,6 +76,18 @@ namespace Opm {
|
||||
this->setRestart( input_path + "/" + root, step );
|
||||
}
|
||||
|
||||
InitConfig::InitConfig(const Equil& equils, const FoamConfig& foam,
|
||||
bool filleps, bool restartReq, int restartStep,
|
||||
const std::string& restartRootName)
|
||||
: equil(equils)
|
||||
, foamconfig(foam)
|
||||
, m_filleps(filleps)
|
||||
, m_restartRequested(restartReq)
|
||||
, m_restartStep(restartStep)
|
||||
, m_restartRootName(restartRootName)
|
||||
{
|
||||
}
|
||||
|
||||
void InitConfig::setRestart( const std::string& root, int step) {
|
||||
m_restartRequested = true;
|
||||
m_restartStep = step;
|
||||
@@ -112,4 +129,13 @@ namespace Opm {
|
||||
return this->foamconfig;
|
||||
}
|
||||
|
||||
bool InitConfig::operator==(const InitConfig& data) const {
|
||||
return equil == data.equil &&
|
||||
foamconfig == data.foamconfig &&
|
||||
m_filleps == data.m_filleps &&
|
||||
m_restartRequested == data.m_restartRequested &&
|
||||
m_restartStep == data.m_restartStep &&
|
||||
m_restartRootName == data.m_restartRootName;
|
||||
}
|
||||
|
||||
} //namespace Opm
|
||||
|
||||
@@ -48,6 +48,11 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
SimulationConfig::SimulationConfig() :
|
||||
SimulationConfig(ThresholdPressure(), false, false, false, false)
|
||||
{
|
||||
}
|
||||
|
||||
SimulationConfig::SimulationConfig(bool restart,
|
||||
const Deck& deck,
|
||||
const FieldPropsManager& fp,
|
||||
@@ -79,6 +84,17 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
SimulationConfig::SimulationConfig(const ThresholdPressure& thresholdPressure,
|
||||
bool useCPR, bool DISGAS,
|
||||
bool VAPOIL, bool isThermal) :
|
||||
m_ThresholdPressure(thresholdPressure),
|
||||
m_useCPR(useCPR),
|
||||
m_DISGAS(DISGAS),
|
||||
m_VAPOIL(VAPOIL),
|
||||
m_isThermal(isThermal)
|
||||
{
|
||||
}
|
||||
|
||||
const ThresholdPressure& SimulationConfig::getThresholdPressure() const {
|
||||
return m_ThresholdPressure;
|
||||
}
|
||||
@@ -103,4 +119,12 @@ namespace Opm {
|
||||
return this->m_isThermal;
|
||||
}
|
||||
|
||||
bool SimulationConfig::operator==(const SimulationConfig& data) const {
|
||||
return this->getThresholdPressure() == data.getThresholdPressure() &&
|
||||
this->useCPR() == data.useCPR() &&
|
||||
this->hasDISGAS() == data.hasDISGAS() &&
|
||||
this->hasVAPOIL() == data.hasVAPOIL() &&
|
||||
this->isThermal() == data.isThermal();
|
||||
}
|
||||
|
||||
} //namespace Opm
|
||||
|
||||
@@ -41,6 +41,30 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
SimpleTable::SimpleTable(const TableSchema& schema,
|
||||
const OrderedMap<std::string, TableColumn>& columns,
|
||||
bool jf) :
|
||||
m_schema(schema),
|
||||
m_columns(columns),
|
||||
m_jfunc(jf)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
const TableSchema& SimpleTable::schema() const {
|
||||
return m_schema;
|
||||
}
|
||||
|
||||
|
||||
const OrderedMap<std::string, TableColumn>& SimpleTable::columns() const {
|
||||
return m_columns;
|
||||
}
|
||||
|
||||
|
||||
bool SimpleTable::jfunc() const {
|
||||
return m_jfunc;
|
||||
}
|
||||
|
||||
void SimpleTable::addRow( const std::vector<double>& row) {
|
||||
if (row.size() == numColumns()) {
|
||||
for (size_t colIndex = 0; colIndex < numColumns(); colIndex++) {
|
||||
@@ -157,4 +181,11 @@ namespace Opm {
|
||||
else
|
||||
std::cerr << "Developer warning: Raw values from JFUNC column is read, but JFUNC not provided in deck." << std::endl;
|
||||
}
|
||||
|
||||
|
||||
bool SimpleTable::operator==(const SimpleTable& data) const {
|
||||
return this->schema() == data.schema() &&
|
||||
this->columns() == data.columns() &&
|
||||
this->jfunc() == data.jfunc();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
TableColumn::TableColumn()
|
||||
{
|
||||
m_defaultCount = 0;
|
||||
}
|
||||
|
||||
TableColumn::TableColumn(const ColumnSchema& schema) :
|
||||
m_schema( schema )
|
||||
{
|
||||
@@ -33,6 +38,19 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
TableColumn::TableColumn(const ColumnSchema& schema,
|
||||
const std::string& name,
|
||||
const std::vector<double>& values,
|
||||
const std::vector<bool>& defaults,
|
||||
size_t defaultCount) :
|
||||
m_schema(schema),
|
||||
m_name(name),
|
||||
m_values(values),
|
||||
m_default(defaults),
|
||||
m_defaultCount(defaultCount)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
size_t TableColumn::size() const {
|
||||
return m_values.size();
|
||||
@@ -44,10 +62,26 @@ namespace Opm {
|
||||
throw std::invalid_argument("Incorrect ordering of values in column: " + m_schema.name());
|
||||
}
|
||||
|
||||
const ColumnSchema& TableColumn::schema() const {
|
||||
return m_schema;
|
||||
}
|
||||
|
||||
const std::string& TableColumn::name() const {
|
||||
return m_name;
|
||||
}
|
||||
|
||||
const std::vector<double>& TableColumn::values() const {
|
||||
return m_values;
|
||||
}
|
||||
|
||||
const std::vector<bool>& TableColumn::defaults() const {
|
||||
return m_default;
|
||||
}
|
||||
|
||||
size_t TableColumn::defaultCount() const {
|
||||
return m_defaultCount;
|
||||
}
|
||||
|
||||
void TableColumn::assertNext(size_t index , double value) const {
|
||||
size_t nextIndex = index + 1;
|
||||
if (nextIndex < m_values.size()) {
|
||||
@@ -324,6 +358,14 @@ namespace Opm {
|
||||
return std::vector<double>( begin() , end());
|
||||
}
|
||||
|
||||
bool TableColumn::operator==(const TableColumn& data) const {
|
||||
return this->schema() == data.schema() &&
|
||||
this->name() == data.name() &&
|
||||
this->values() == data.values() &&
|
||||
this->defaults() == data.defaults() &&
|
||||
this->defaultCount() == data.defaultCount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,10 +20,16 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/SimpleTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TableContainer.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
TableContainer::TableContainer() :
|
||||
m_maxTables(0)
|
||||
{
|
||||
}
|
||||
|
||||
TableContainer::TableContainer(size_t maxTables) :
|
||||
m_maxTables(maxTables)
|
||||
{
|
||||
@@ -40,6 +46,15 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
size_t TableContainer::max() const {
|
||||
return m_maxTables;
|
||||
}
|
||||
|
||||
const TableContainer::TableMap& TableContainer::tables() const {
|
||||
return m_tables;
|
||||
}
|
||||
|
||||
|
||||
size_t TableContainer::hasTable(size_t tableNumber) const {
|
||||
if (m_tables.find( tableNumber ) == m_tables.end())
|
||||
return false;
|
||||
@@ -74,6 +89,23 @@ namespace Opm {
|
||||
|
||||
m_tables[tableNumber] = table;
|
||||
}
|
||||
|
||||
|
||||
bool TableContainer::operator==(const TableContainer& data) const {
|
||||
if (this->max() != data.max())
|
||||
return false;
|
||||
if (this->size() != data.size())
|
||||
return false;
|
||||
for (const auto& it : m_tables) {
|
||||
auto it2 = data.m_tables.find(it.first);
|
||||
if (it2 == data.m_tables.end())
|
||||
return false;
|
||||
if (!(*it.second == *it2->second))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user