Merge pull request #1407 from akva2/noecl_flush_schedule

More serialization effort
This commit is contained in:
Bård Skaflestad 2020-01-17 15:35:51 +01:00 committed by GitHub
commit 1132857324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 52 additions and 11 deletions

View File

@ -45,6 +45,11 @@ namespace Opm {
explicit TimeStampUTC(const std::time_t tp); explicit TimeStampUTC(const std::time_t tp);
explicit TimeStampUTC(const YMD& ymd); explicit TimeStampUTC(const YMD& ymd);
TimeStampUTC(const YMD& ymd,
int hour,
int minutes,
int seconds,
int usec);
TimeStampUTC& operator=(const std::time_t tp); TimeStampUTC& operator=(const std::time_t tp);
bool operator==(const TimeStampUTC& data) const; bool operator==(const TimeStampUTC& data) const;
@ -54,6 +59,7 @@ namespace Opm {
TimeStampUTC& seconds(const int s); TimeStampUTC& seconds(const int s);
TimeStampUTC& microseconds(const int us); TimeStampUTC& microseconds(const int us);
const YMD& ymd() const { return ymd_; }
int year() const { return this->ymd_.year; } int year() const { return this->ymd_.year; }
int month() const { return this->ymd_.month; } int month() const { return this->ymd_.month; }
int day() const { return this->ymd_.day; } int day() const { return this->ymd_.day; }

View File

@ -35,6 +35,8 @@ public:
explicit UDAValue(double); explicit UDAValue(double);
explicit UDAValue(const std::string&); explicit UDAValue(const std::string&);
UDAValue(const UDAValue& src, const Dimension& dim); UDAValue(const UDAValue& src, const Dimension& dim);
UDAValue(double data, const Dimension& dim);
UDAValue(const std::string& data, const Dimension& dim);
/* /*
The get<double>() and get<std::string>() methods will throw an The get<double>() and get<std::string>() methods will throw an

View File

@ -102,6 +102,7 @@ namespace Opm {
double r0, double r0,
double skinFactor, double skinFactor,
const std::array<int,3>& IJK, const std::array<int,3>& IJK,
CTFKind kind,
std::size_t seqIndex, std::size_t seqIndex,
double segDistStart, double segDistStart,
double segDistEnd, double segDistEnd,
@ -128,6 +129,7 @@ namespace Opm {
double r0() const; double r0() const;
double skinFactor() const; double skinFactor() const;
double wellPi() const; double wellPi() const;
CTFKind kind() const;
void setState(State state); void setState(State state);
void setComplnum(int compnum); void setComplnum(int compnum);

View File

@ -202,8 +202,8 @@ public:
UDAValue BHPTarget; UDAValue BHPTarget;
UDAValue THPTarget; UDAValue THPTarget;
double bhp_hist_limit; double bhp_hist_limit = 0.0;
double thp_hist_limit = 0; double thp_hist_limit = 0.0;
double temperature; double temperature;
double BHPH; double BHPH;
@ -308,8 +308,8 @@ public:
UDAValue THPTarget; UDAValue THPTarget;
// BHP and THP limit // BHP and THP limit
double bhp_hist_limit; double bhp_hist_limit = 0.0;
double thp_hist_limit = 0; double thp_hist_limit = 0.0;
// historical BHP and THP under historical mode // historical BHP and THP under historical mode
double BHPH = 0.0; double BHPH = 0.0;

View File

@ -50,9 +50,9 @@ public:
{ {
} }
const index_type getIndex() const { return m_map; } const index_type& getIndex() const { return m_map; }
const storage_type getStorage() const { return m_vector; } const storage_type& getStorage() const { return m_vector; }
std::size_t count(const K& key) const { std::size_t count(const K& key) const {
return this->m_map.count(key); return this->m_map.count(key);

View File

@ -27,7 +27,8 @@ namespace Opm {
class Dimension { class Dimension {
public: public:
Dimension(); Dimension();
Dimension(const std::string& name, double SIfactor, double SIoffset = 0.0); Dimension(const std::string& name, double SIfactor,
double SIoffset = 0.0, bool sanityCheck = true);
double getSIScaling() const; double getSIScaling() const;
double getSIScalingRaw() const; double getSIScalingRaw() const;

View File

@ -63,6 +63,15 @@ Opm::TimeStampUTC::TimeStampUTC(const std::time_t tp)
this->hour(tm.tm_hour).minutes(tm.tm_min).seconds(tm.tm_sec); this->hour(tm.tm_hour).minutes(tm.tm_min).seconds(tm.tm_sec);
} }
Opm::TimeStampUTC::TimeStampUTC(const Opm::TimeStampUTC::YMD& ymd,
int hour, int minutes, int seconds, int usec)
: ymd_(ymd)
, hour_(hour)
, minutes_(minutes)
, seconds_(seconds)
, usec_(usec)
{}
Opm::TimeStampUTC& Opm::TimeStampUTC::operator=(const std::time_t tp) Opm::TimeStampUTC& Opm::TimeStampUTC::operator=(const std::time_t tp)
{ {
auto t = tp; auto t = tp;

View File

@ -29,6 +29,13 @@ UDAValue::UDAValue(double value):
{ {
} }
UDAValue::UDAValue(double value, const Dimension& dim_):
numeric_value(true),
double_value(value),
dim(dim_)
{
}
UDAValue::UDAValue() : UDAValue::UDAValue() :
UDAValue(0) UDAValue(0)
@ -40,6 +47,13 @@ UDAValue::UDAValue(const std::string& value):
{ {
} }
UDAValue::UDAValue(const std::string& value, const Dimension& dim_):
numeric_value(false),
string_value(value),
dim(dim_)
{
}
UDAValue::UDAValue(const UDAValue& src, const Dimension& new_dim): UDAValue::UDAValue(const UDAValue& src, const Dimension& new_dim):
UDAValue(src) UDAValue(src)
{ {

View File

@ -75,7 +75,8 @@ namespace Opm {
Connection::Connection(Direction dir, double depth, State state, Connection::Connection(Direction dir, double depth, State state,
int satTableId, int complnum, double CF, int satTableId, int complnum, double CF,
double Kh, double rw, double r0, double skinFactor, double Kh, double rw, double r0, double skinFactor,
const std::array<int,3>& IJK, std::size_t seqIndex, const std::array<int,3>& IJK,
CTFKind kind, std::size_t seqIndex,
double segDistStart, double segDistEnd, double segDistStart, double segDistEnd,
bool defaultSatTabId, std::size_t compSegSeqIndex, bool defaultSatTabId, std::size_t compSegSeqIndex,
int segment, double wellPi) int segment, double wellPi)
@ -90,6 +91,7 @@ namespace Opm {
, m_r0(r0) , m_r0(r0)
, m_skin_factor(skinFactor) , m_skin_factor(skinFactor)
, ijk(IJK) , ijk(IJK)
, m_ctfkind(kind)
, m_seqIndex(seqIndex) , m_seqIndex(seqIndex)
, m_segDistStart(segDistStart) , m_segDistStart(segDistStart)
, m_segDistEnd(segDistEnd) , m_segDistEnd(segDistEnd)
@ -102,7 +104,7 @@ namespace Opm {
Connection::Connection() Connection::Connection()
: Connection(Direction::X, 1.0, State::SHUT, : Connection(Direction::X, 1.0, State::SHUT,
0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0,
{0,0,0}, 0, 0.0, 0.0, false, 0, 0, 0.0) {0,0,0}, CTFKind::Defaulted, 0, 0.0, 0.0, false, 0, 0, 0.0)
{} {}
bool Connection::sameCoordinate(const int i, const int j, const int k) const { bool Connection::sameCoordinate(const int i, const int j, const int k) const {
@ -389,4 +391,8 @@ std::string Connection::CTFKindToString(const CTFKind ctf_kind)
}; };
} }
Connection::CTFKind Connection::kind() const {
return m_ctfkind;
}
} }

View File

@ -33,9 +33,10 @@ namespace Opm {
} }
Dimension::Dimension(const std::string& name, double SIfactor, double SIoffset) Dimension::Dimension(const std::string& name, double SIfactor,
double SIoffset, bool sanityCheck)
{ {
for (auto iter = name.begin(); iter != name.end(); ++iter) { for (auto iter = name.begin(); iter != name.end() && sanityCheck; ++iter) {
if (!isalpha(*iter) && (*iter) != '1') if (!isalpha(*iter) && (*iter) != '1')
throw std::invalid_argument("Invalid dimension name"); throw std::invalid_argument("Invalid dimension name");
} }