Merge pull request #1365 from akva2/noecl_flush
More serialization preparation
This commit is contained in:
commit
30773db877
@ -37,10 +37,16 @@ namespace Opm {
|
||||
template <class T>
|
||||
class DynamicVector {
|
||||
public:
|
||||
DynamicVector() = default;
|
||||
|
||||
DynamicVector(const TimeMap& timeMap, T defaultValue) :
|
||||
m_data( timeMap.size(), defaultValue )
|
||||
{}
|
||||
|
||||
explicit DynamicVector(const std::vector<T>& data) :
|
||||
m_data(data)
|
||||
{}
|
||||
|
||||
const T& operator[](size_t index) const {
|
||||
return this->m_data.at( index );
|
||||
}
|
||||
@ -58,6 +64,10 @@ namespace Opm {
|
||||
(*this)[index] = std::move( value );
|
||||
}
|
||||
|
||||
const std::vector<T>& data() const {
|
||||
return m_data;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<T> m_data;
|
||||
};
|
||||
|
@ -121,9 +121,16 @@ namespace Opm
|
||||
|
||||
class Events {
|
||||
public:
|
||||
Events() = default;
|
||||
explicit Events(const TimeMap& timeMap);
|
||||
explicit Events(const DynamicVector<uint64_t>& events);
|
||||
void addEvent(ScheduleEvents::Events event, size_t reportStep);
|
||||
bool hasEvent(uint64_t eventMask, size_t reportStep) const;
|
||||
|
||||
const DynamicVector<uint64_t>& events() const;
|
||||
|
||||
bool operator==(const Events& data) const;
|
||||
|
||||
private:
|
||||
DynamicVector<uint64_t> m_events;
|
||||
};
|
||||
|
@ -67,6 +67,8 @@ namespace Opm {
|
||||
class MessageLimits {
|
||||
public:
|
||||
|
||||
|
||||
MessageLimits() = default;
|
||||
/*
|
||||
This constructor will create a new Messages object which is
|
||||
a copy of the input argument, and then all items explicitly
|
||||
@ -74,6 +76,7 @@ namespace Opm {
|
||||
*/
|
||||
|
||||
explicit MessageLimits( const TimeMap& );
|
||||
explicit MessageLimits( const DynamicState<MLimits>& );
|
||||
|
||||
///Get all the value from MESSAGES keyword.
|
||||
int getMessagePrintLimit(size_t timestep) const;
|
||||
@ -102,6 +105,9 @@ namespace Opm {
|
||||
void setErrorStopLimit(size_t timestep, int value);
|
||||
void setBugStopLimit(size_t timestep, int value);
|
||||
|
||||
const DynamicState<MLimits>& getLimits() const;
|
||||
bool operator==(const MessageLimits& data) const;
|
||||
|
||||
private:
|
||||
void update(size_t timestep, const MLimits& value);
|
||||
|
||||
|
@ -40,7 +40,14 @@ namespace Opm
|
||||
};
|
||||
|
||||
|
||||
OilVaporizationProperties();
|
||||
explicit OilVaporizationProperties(const size_t numPvtReginIdx);
|
||||
OilVaporizationProperties(OilVaporization type,
|
||||
const std::vector<double>& vap1,
|
||||
const std::vector<double>& vap2,
|
||||
const std::vector<double>& maxDRSDT,
|
||||
const std::vector<bool>& maxDRSDT_allCells,
|
||||
const std::vector<double>& maxDRVDT);
|
||||
static void updateDRSDT(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRSDT, const std::vector<std::string>& option);
|
||||
static void updateDRVDT(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRVDT);
|
||||
static void updateVAPPARS(Opm::OilVaporizationProperties& ovp, const std::vector<double>& vap1, const std::vector<double>& vap2);
|
||||
@ -56,6 +63,12 @@ namespace Opm
|
||||
bool defined() const;
|
||||
size_t numPvtRegions() const {return m_maxDRSDT.size();}
|
||||
|
||||
const std::vector<double>& vap1() const;
|
||||
const std::vector<double>& vap2() const;
|
||||
const std::vector<double>& maxDRSDT() const;
|
||||
const std::vector<bool>& maxDRSDT_allCells() const;
|
||||
const std::vector<double>& maxDRVDT() const;
|
||||
|
||||
/*
|
||||
* if either argument was default constructed == will always be false
|
||||
* and != will always be true
|
||||
|
@ -44,6 +44,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
VFPInjTable();
|
||||
VFPInjTable(int table_num,
|
||||
double datum_depth,
|
||||
FLO_TYPE flo_type,
|
||||
@ -91,6 +92,9 @@ public:
|
||||
return m_data;
|
||||
}
|
||||
|
||||
bool operator==(const VFPInjTable& data) const;
|
||||
VFPInjTable& operator=(const VFPInjTable& data);
|
||||
|
||||
private:
|
||||
|
||||
int m_table_num;
|
||||
|
@ -69,6 +69,7 @@ public:
|
||||
ALQ_INVALID
|
||||
};
|
||||
|
||||
VFPProdTable();
|
||||
VFPProdTable(int table_num,
|
||||
double datum_depth,
|
||||
FLO_TYPE flo_type,
|
||||
@ -148,6 +149,8 @@ public:
|
||||
return m_data;
|
||||
}
|
||||
|
||||
bool operator==(const VFPProdTable& data) const;
|
||||
VFPProdTable& operator=(const VFPProdTable& data);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -45,9 +45,20 @@ public:
|
||||
// the related WTEST keywords is entered and will begin
|
||||
// taking effects since this report step
|
||||
int begin_report_step;
|
||||
|
||||
bool operator==(const WTESTWell& data) const {
|
||||
return name == data.name &&
|
||||
shut_reason == data.shut_reason &&
|
||||
test_interval == data.test_interval &&
|
||||
num_test == data.num_test &&
|
||||
startup_time == data.startup_time &&
|
||||
begin_report_step == data.begin_report_step;
|
||||
}
|
||||
};
|
||||
|
||||
WellTestConfig();
|
||||
WellTestConfig(const std::vector<WTESTWell>& well);
|
||||
|
||||
void add_well(const std::string& well, Reason reason, double test_interval, int num_test, double startup_time, int current_step);
|
||||
void add_well(const std::string& well, const std::string& reasons, double test_interval,
|
||||
int num_test, double startup_time, int current_step);
|
||||
@ -57,8 +68,12 @@ public:
|
||||
const WTESTWell& get(const std::string& well, Reason reason) const;
|
||||
size_t size() const;
|
||||
|
||||
const std::vector<WTESTWell>& getWells() const;
|
||||
|
||||
static std::string reasonToString(const Reason reason);
|
||||
|
||||
bool operator==(const WellTestConfig& data) const;
|
||||
|
||||
private:
|
||||
std::vector<WTESTWell> wells;
|
||||
|
||||
|
@ -26,6 +26,10 @@ namespace Opm {
|
||||
m_events( DynamicVector<uint64_t>( timeMap , 0 ) )
|
||||
{ }
|
||||
|
||||
Events::Events(const DynamicVector<uint64_t>& events) :
|
||||
m_events(events)
|
||||
{ }
|
||||
|
||||
|
||||
bool Events::hasEvent(uint64_t eventMask , size_t reportStep) const {
|
||||
uint64_t eventSum = m_events[reportStep];
|
||||
@ -40,5 +44,13 @@ namespace Opm {
|
||||
m_events[reportStep] |= event;
|
||||
}
|
||||
|
||||
const DynamicVector<uint64_t>& Events::events() const {
|
||||
return m_events;
|
||||
}
|
||||
|
||||
bool Events::operator==(const Events& data) const {
|
||||
return this->events().data() == data.events().data();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,10 @@ namespace Opm {
|
||||
limits( timemap , MLimits())
|
||||
{ }
|
||||
|
||||
MessageLimits::MessageLimits(const DynamicState<MLimits>& limits_) :
|
||||
limits(limits_)
|
||||
{ }
|
||||
|
||||
|
||||
int MessageLimits::getMessagePrintLimit(size_t timestep) const
|
||||
{
|
||||
@ -202,6 +206,15 @@ namespace Opm {
|
||||
this->update( timestep , mlimit );
|
||||
}
|
||||
|
||||
const DynamicState<MLimits>& MessageLimits::getLimits() const
|
||||
{
|
||||
return limits;
|
||||
}
|
||||
|
||||
bool MessageLimits::operator==(const MessageLimits& data) const
|
||||
{
|
||||
return limits == data.limits;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,11 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
OilVaporizationProperties::OilVaporizationProperties()
|
||||
{
|
||||
m_type = OilVaporization::UNDEF;
|
||||
}
|
||||
|
||||
OilVaporizationProperties::OilVaporizationProperties(const size_t numPvtRegionIdx):
|
||||
m_vap1(numPvtRegionIdx, -1.0),
|
||||
m_vap2(numPvtRegionIdx, -1.0),
|
||||
@ -28,6 +33,20 @@ namespace Opm {
|
||||
m_maxDRVDT(numPvtRegionIdx, -1.0)
|
||||
{ }
|
||||
|
||||
OilVaporizationProperties::OilVaporizationProperties(OilVaporization type,
|
||||
const std::vector<double>& vap1,
|
||||
const std::vector<double>& vap2,
|
||||
const std::vector<double>& maxDRSDT,
|
||||
const std::vector<bool>& maxDRSDT_allCells,
|
||||
const std::vector<double>& maxDRVDT):
|
||||
m_type(type),
|
||||
m_vap1(vap1),
|
||||
m_vap2(vap2),
|
||||
m_maxDRSDT(maxDRSDT),
|
||||
m_maxDRSDT_allCells(maxDRSDT_allCells),
|
||||
m_maxDRVDT(maxDRVDT)
|
||||
{ }
|
||||
|
||||
double OilVaporizationProperties::getMaxDRVDT(const size_t pvtRegionIdx) const{
|
||||
if (drvdtActive()){
|
||||
return m_maxDRVDT[pvtRegionIdx];
|
||||
@ -132,4 +151,24 @@ namespace Opm {
|
||||
bool OilVaporizationProperties::operator!=( const OilVaporizationProperties& rhs ) const {
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
const std::vector<double>& OilVaporizationProperties::vap1() const {
|
||||
return m_vap1;
|
||||
}
|
||||
|
||||
const std::vector<double>& OilVaporizationProperties::vap2() const {
|
||||
return m_vap2;
|
||||
}
|
||||
|
||||
const std::vector<double>& OilVaporizationProperties::maxDRSDT() const {
|
||||
return m_maxDRSDT;
|
||||
}
|
||||
|
||||
const std::vector<bool>& OilVaporizationProperties::maxDRSDT_allCells() const {
|
||||
return m_maxDRSDT_allCells;
|
||||
}
|
||||
|
||||
const std::vector<double>& OilVaporizationProperties::maxDRVDT() const {
|
||||
return m_maxDRVDT;
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,13 @@ inline const Opm::DeckItem& getNonEmptyItem( const Opm::DeckRecord& record) {
|
||||
|
||||
namespace Opm {
|
||||
|
||||
VFPInjTable::VFPInjTable()
|
||||
{
|
||||
m_table_num = -1;
|
||||
m_datum_depth = 0.0;
|
||||
m_flo_type = FLO_INVALID;
|
||||
}
|
||||
|
||||
VFPInjTable::VFPInjTable(int table_num,
|
||||
double datum_depth,
|
||||
FLO_TYPE flo_type,
|
||||
@ -311,6 +318,32 @@ void VFPInjTable::convertTHPToSI(std::vector<double>& values,
|
||||
}
|
||||
|
||||
|
||||
bool VFPInjTable::operator==(const VFPInjTable& data) const {
|
||||
return this->getTableNum() == data.getTableNum() &&
|
||||
this->getDatumDepth () == data.getDatumDepth() &&
|
||||
this->getFloType() == data.getFloType() &&
|
||||
this->getFloAxis() == data.getFloAxis() &&
|
||||
this->getTHPAxis() == data.getTHPAxis() &&
|
||||
this->getTable() == data.getTable();
|
||||
}
|
||||
|
||||
|
||||
VFPInjTable& VFPInjTable::operator=(const VFPInjTable& data) {
|
||||
m_table_num = data.m_table_num;
|
||||
m_datum_depth = data.m_datum_depth;
|
||||
m_flo_type = data.m_flo_type;
|
||||
m_flo_data = data.m_flo_data;
|
||||
m_thp_data = data.m_thp_data;
|
||||
extents shape;
|
||||
shape[0] = data.m_data.shape()[0];
|
||||
shape[1] = data.m_data.shape()[1];
|
||||
m_data.resize(shape);
|
||||
for (size_t i = 0; i < data.m_data.num_elements(); ++i)
|
||||
*(m_data.data() + i) = *(data.m_data.data() + i);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -124,6 +124,17 @@ VFPProdTable::ALQ_TYPE getALQType( const DeckItem& item) {
|
||||
|
||||
}
|
||||
|
||||
VFPProdTable::VFPProdTable()
|
||||
{
|
||||
m_table_num = -1;
|
||||
m_datum_depth = 0.0;
|
||||
m_flo_type = FLO_INVALID;
|
||||
m_wfr_type = WFR_INVALID;
|
||||
m_gfr_type = GFR_INVALID;
|
||||
m_alq_type = ALQ_INVALID;
|
||||
|
||||
}
|
||||
|
||||
VFPProdTable::VFPProdTable(int table_num,
|
||||
double datum_depth,
|
||||
FLO_TYPE flo_type,
|
||||
@ -515,4 +526,42 @@ void VFPProdTable::convertGFRToSI(const GFR_TYPE& type,
|
||||
scaleValues(values, scaling_factor);
|
||||
}
|
||||
|
||||
|
||||
bool VFPProdTable::operator==(const VFPProdTable& data) const {
|
||||
return this->getTableNum() == data.getTableNum() &&
|
||||
this->getDatumDepth () == data.getDatumDepth() &&
|
||||
this->getFloType() == data.getFloType() &&
|
||||
this->getWFRType() == data.getWFRType() &&
|
||||
this->getGFRType() == data.getGFRType() &&
|
||||
this->getALQType() == data.getALQType() &&
|
||||
this->getFloAxis() == data.getFloAxis() &&
|
||||
this->getTHPAxis() == data.getTHPAxis() &&
|
||||
this->getWFRAxis() == data.getWFRAxis() &&
|
||||
this->getGFRAxis() == data.getGFRAxis() &&
|
||||
this->getALQAxis() == data.getALQAxis() &&
|
||||
this->getTable() == data.getTable();
|
||||
}
|
||||
|
||||
|
||||
VFPProdTable& VFPProdTable::operator=(const VFPProdTable& data) {
|
||||
m_table_num = data.m_table_num;
|
||||
m_datum_depth = data.m_datum_depth;
|
||||
m_flo_type = data.m_flo_type;
|
||||
m_wfr_type = data.m_wfr_type;
|
||||
m_gfr_type = data.m_gfr_type;
|
||||
m_alq_type = data.m_alq_type;
|
||||
m_flo_data = data.m_flo_data;
|
||||
m_thp_data = data.m_thp_data;
|
||||
m_wfr_data = data.m_wfr_data;
|
||||
m_gfr_data = data.m_gfr_data;
|
||||
m_alq_data = data.m_alq_data;
|
||||
extents shape;
|
||||
for (size_t i = 0; i < 5; ++i)
|
||||
shape[i] = data.m_data.shape()[i];
|
||||
m_data.resize(shape);
|
||||
for (size_t i = 0; i < data.m_data.num_elements(); ++i)
|
||||
*(m_data.data() + i) = *(data.m_data.data() + i);
|
||||
return *this;
|
||||
}
|
||||
|
||||
} //Namespace opm
|
||||
|
@ -28,6 +28,12 @@ WellTestConfig::WellTestConfig() {
|
||||
|
||||
}
|
||||
|
||||
WellTestConfig::WellTestConfig(const std::vector<WTESTWell>& well)
|
||||
: wells(well)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void WellTestConfig::add_well(const std::string& well, Reason shut_reason, double test_interval,
|
||||
int num_retries, double startup_time, const int current_step) {
|
||||
|
||||
@ -144,6 +150,18 @@ size_t WellTestConfig::size() const {
|
||||
return wells.size();
|
||||
}
|
||||
|
||||
|
||||
const std::vector<WellTestConfig::WTESTWell>& WellTestConfig::getWells() const {
|
||||
return wells;
|
||||
}
|
||||
|
||||
|
||||
bool WellTestConfig::operator==(const WellTestConfig& data) const {
|
||||
return this->getWells() == data.getWells();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user