Merge pull request #1605 from akva2/serialize_internal_schedule
Internal serialization in Schedule
This commit is contained in:
@@ -37,6 +37,13 @@ public:
|
||||
return filename == data.filename &&
|
||||
lineno == data.lineno;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(filename);
|
||||
serializer(lineno);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -39,6 +39,14 @@ namespace Opm {
|
||||
month == data.month &&
|
||||
day == data.day;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(year);
|
||||
serializer(month);
|
||||
serializer(day);
|
||||
}
|
||||
};
|
||||
|
||||
TimeStampUTC() = default;
|
||||
@@ -68,6 +76,16 @@ namespace Opm {
|
||||
int seconds() const { return this->seconds_; }
|
||||
int microseconds() const { return this->usec_; }
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
ymd_.serializeOp(serializer);
|
||||
serializer(hour_);
|
||||
serializer(minutes_);
|
||||
serializer(seconds_);
|
||||
serializer(usec_);
|
||||
}
|
||||
|
||||
private:
|
||||
YMD ymd_{};
|
||||
int hour_{0};
|
||||
|
||||
@@ -155,9 +155,17 @@ namespace Opm {
|
||||
void write( DeckOutput& output ) const ;
|
||||
friend std::ostream& operator<<(std::ostream& os, const Deck& deck);
|
||||
|
||||
const std::vector<DeckKeyword>& keywords() const;
|
||||
std::size_t unitSystemAccessCount() const;
|
||||
const std::unique_ptr<UnitSystem>& activeUnitSystem() const;
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(keywordList);
|
||||
defaultUnits.serializeOp(serializer);
|
||||
serializer(activeUnits);
|
||||
serializer(m_dataFile);
|
||||
serializer(input_path);
|
||||
serializer(unit_system_access_count);
|
||||
}
|
||||
|
||||
private:
|
||||
Deck(std::vector<DeckKeyword>&& keywordList);
|
||||
|
||||
|
||||
@@ -127,16 +127,6 @@ namespace Opm {
|
||||
bool operator!=(const DeckItem& other) const;
|
||||
static bool to_bool(std::string string_value);
|
||||
|
||||
const std::vector<double>& dVal() const;
|
||||
const std::vector<int>& iVal() const;
|
||||
const std::vector<std::string>& sVal() const;
|
||||
const std::vector<UDAValue>& uVal() const;
|
||||
|
||||
const std::vector<value::status>& valueStatus() const;
|
||||
bool rawData() const;
|
||||
const std::vector<Dimension>& activeDimensions() const;
|
||||
const std::vector<Dimension>& defaultDimensions() const;
|
||||
|
||||
bool is_uda() { return (type == get_type< UDAValue >()); };
|
||||
bool is_double() { return type == get_type< double >(); };
|
||||
bool is_int() { return type == get_type< int >() ; };
|
||||
@@ -144,6 +134,21 @@ namespace Opm {
|
||||
|
||||
UDAValue& get_uda() { return uval[0]; };
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(dval);
|
||||
serializer(ival);
|
||||
serializer(sval);
|
||||
serializer.vector(uval);
|
||||
serializer(type);
|
||||
serializer(item_name);
|
||||
serializer.template vector<value::status, false>(value_status);
|
||||
serializer(raw_data);
|
||||
serializer.vector(active_dimensions);
|
||||
serializer.vector(default_dimensions);
|
||||
}
|
||||
|
||||
private:
|
||||
mutable std::vector< double > dval;
|
||||
std::vector< int > ival;
|
||||
|
||||
@@ -63,13 +63,11 @@ namespace Opm {
|
||||
void addRecord(DeckRecord&& record);
|
||||
const DeckRecord& getRecord(size_t index) const;
|
||||
DeckRecord& getRecord(size_t index);
|
||||
const std::vector<DeckRecord>& records() const;
|
||||
const DeckRecord& getDataRecord() const;
|
||||
void setDataKeyword(bool isDataKeyword = true);
|
||||
void setDoubleRecordKeyword(bool isDoubleRecordKeyword = true);
|
||||
bool isDataKeyword() const;
|
||||
bool isDoubleRecordKeyword() const;
|
||||
bool isSlashTerminated() const;
|
||||
|
||||
const std::vector<int>& getIntData() const;
|
||||
const std::vector<double>& getRawDoubleData() const;
|
||||
@@ -97,6 +95,18 @@ namespace Opm {
|
||||
bool operator!=(const DeckKeyword& other) const;
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const DeckKeyword& keyword);
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_keywordName);
|
||||
m_location.serializeOp(serializer);
|
||||
serializer.vector(m_recordList);
|
||||
serializer(m_isDataKeyword);
|
||||
serializer(m_slashTerminated);
|
||||
serializer(m_isDoubleRecordKeyword);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_keywordName;
|
||||
Location m_location;
|
||||
|
||||
@@ -70,7 +70,11 @@ namespace Opm {
|
||||
bool operator==(const DeckRecord& other) const;
|
||||
bool operator!=(const DeckRecord& other) const;
|
||||
|
||||
const std::vector<DeckItem>& getItems() const;
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(m_items);
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector< DeckItem > m_items;
|
||||
|
||||
@@ -66,6 +66,15 @@ public:
|
||||
|
||||
bool is_numeric() { return numeric_value; }
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(numeric_value);
|
||||
serializer(double_value);
|
||||
serializer(string_value);
|
||||
dim.serializeOp(serializer);
|
||||
}
|
||||
|
||||
private:
|
||||
bool numeric_value;
|
||||
double double_value;
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Opm {
|
||||
m_tables.serializeOp(serializer);
|
||||
m_runspec.serializeOp(serializer);
|
||||
m_eclipseConfig.serializeOp(serializer);
|
||||
serializer(m_deckUnitSystem);
|
||||
m_deckUnitSystem.serializeOp(serializer);
|
||||
m_inputNnc.serializeOp(serializer);
|
||||
m_inputEditNnc.serializeOp(serializer);
|
||||
m_gridDims.serializeOp(serializer);
|
||||
|
||||
@@ -69,8 +69,9 @@ namespace Opm {
|
||||
serializer(m_nx);
|
||||
serializer(m_ny);
|
||||
serializer(m_nz);
|
||||
serializer(m_trans);
|
||||
serializer(m_names);
|
||||
// map used to avoid explicit instances with FaceDir::DirEnum in serializer
|
||||
serializer.template map<decltype(m_trans),false>(m_trans);
|
||||
serializer.template map<decltype(m_names),false>(m_names);
|
||||
m_multregtScanner.serializeOp(serializer);
|
||||
}
|
||||
|
||||
|
||||
@@ -302,7 +302,15 @@ namespace Opm {
|
||||
bool operator!=(const RestartSchedule& rhs) const;
|
||||
bool operator==( const RestartSchedule& rhs ) const;
|
||||
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(timestep);
|
||||
serializer(basic);
|
||||
serializer(frequency);
|
||||
serializer(rptsched_restart_set);
|
||||
serializer(rptsched_restart);
|
||||
}
|
||||
|
||||
//private:
|
||||
size_t timestep = 0;
|
||||
@@ -341,17 +349,20 @@ namespace Opm {
|
||||
RestartSchedule getNode( size_t timestep ) const;
|
||||
static std::string getRestartFileName(const std::string& restart_base, int report_step, bool unified, bool fmt_file);
|
||||
|
||||
const TimeMap& timeMap() const;
|
||||
bool writeInitialRst() const;
|
||||
const DynamicState<RestartSchedule>& restartSchedule() const;
|
||||
const DynamicState<std::map<std::string,int>>& restartKeywords() const;
|
||||
const std::vector<bool>& saveKeywords() const;
|
||||
|
||||
bool operator==(const RestartConfig& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
m_timemap.serializeOp(serializer);
|
||||
serializer(m_first_restart_step);
|
||||
serializer(m_write_initial_RST_file);
|
||||
restart_schedule.serializeOp(serializer);
|
||||
restart_keywords.serializeOp<Serializer, false>(serializer);
|
||||
serializer(save_keywords);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
/// This method will internalize variables with information of
|
||||
/// the first report step with restart and rft output
|
||||
/// respectively. This information is important because right
|
||||
|
||||
@@ -29,12 +29,19 @@ public:
|
||||
size_t size() const;
|
||||
std::string func;
|
||||
|
||||
const std::vector<std::string>& argList() const;
|
||||
const std::vector<ASTNode>& childrens() const;
|
||||
double getNumber() const;
|
||||
|
||||
bool operator==(const ASTNode& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(type);
|
||||
serializer(func_type);
|
||||
serializer(func);
|
||||
serializer(arg_list);
|
||||
serializer(number);
|
||||
serializer.vector(children);
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<std::string> arg_list;
|
||||
double number = 0.0;
|
||||
|
||||
@@ -47,9 +47,14 @@ public:
|
||||
AST(const std::shared_ptr<ASTNode>& cond);
|
||||
Result eval(const Context& context) const;
|
||||
|
||||
std::shared_ptr<ASTNode> getCondition() const;
|
||||
|
||||
bool operator==(const AST& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(condition);
|
||||
}
|
||||
|
||||
private:
|
||||
/*
|
||||
The use of a pointer here is to be able to create this class with only a
|
||||
|
||||
@@ -94,15 +94,25 @@ public:
|
||||
The conditions() and keyword_strings() methods, and their underlying data
|
||||
members are only present to support writing formatted restart files.
|
||||
*/
|
||||
const std::vector<DeckKeyword>& getKeywords() const;
|
||||
const std::vector<Condition>& conditions() const;
|
||||
const Action::AST& getCondition() const;
|
||||
std::vector<std::string> keyword_strings() const;
|
||||
size_t getRunCount() const;
|
||||
std::time_t getLastRun() const;
|
||||
|
||||
bool operator==(const ActionX& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_name);
|
||||
serializer(m_max_run);
|
||||
serializer(m_min_wait);
|
||||
serializer(m_start_time);
|
||||
serializer.vector(keywords);
|
||||
condition.serializeOp(serializer);
|
||||
serializer.vector(m_conditions);
|
||||
serializer(run_count);
|
||||
serializer(last_run);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
size_t m_max_run = 0;
|
||||
|
||||
@@ -51,10 +51,14 @@ public:
|
||||
std::vector<ActionX>::const_iterator begin() const;
|
||||
std::vector<ActionX>::const_iterator end() const;
|
||||
|
||||
const std::vector<ActionX>& getActions() const;
|
||||
|
||||
bool operator==(const Actions& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(actions);
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<ActionX> actions;
|
||||
};
|
||||
|
||||
@@ -46,6 +46,13 @@ public:
|
||||
return quantity == data.quantity &&
|
||||
args == data.args;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(quantity);
|
||||
serializer(args);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -80,6 +87,16 @@ enum class Comparator {
|
||||
std::string cmp_string;
|
||||
|
||||
bool operator==(const Condition& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
lhs.serializeOp(serializer);
|
||||
rhs.serializeOp(serializer);
|
||||
serializer(logic);
|
||||
serializer(cmp);
|
||||
serializer(cmp_string);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Opm {
|
||||
|
||||
template< class T >
|
||||
class DynamicState {
|
||||
|
||||
friend class Schedule;
|
||||
public:
|
||||
typedef typename std::vector< T >::iterator iterator;
|
||||
|
||||
@@ -227,22 +227,23 @@ class DynamicState {
|
||||
initial_range == data.initial_range;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
// complexType=true if contained type has a serializeOp
|
||||
template<class Serializer, bool complexType = true>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
auto split = Split();
|
||||
serializer.vector(split.first);
|
||||
serializer(split.second);
|
||||
if (m_data.empty())
|
||||
reconstruct(split.first, split.second);
|
||||
std::vector<T> unique;
|
||||
auto indices = split(unique);
|
||||
serializer.template vector<T,complexType>(unique);
|
||||
serializer(indices);
|
||||
if (!serializer.isSerializing())
|
||||
reconstruct(unique, indices);
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector< T > m_data;
|
||||
size_t initial_range;
|
||||
|
||||
std::pair<std::vector<T>,std::vector<size_t>> Split() {
|
||||
std::vector<T> unique;
|
||||
std::vector<size_t> split(std::vector<T>& unique) const {
|
||||
std::vector<size_t> idxVec;
|
||||
idxVec.reserve(m_data.size() + 1);
|
||||
for (const auto& w : m_data) {
|
||||
@@ -256,7 +257,7 @@ class DynamicState {
|
||||
}
|
||||
idxVec.push_back(initial_range);
|
||||
|
||||
return std::make_pair(unique, idxVec);
|
||||
return idxVec;
|
||||
}
|
||||
|
||||
void reconstruct(const std::vector<T>& unique,
|
||||
|
||||
@@ -64,12 +64,14 @@ namespace Opm {
|
||||
(*this)[index] = std::move( value );
|
||||
}
|
||||
|
||||
const std::vector<T>& data() const {
|
||||
return m_data;
|
||||
bool operator==(const DynamicVector<T>& data) const {
|
||||
return this->m_data == data.m_data;
|
||||
}
|
||||
|
||||
bool operator==(const DynamicVector<T>& data) const {
|
||||
return this->data() == data.data();
|
||||
template<class Serializer, bool complexType = true>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.template vector<T, complexType>(m_data);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -127,10 +127,14 @@ namespace Opm
|
||||
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;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
m_events.template serializeOp<Serializer,false>(serializer);
|
||||
}
|
||||
|
||||
private:
|
||||
DynamicVector<uint64_t> m_events;
|
||||
};
|
||||
|
||||
@@ -52,6 +52,17 @@ namespace Opm {
|
||||
udq_undefined == data.udq_undefined &&
|
||||
unit_system == data.unit_system;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
sales_target.serializeOp(serializer);
|
||||
max_sales_rate.serializeOp(serializer);
|
||||
min_sales_rate.serializeOp(serializer);
|
||||
serializer(max_proc);
|
||||
serializer(udq_undefined);
|
||||
unit_system.serializeOp(serializer);
|
||||
}
|
||||
};
|
||||
|
||||
struct GCONSALEGroupProp {
|
||||
@@ -71,10 +82,14 @@ namespace Opm {
|
||||
void add(const std::string& name, const UDAValue& sales_target, const UDAValue& max_rate, const UDAValue& min_rate, const std::string& procedure, double udq_undefined_arg, const UnitSystem& unit_system);
|
||||
size_t size() const;
|
||||
|
||||
const std::map<std::string, GCONSALEGroup>& getGroups() const;
|
||||
|
||||
bool operator==(const GConSale& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.map(groups);
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<std::string, GCONSALEGroup> groups;
|
||||
};
|
||||
|
||||
@@ -45,6 +45,16 @@ namespace Opm {
|
||||
udq_undefined == data.udq_undefined &&
|
||||
unit_system == data.unit_system;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
consumption_rate.serializeOp(serializer);
|
||||
import_rate.serializeOp(serializer);
|
||||
serializer(network_node);
|
||||
serializer(udq_undefined);
|
||||
unit_system.serializeOp(serializer);
|
||||
}
|
||||
};
|
||||
|
||||
struct GCONSUMPGroupProp {
|
||||
@@ -62,10 +72,14 @@ namespace Opm {
|
||||
void add(const std::string& name, const UDAValue& consumption_rate, const UDAValue& import_rate, const std::string network_node, double udq_undefined_arg, const UnitSystem& unit_system);
|
||||
size_t size() const;
|
||||
|
||||
const std::map<std::string, GCONSUMPGroup>& getGroups() const;
|
||||
|
||||
bool operator==(const GConSump& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.map(groups);
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<std::string, GCONSUMPGroup> groups;
|
||||
};
|
||||
|
||||
@@ -117,6 +117,20 @@ struct GroupInjectionProperties {
|
||||
int injection_controls = 0;
|
||||
bool operator==(const GroupInjectionProperties& other) const;
|
||||
bool operator!=(const GroupInjectionProperties& other) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(phase);
|
||||
serializer(cmode);
|
||||
surface_max_rate.serializeOp(serializer);
|
||||
resv_max_rate.serializeOp(serializer);
|
||||
target_reinj_fraction.serializeOp(serializer);
|
||||
target_void_fraction.serializeOp(serializer);
|
||||
serializer(reinj_group);
|
||||
serializer(voidage_group);
|
||||
serializer(injection_controls);
|
||||
}
|
||||
};
|
||||
|
||||
struct InjectionControls {
|
||||
@@ -146,6 +160,21 @@ struct GroupProductionProperties {
|
||||
int production_controls = 0;
|
||||
bool operator==(const GroupProductionProperties& other) const;
|
||||
bool operator!=(const GroupProductionProperties& other) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(cmode);
|
||||
serializer(exceed_action);
|
||||
oil_target.serializeOp(serializer);
|
||||
water_target.serializeOp(serializer);
|
||||
gas_target.serializeOp(serializer);
|
||||
liquid_target.serializeOp(serializer);
|
||||
serializer(guide_rate);
|
||||
serializer(guide_rate_def);
|
||||
serializer(resv_target);
|
||||
serializer(production_controls);
|
||||
}
|
||||
};
|
||||
|
||||
struct ProductionControls {
|
||||
@@ -184,14 +213,8 @@ struct ProductionControls {
|
||||
|
||||
bool defined(std::size_t timeStep) const;
|
||||
std::size_t insert_index() const;
|
||||
std::size_t initStep() const;
|
||||
double udqUndefined() const;
|
||||
const UnitSystem& units() const;
|
||||
const std::string& name() const;
|
||||
GroupType type() const;
|
||||
int getGroupNetVFPTable() const;
|
||||
const IOrderSet<std::string>& iwells() const;
|
||||
const IOrderSet<std::string>& igroups() const;
|
||||
|
||||
bool updateNetVFPTable(int vfp_arg);
|
||||
bool update_gefac(double gefac, bool transfer_gefac);
|
||||
@@ -240,6 +263,27 @@ struct ProductionControls {
|
||||
const Phase& topup_phase() const;
|
||||
bool has_topup_phase() const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_name);
|
||||
serializer(m_insert_index);
|
||||
serializer(init_step);
|
||||
serializer(udq_undefined);
|
||||
unit_system.serializeOp(serializer);
|
||||
serializer(group_type);
|
||||
serializer(gefac);
|
||||
serializer(transfer_gefac);
|
||||
serializer(available_for_group_control);
|
||||
serializer(vfp_table);
|
||||
serializer(parent_group);
|
||||
m_wells.serializeOp(serializer);
|
||||
m_groups.serializeOp(serializer);
|
||||
serializer.map(injection_properties);
|
||||
production_properties.serializeOp(serializer);
|
||||
serializer(m_topup_phase);
|
||||
}
|
||||
|
||||
private:
|
||||
bool hasType(GroupType gtype) const;
|
||||
void addType(GroupType new_gtype);
|
||||
|
||||
@@ -44,6 +44,14 @@ public:
|
||||
target == data.target &&
|
||||
scaling_factor == data.scaling_factor;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(guide_rate);
|
||||
serializer(target);
|
||||
serializer(scaling_factor);
|
||||
}
|
||||
};
|
||||
|
||||
struct GroupTarget {
|
||||
@@ -54,6 +62,13 @@ struct GroupTarget {
|
||||
return guide_rate == data.guide_rate &&
|
||||
target == data.target;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(guide_rate);
|
||||
serializer(target);
|
||||
}
|
||||
};
|
||||
|
||||
GuideRateConfig() = default;
|
||||
@@ -71,12 +86,16 @@ struct GroupTarget {
|
||||
bool has_well(const std::string& well) const;
|
||||
bool has_group(const std::string& group) const;
|
||||
|
||||
std::shared_ptr<GuideRateModel> getModel() const;
|
||||
const std::unordered_map<std::string, WellTarget>& getWells() const;
|
||||
const std::unordered_map<std::string, GroupTarget>& getGroups() const;
|
||||
|
||||
bool operator==(const GuideRateConfig& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_model);
|
||||
serializer.map(wells);
|
||||
serializer.map(groups);
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<GuideRateModel> m_model;
|
||||
std::unordered_map<std::string, WellTarget> wells;
|
||||
|
||||
@@ -82,11 +82,26 @@ public:
|
||||
static Target convert_target(Well::GuideRateTarget well_target);
|
||||
static double pot(Target target, double oil_pot, double gas_pot, double wat_pot);
|
||||
|
||||
double timeInterval() const;
|
||||
std::array<double, 6> coefs() const;
|
||||
bool free_gas() const;
|
||||
bool defaultModel() const;
|
||||
std::array<UDAValue,3> udaCoefs() const;
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(time_interval);
|
||||
serializer(m_target),
|
||||
serializer(A);
|
||||
serializer(B);
|
||||
serializer(C);
|
||||
serializer(D);
|
||||
serializer(E);
|
||||
serializer(F);
|
||||
serializer(allow_increase_);
|
||||
serializer(damping_factor_);
|
||||
serializer(use_free_gas);
|
||||
serializer(default_model);
|
||||
alpha.serializeOp(serializer);
|
||||
beta.serializeOp(serializer);
|
||||
gamma.serializeOp(serializer);
|
||||
}
|
||||
|
||||
private:
|
||||
double pot(double oil_pot, double gas_pot, double wat_pot) const;
|
||||
/*
|
||||
|
||||
@@ -94,12 +94,31 @@ namespace Opm {
|
||||
bool operator!=( const Segment& ) const;
|
||||
|
||||
const std::shared_ptr<SpiralICD>& spiralICD() const;
|
||||
const std::shared_ptr<Valve>& getValve() const;
|
||||
const Valve* valve() const;
|
||||
|
||||
void updateSpiralICD(const SpiralICD& spiral_icd);
|
||||
void updateValve(const Valve& valve, const double segment_length);
|
||||
void addInletSegment(const int segment_number);
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_segment_number);
|
||||
serializer(m_branch);
|
||||
serializer(m_outlet_segment);
|
||||
serializer(m_inlet_segments);
|
||||
serializer(m_total_length);
|
||||
serializer(m_depth);
|
||||
serializer(m_internal_diameter);
|
||||
serializer(m_roughness);
|
||||
serializer(m_cross_area);
|
||||
serializer(m_volume);
|
||||
serializer(m_data_ready);
|
||||
serializer(m_segment_type);
|
||||
serializer(m_spiral_icd);
|
||||
serializer(m_valve);
|
||||
}
|
||||
|
||||
private:
|
||||
// segment number
|
||||
// it should work as a ID.
|
||||
|
||||
@@ -72,6 +72,22 @@ namespace Opm {
|
||||
int ecl_status() const;
|
||||
bool operator==(const SpiralICD& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_strength);
|
||||
serializer(m_length);
|
||||
serializer(m_density_calibration);
|
||||
serializer(m_viscosity_calibration);
|
||||
serializer(m_critical_value);
|
||||
serializer(m_width_transition_region);
|
||||
serializer(m_max_viscosity_ratio);
|
||||
serializer(m_method_flow_scaling);
|
||||
serializer(m_max_absolute_rate);
|
||||
serializer(m_status);
|
||||
serializer(m_scaling_factor);
|
||||
}
|
||||
|
||||
private:
|
||||
double m_strength;
|
||||
double m_length;
|
||||
|
||||
@@ -76,6 +76,19 @@ namespace Opm {
|
||||
|
||||
bool operator==(const Valve& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_con_flow_coeff);
|
||||
serializer(m_con_cross_area);
|
||||
serializer(m_con_max_cross_area);
|
||||
serializer(m_pipe_additional_length);
|
||||
serializer(m_pipe_diameter);
|
||||
serializer(m_pipe_roughness);
|
||||
serializer(m_pipe_cross_area);
|
||||
serializer(m_status);
|
||||
}
|
||||
|
||||
private:
|
||||
double m_con_flow_coeff;
|
||||
double m_con_cross_area;
|
||||
|
||||
@@ -90,11 +90,19 @@ namespace Opm {
|
||||
|
||||
// it returns true if there is no error encountered during the update
|
||||
bool updateWSEGSICD(const std::vector<std::pair<int, SpiralICD> >& sicd_pairs);
|
||||
const std::vector<Segment>& segments() const;
|
||||
|
||||
bool updateWSEGVALV(const std::vector<std::pair<int, Valve> >& valve_pairs);
|
||||
const std::vector<Segment>::const_iterator begin() const;
|
||||
const std::vector<Segment>::const_iterator end() const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_comp_pressure_drop);
|
||||
serializer.vector(m_segments);
|
||||
serializer(segment_number_to_index);
|
||||
}
|
||||
|
||||
private:
|
||||
void processABS();
|
||||
void processINC(double depth_top, double length_top);
|
||||
|
||||
@@ -61,6 +61,22 @@ namespace Opm {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(message_print_limit);
|
||||
serializer(comment_print_limit);
|
||||
serializer(warning_print_limit);
|
||||
serializer(problem_print_limit);
|
||||
serializer(error_print_limit);
|
||||
serializer(bug_print_limit);
|
||||
serializer(message_stop_limit);
|
||||
serializer(comment_stop_limit);
|
||||
serializer(warning_stop_limit);
|
||||
serializer(problem_stop_limit);
|
||||
serializer(error_stop_limit);
|
||||
serializer(bug_stop_limit);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -105,9 +121,14 @@ 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;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
limits.serializeOp(serializer);
|
||||
}
|
||||
|
||||
private:
|
||||
void update(size_t timestep, const MLimits& value);
|
||||
|
||||
|
||||
@@ -63,9 +63,6 @@ namespace Opm
|
||||
|
||||
double vap1() const;
|
||||
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
|
||||
@@ -74,6 +71,17 @@ namespace Opm
|
||||
bool operator==( const OilVaporizationProperties& ) const;
|
||||
bool operator!=( const OilVaporizationProperties& ) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_type);
|
||||
serializer(m_vap1);
|
||||
serializer(m_vap2);
|
||||
serializer(m_maxDRSDT);
|
||||
serializer(m_maxDRSDT_allCells);
|
||||
serializer(m_maxDRVDT);
|
||||
}
|
||||
|
||||
private:
|
||||
OilVaporization m_type = OilVaporization::UNDEF;
|
||||
double m_vap1;
|
||||
|
||||
@@ -51,11 +51,10 @@ public:
|
||||
static std::string PLT2String(PLT enumValue);
|
||||
static PLT PLTFromString( const std::string& stringValue);
|
||||
|
||||
using RFTMap = std::unordered_map<std::string,
|
||||
DynamicState<std::pair<RFT, std::size_t>>>;
|
||||
|
||||
using PLTMap = std::unordered_map<std::string,
|
||||
DynamicState<std::pair<PLT, std::size_t>>>;
|
||||
template <typename Value>
|
||||
using ConfigMap = std::unordered_map<
|
||||
std::string, DynamicState<std::pair<Value, std::size_t>>
|
||||
>;
|
||||
|
||||
using WellOpenTimeMap = std::unordered_map<std::string, std::size_t>;
|
||||
|
||||
@@ -65,8 +64,8 @@ public:
|
||||
const std::pair<bool, std::size_t>& rftTime,
|
||||
const WellOpenTimeMap& rftName,
|
||||
const WellOpenTimeMap& wellOpen,
|
||||
const RFTMap& rconfig,
|
||||
const PLTMap& pconfig);
|
||||
const ConfigMap<RFT>& rconfig,
|
||||
const ConfigMap<PLT>& pconfig);
|
||||
|
||||
explicit RFTConfig(const TimeMap& time_map);
|
||||
bool rft(const std::string& well, std::size_t report_step) const;
|
||||
@@ -82,27 +81,29 @@ public:
|
||||
void addWellOpen(const std::string& well, std::size_t report_step);
|
||||
|
||||
const TimeMap& timeMap() const;
|
||||
const std::pair<bool, std::size_t>& wellOpenRftTime() const;
|
||||
const WellOpenTimeMap& wellOpenRftName() const;
|
||||
const WellOpenTimeMap& wellOpen() const;
|
||||
const RFTMap& rftConfig() const;
|
||||
const PLTMap& pltConfig() const;
|
||||
|
||||
bool operator==(const RFTConfig& data) const;
|
||||
|
||||
private:
|
||||
template <typename Value>
|
||||
using ConfigMap = std::unordered_map<
|
||||
std::string, DynamicState<std::pair<Value, std::size_t>>
|
||||
>;
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
tm.serializeOp(serializer);
|
||||
serializer(first_rft_event);
|
||||
serializer(well_open_rft_time);
|
||||
serializer(well_open_rft_name);
|
||||
serializer(well_open);
|
||||
serializer.template map<ConfigMap<RFT>,false>(rft_config);
|
||||
serializer.template map<ConfigMap<PLT>,false>(plt_config);
|
||||
}
|
||||
|
||||
private:
|
||||
TimeMap tm;
|
||||
std::size_t first_rft_event;
|
||||
std::pair<bool, std::size_t> well_open_rft_time;
|
||||
WellOpenTimeMap well_open_rft_name;
|
||||
WellOpenTimeMap well_open;
|
||||
RFTMap rft_config;
|
||||
PLTMap plt_config;
|
||||
ConfigMap<RFT> rft_config;
|
||||
ConfigMap<PLT> plt_config;
|
||||
|
||||
bool outputRftAtWellopen(WellOpenTimeMap::const_iterator well, const std::size_t report_step) const;
|
||||
std::size_t firstWellopenStepNotBefore(const std::size_t report_step) const;
|
||||
|
||||
@@ -282,46 +282,44 @@ namespace Opm
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_timeMap);
|
||||
m_timeMap.serializeOp(serializer);
|
||||
auto splitWells = splitDynMap(wells_static);
|
||||
serializer(splitWells.first);
|
||||
serializer.vector(splitWells.first);
|
||||
serializer(splitWells.second);
|
||||
auto splitGroups = splitDynMap(groups);
|
||||
serializer(splitGroups.first);
|
||||
serializer.vector(splitGroups.first);
|
||||
serializer(splitGroups.second);
|
||||
serializer(m_oilvaporizationproperties);
|
||||
serializer(m_events);
|
||||
serializer(m_modifierDeck);
|
||||
serializer(m_tuning);
|
||||
serializer(m_messageLimits);
|
||||
m_oilvaporizationproperties.serializeOp(serializer);
|
||||
m_events.serializeOp(serializer);
|
||||
m_modifierDeck.serializeOp(serializer);
|
||||
m_tuning.serializeOp(serializer);
|
||||
m_messageLimits.serializeOp(serializer);
|
||||
m_runspec.serializeOp(serializer);
|
||||
auto splitvfpprod = splitDynMap(vfpprod_tables);
|
||||
serializer(splitvfpprod.first);
|
||||
serializer.vector(splitvfpprod.first);
|
||||
serializer(splitvfpprod.second);
|
||||
auto splitvfpinj = splitDynMap(vfpinj_tables);
|
||||
serializer(splitvfpinj.first);
|
||||
serializer.vector(splitvfpinj.first);
|
||||
serializer(splitvfpinj.second);
|
||||
serializer(wtest_config);
|
||||
serializer(wlist_manager);
|
||||
wtest_config.serializeOp(serializer);
|
||||
wlist_manager.serializeOp(serializer);
|
||||
udq_config.serializeOp(serializer);
|
||||
udq_active.serializeOp(serializer);
|
||||
serializer(guide_rate_config);
|
||||
serializer(gconsale);
|
||||
serializer(gconsump);
|
||||
serializer(global_whistctl_mode);
|
||||
serializer(m_actions);
|
||||
serializer(rft_config);
|
||||
serializer(m_nupcol);
|
||||
serializer(restart_config);
|
||||
serializer(wellgroup_events);
|
||||
if (wells_static.size() == 0)
|
||||
guide_rate_config.serializeOp(serializer);
|
||||
gconsale.serializeOp(serializer);
|
||||
gconsump.serializeOp(serializer);
|
||||
global_whistctl_mode.template serializeOp<Serializer, false>(serializer);
|
||||
m_actions.serializeOp(serializer);
|
||||
rft_config.serializeOp(serializer);
|
||||
m_nupcol.template serializeOp<Serializer, false>(serializer);
|
||||
restart_config.serializeOp(serializer);
|
||||
serializer.map(wellgroup_events);
|
||||
if (!serializer.isSerializing()) {
|
||||
reconstructDynMap(splitWells.first, splitWells.second, wells_static);
|
||||
if (groups.size() == 0)
|
||||
reconstructDynMap(splitGroups.first, splitGroups.second, groups);
|
||||
if (vfpprod_tables.empty())
|
||||
reconstructDynMap(splitvfpprod.first, splitvfpprod.second, vfpprod_tables);
|
||||
if (vfpinj_tables.empty())
|
||||
reconstructDynMap(splitvfpinj.first, splitvfpinj.second, vfpinj_tables);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -450,50 +448,28 @@ namespace Opm
|
||||
void addWellGroupEvent(const std::string& wellGroup, ScheduleEvents::Events event, size_t reportStep);
|
||||
|
||||
template<template<class, class> class Map, class Type, class Key>
|
||||
std::pair<std::vector<Type>, std::vector<std::pair<Key, std::vector<int>>>>
|
||||
std::pair<std::vector<Type>, std::vector<std::pair<Key, std::vector<size_t>>>>
|
||||
splitDynMap(const Map<Key, Opm::DynamicState<Type>>& map)
|
||||
{
|
||||
// we have to pack the unique ptrs separately, and use an index map
|
||||
// to allow reconstructing the appropriate structures.
|
||||
std::vector<std::pair<Key, std::vector<int>>> asMap;
|
||||
std::vector<std::pair<Key, std::vector<size_t>>> asMap;
|
||||
std::vector<Type> unique;
|
||||
for (const auto& it : map) {
|
||||
std::vector<int> idxVec;
|
||||
for (const auto& w : it.second.data()) {
|
||||
auto candidate = std::find(unique.begin(), unique.end(), w);
|
||||
auto idx = candidate - unique.begin();
|
||||
if (candidate == unique.end()) {
|
||||
unique.push_back(w);
|
||||
idx = unique.size()-1;
|
||||
}
|
||||
idxVec.push_back(idx);
|
||||
}
|
||||
idxVec.push_back(it.second.initialRange());
|
||||
asMap.push_back(std::make_pair(it.first, idxVec));
|
||||
auto indices = it.second.split(unique);
|
||||
asMap.push_back(std::make_pair(it.first, indices));
|
||||
}
|
||||
|
||||
return std::make_pair(unique, asMap);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
void reconstructDynState(const std::vector<Type>& unique,
|
||||
const std::vector<int>& idxVec,
|
||||
Opm::DynamicState<Type>& result)
|
||||
{
|
||||
std::vector<Type> ptrData;
|
||||
for (size_t i = 0; i < idxVec.size()-1; ++i) {
|
||||
ptrData.push_back(unique[idxVec[i]]);
|
||||
}
|
||||
result = Opm::DynamicState<Type>(ptrData, idxVec.back());
|
||||
}
|
||||
|
||||
template<template<class, class> class Map, class Type, class Key>
|
||||
void reconstructDynMap(const std::vector<Type>& unique,
|
||||
const std::vector<std::pair<Key, std::vector<int>>>& asMap,
|
||||
const std::vector<std::pair<Key, std::vector<size_t>>>& asMap,
|
||||
Map<Key, Opm::DynamicState<Type>>& result)
|
||||
{
|
||||
for (const auto& it : asMap) {
|
||||
reconstructDynState(unique, it.second, result[it.first]);
|
||||
result[it.first].reconstruct(unique, it.second);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -57,6 +57,15 @@ public:
|
||||
Phase preferred_phase() const;
|
||||
InjectorType injector_type() const;
|
||||
bool operator==(const WellType& other) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_producer);
|
||||
serializer(injection_phase);
|
||||
serializer(m_welspecs_phase);
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_producer;
|
||||
/*
|
||||
|
||||
@@ -74,6 +74,17 @@ namespace Opm {
|
||||
static std::time_t mkdate(int year, int month, int day);
|
||||
static std::time_t mkdatetime(int year, int month, int day, int hour, int minute, int second);
|
||||
static const std::map<std::string, int>& eclipseMonthIndices();
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_timeList);
|
||||
serializer.vector(m_first_timestep_years);
|
||||
serializer.vector(m_first_timestep_months);
|
||||
serializer(m_skiprest);
|
||||
serializer(m_restart_offset);
|
||||
}
|
||||
|
||||
private:
|
||||
struct StepData
|
||||
{
|
||||
@@ -85,6 +96,13 @@ namespace Opm {
|
||||
return stepnumber == data.stepnumber &&
|
||||
timestamp == data.timestamp;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(stepnumber);
|
||||
timestamp.serializeOp(serializer);
|
||||
}
|
||||
};
|
||||
|
||||
bool isTimestepInFreqSequence (size_t timestep, size_t start_timestep, size_t frequency, bool years) const;
|
||||
|
||||
@@ -111,6 +111,49 @@ namespace Opm {
|
||||
bool operator !=(const Tuning& data) const {
|
||||
return !(*this == data);
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(TSINIT);
|
||||
serializer(TSMAXZ);
|
||||
serializer(TSMINZ);
|
||||
serializer(TSMCHP);
|
||||
serializer(TSFMAX);
|
||||
serializer(TSFMIN);
|
||||
serializer(TFDIFF);
|
||||
serializer(TSFCNV);
|
||||
serializer(THRUPT);
|
||||
serializer(TMAXWC);
|
||||
serializer(TMAXWC_has_value);
|
||||
|
||||
serializer(TRGTTE);
|
||||
serializer(TRGCNV);
|
||||
serializer(TRGMBE);
|
||||
serializer(TRGLCV);
|
||||
serializer(XXXTTE);
|
||||
serializer(XXXCNV);
|
||||
serializer(XXXMBE);
|
||||
serializer(XXXLCV);
|
||||
serializer(XXXWFL);
|
||||
serializer(TRGFIP);
|
||||
serializer(TRGSFT);
|
||||
serializer(TRGSFT_has_value);
|
||||
serializer(THIONX);
|
||||
serializer(TRWGHT);
|
||||
|
||||
serializer(NEWTMX);
|
||||
serializer(NEWTMN);
|
||||
serializer(LITMAX);
|
||||
serializer(LITMIN);
|
||||
serializer(MXWSIT);
|
||||
serializer(MXWPIT);
|
||||
serializer(DDPLIM);
|
||||
serializer(DDSLIM);
|
||||
serializer(TRGDPR);
|
||||
serializer(XXXDPR);
|
||||
serializer(XXXDPR_has_value);
|
||||
}
|
||||
};
|
||||
|
||||
} //namespace Opm
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Opm {
|
||||
serializer.map(m_assignments);
|
||||
serializer(units);
|
||||
input_index.serializeOp(serializer);
|
||||
serializer(type_count);
|
||||
serializer.template map<decltype(type_count),false>(type_count);
|
||||
// The UDQFunction table is constant up to udq_params.
|
||||
// So we can just construct a new instance here.
|
||||
if (!serializer.isSerializing())
|
||||
|
||||
@@ -94,6 +94,17 @@ public:
|
||||
|
||||
double operator()(size_t thp_idx, size_t flo_idx) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_table_num);
|
||||
serializer(m_datum_depth);
|
||||
serializer(m_flo_type);
|
||||
serializer(m_flo_data);
|
||||
serializer(m_thp_data);
|
||||
serializer(m_data);
|
||||
}
|
||||
|
||||
private:
|
||||
int m_table_num;
|
||||
double m_datum_depth;
|
||||
|
||||
@@ -153,8 +153,24 @@ public:
|
||||
|
||||
double operator()(size_t thp_idx, size_t wfr_idx, size_t gfr_idx, size_t alq_idx, size_t flo_idx) const;
|
||||
|
||||
private:
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_table_num);
|
||||
serializer(m_datum_depth);
|
||||
serializer(m_flo_type);
|
||||
serializer(m_wfr_type);
|
||||
serializer(m_gfr_type);
|
||||
serializer(m_alq_type);
|
||||
serializer(m_flo_data);
|
||||
serializer(m_thp_data);
|
||||
serializer(m_wfr_data);
|
||||
serializer(m_gfr_data);
|
||||
serializer(m_alq_data);
|
||||
serializer(m_data);
|
||||
}
|
||||
|
||||
private:
|
||||
int m_table_num;
|
||||
double m_datum_depth;
|
||||
FLO_TYPE m_flo_type;
|
||||
|
||||
@@ -160,6 +160,31 @@ namespace RestartIO {
|
||||
|
||||
bool operator==( const Connection& ) const;
|
||||
bool operator!=( const Connection& ) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(direction);
|
||||
serializer(center_depth);
|
||||
serializer(open_state);
|
||||
serializer(sat_tableId);
|
||||
serializer(m_complnum);
|
||||
serializer(m_CF);
|
||||
serializer(m_Kh);
|
||||
serializer(m_rw);
|
||||
serializer(m_r0);
|
||||
serializer(m_skin_factor);
|
||||
serializer(ijk);
|
||||
serializer(m_ctfkind);
|
||||
serializer(m_seqIndex);
|
||||
serializer(m_segDistStart);
|
||||
serializer(m_segDistEnd);
|
||||
serializer(m_defaultSatTabId);
|
||||
serializer(m_compSeg_seqIndex);
|
||||
serializer(segment_number);
|
||||
serializer(wPi);
|
||||
}
|
||||
|
||||
private:
|
||||
Direction direction;
|
||||
double center_depth;
|
||||
|
||||
@@ -35,11 +35,17 @@ public:
|
||||
bool has(const std::string& well) const;
|
||||
|
||||
std::vector<std::string> wells() const;
|
||||
const storage& wellList() const;
|
||||
storage::const_iterator begin() const;
|
||||
storage::const_iterator end() const;
|
||||
|
||||
bool operator==(const WList& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(well_list);
|
||||
}
|
||||
|
||||
private:
|
||||
storage well_list;
|
||||
};
|
||||
|
||||
@@ -35,9 +35,14 @@ public:
|
||||
WList& newList(const std::string& name);
|
||||
void delWell(const std::string& well);
|
||||
|
||||
const std::map<std::string,WList>& lists() const;
|
||||
bool operator==(const WListManager& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.map(wlists);
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<std::string, WList> wlists;
|
||||
};
|
||||
|
||||
@@ -161,6 +161,15 @@ public:
|
||||
guide_phase == data.guide_phase &&
|
||||
scale_factor == data.scale_factor;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(available);
|
||||
serializer(guide_rate);
|
||||
serializer(guide_phase);
|
||||
serializer(scale_factor);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -259,6 +268,26 @@ public:
|
||||
void setBHPLimit(const double limit);
|
||||
InjectionControls controls(const UnitSystem& unit_system, const SummaryState& st, double udq_default) const;
|
||||
bool updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(name);
|
||||
surfaceInjectionRate.serializeOp(serializer);
|
||||
reservoirInjectionRate.serializeOp(serializer);
|
||||
BHPTarget.serializeOp(serializer);
|
||||
THPTarget.serializeOp(serializer);
|
||||
serializer(bhp_hist_limit);
|
||||
serializer(thp_hist_limit);
|
||||
serializer(temperature);
|
||||
serializer(BHPH);
|
||||
serializer(THPH);
|
||||
serializer(VFPTableNumber);
|
||||
serializer(predictionMode);
|
||||
serializer(injectionControls);
|
||||
serializer(injectorType);
|
||||
serializer(controlMode);
|
||||
}
|
||||
};
|
||||
|
||||
struct ProductionControls {
|
||||
@@ -365,10 +394,32 @@ public:
|
||||
ProductionControls controls(const SummaryState& st, double udq_default) const;
|
||||
bool updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const;
|
||||
|
||||
int getNumProductionControls() const;
|
||||
void setBHPLimit(const double limit);
|
||||
int productionControls() const { return this->m_productionControls; }
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(name);
|
||||
OilRate.serializeOp(serializer);
|
||||
WaterRate.serializeOp(serializer);
|
||||
GasRate.serializeOp(serializer);
|
||||
LiquidRate.serializeOp(serializer);
|
||||
ResVRate.serializeOp(serializer);
|
||||
BHPTarget.serializeOp(serializer);
|
||||
THPTarget.serializeOp(serializer);
|
||||
serializer(bhp_hist_limit);
|
||||
serializer(thp_hist_limit);
|
||||
serializer(BHPH);
|
||||
serializer(THPH);
|
||||
serializer(VFPTableNumber);
|
||||
serializer(ALQValue);
|
||||
serializer(predictionMode);
|
||||
serializer(controlMode);
|
||||
serializer(whistctl_cmode);
|
||||
serializer(m_productionControls);
|
||||
}
|
||||
|
||||
private:
|
||||
int m_productionControls = 0;
|
||||
void init_rates( const DeckRecord& record );
|
||||
@@ -421,15 +472,15 @@ public:
|
||||
double efficiencyFactor,
|
||||
double solventFraction,
|
||||
bool prediction_mode,
|
||||
std::shared_ptr<const WellEconProductionLimits> econLimits,
|
||||
std::shared_ptr<const WellFoamProperties> foamProperties,
|
||||
std::shared_ptr<const WellPolymerProperties> polymerProperties,
|
||||
std::shared_ptr<const WellBrineProperties> brineProperties,
|
||||
std::shared_ptr<const WellTracerProperties> tracerProperties,
|
||||
std::shared_ptr<WellEconProductionLimits> econLimits,
|
||||
std::shared_ptr<WellFoamProperties> foamProperties,
|
||||
std::shared_ptr<WellPolymerProperties> polymerProperties,
|
||||
std::shared_ptr<WellBrineProperties> brineProperties,
|
||||
std::shared_ptr<WellTracerProperties> tracerProperties,
|
||||
std::shared_ptr<WellConnections> connections,
|
||||
std::shared_ptr<const WellProductionProperties> production,
|
||||
std::shared_ptr<const WellInjectionProperties> injection,
|
||||
std::shared_ptr<const WellSegments> segments);
|
||||
std::shared_ptr<WellProductionProperties> production,
|
||||
std::shared_ptr<WellInjectionProperties> injection,
|
||||
std::shared_ptr<WellSegments> segments);
|
||||
|
||||
bool isMultiSegment() const;
|
||||
bool isAvailableForGroupControl() const;
|
||||
@@ -531,13 +582,42 @@ public:
|
||||
int vfp_table_number() const;
|
||||
double alq_value() const;
|
||||
double temperature() const;
|
||||
const UnitSystem& units() const;
|
||||
double udqUndefined() const;
|
||||
bool hasSegments() const;
|
||||
const WellGuideRate& wellGuideRate() const;
|
||||
|
||||
bool operator==(const Well& data) const;
|
||||
void setInsertIndex(std::size_t index);
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(wname);
|
||||
serializer(group_name);
|
||||
serializer(init_step);
|
||||
serializer(insert_index);
|
||||
serializer(headI);
|
||||
serializer(headJ);
|
||||
serializer(ref_depth);
|
||||
unit_system.serializeOp(serializer);
|
||||
serializer(udq_undefined);
|
||||
serializer(status);
|
||||
serializer(drainage_radius);
|
||||
serializer(allow_cross_flow);
|
||||
serializer(automatic_shutin);
|
||||
wtype.serializeOp(serializer);
|
||||
guide_rate.serializeOp(serializer);
|
||||
serializer(efficiency_factor);
|
||||
serializer(solvent_fraction);
|
||||
serializer(prediction_mode);
|
||||
serializer(econ_limits);
|
||||
serializer(foam_properties);
|
||||
serializer(polymer_properties);
|
||||
serializer(brine_properties);
|
||||
serializer(tracer_properties);
|
||||
serializer(connections);
|
||||
serializer(production);
|
||||
serializer(injection);
|
||||
serializer(segments);
|
||||
}
|
||||
|
||||
private:
|
||||
void switchToInjector();
|
||||
void switchToProducer();
|
||||
@@ -562,15 +642,15 @@ private:
|
||||
double solvent_fraction;
|
||||
bool prediction_mode = true;
|
||||
|
||||
std::shared_ptr<const WellEconProductionLimits> econ_limits;
|
||||
std::shared_ptr<const WellFoamProperties> foam_properties;
|
||||
std::shared_ptr<const WellPolymerProperties> polymer_properties;
|
||||
std::shared_ptr<const WellBrineProperties> brine_properties;
|
||||
std::shared_ptr<const WellTracerProperties> tracer_properties;
|
||||
std::shared_ptr<WellEconProductionLimits> econ_limits;
|
||||
std::shared_ptr<WellFoamProperties> foam_properties;
|
||||
std::shared_ptr<WellPolymerProperties> polymer_properties;
|
||||
std::shared_ptr<WellBrineProperties> brine_properties;
|
||||
std::shared_ptr<WellTracerProperties> tracer_properties;
|
||||
std::shared_ptr<WellConnections> connections; // The WellConnections object can not be const because of the filterConnections method - would be beneficial to rewrite to enable const
|
||||
std::shared_ptr<const WellProductionProperties> production;
|
||||
std::shared_ptr<const WellInjectionProperties> injection;
|
||||
std::shared_ptr<const WellSegments> segments;
|
||||
std::shared_ptr<WellProductionProperties> production;
|
||||
std::shared_ptr<WellInjectionProperties> injection;
|
||||
std::shared_ptr<WellSegments> segments;
|
||||
};
|
||||
|
||||
std::ostream& operator<<( std::ostream&, const Well::WellInjectionProperties& );
|
||||
|
||||
@@ -31,6 +31,12 @@ struct WellBrineProperties
|
||||
void handleWSALT(const DeckRecord& rec);
|
||||
bool operator!=(const WellBrineProperties& other) const;
|
||||
bool operator==(const WellBrineProperties& other) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_saltConcentration);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
@@ -86,10 +86,17 @@ namespace Opm {
|
||||
bool operator==( const WellConnections& ) const;
|
||||
bool operator!=( const WellConnections& ) const;
|
||||
|
||||
int getHeadI() const;
|
||||
int getHeadJ() const;
|
||||
const std::vector<Connection>& getConnections() const;
|
||||
Connection::Order ordering() const { return this->m_ordering; }
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_ordering);
|
||||
serializer(headI);
|
||||
serializer(headJ);
|
||||
serializer.vector(m_connections);
|
||||
}
|
||||
|
||||
private:
|
||||
void addConnection(int i, int j , int k ,
|
||||
int complnum,
|
||||
|
||||
@@ -106,6 +106,27 @@ namespace Opm {
|
||||
double minReservoirFluidRate() const;
|
||||
bool operator==(const WellEconProductionLimits& other) const;
|
||||
bool operator!=(const WellEconProductionLimits& other) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_min_oil_rate);
|
||||
serializer(m_min_gas_rate);
|
||||
serializer(m_max_water_cut);
|
||||
serializer(m_max_gas_oil_ratio);
|
||||
serializer(m_max_water_gas_ratio);
|
||||
serializer(m_workover);
|
||||
serializer(m_end_run);
|
||||
serializer(m_followon_well);
|
||||
serializer(m_quantity_limit);
|
||||
serializer(m_secondary_max_water_cut);
|
||||
serializer(m_workover_secondary);
|
||||
serializer(m_max_gas_liquid_ratio);
|
||||
serializer(m_min_liquid_rate);
|
||||
serializer(m_max_temperature);
|
||||
serializer(m_min_reservoir_fluid_rate);
|
||||
}
|
||||
|
||||
private:
|
||||
double m_min_oil_rate;
|
||||
double m_min_gas_rate;
|
||||
|
||||
@@ -31,6 +31,12 @@ struct WellFoamProperties
|
||||
void handleWFOAM(const DeckRecord& rec);
|
||||
bool operator==(const WellFoamProperties& other) const;
|
||||
bool operator!=(const WellFoamProperties& other) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_foamConcentration);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
@@ -44,6 +44,16 @@ namespace Opm {
|
||||
void handleWPOLYMER(const DeckRecord& record);
|
||||
void handleWPMITAB(const DeckRecord& record);
|
||||
void handleWSKPTAB(const DeckRecord& record);
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_polymerConcentration);
|
||||
serializer(m_saltConcentration);
|
||||
serializer(m_plymwinjtable);
|
||||
serializer(m_skprwattable);
|
||||
serializer(m_skprpolytable);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,17 @@ public:
|
||||
startup_time == data.startup_time &&
|
||||
begin_report_step == data.begin_report_step;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(name);
|
||||
serializer(shut_reason);
|
||||
serializer(test_interval);
|
||||
serializer(num_test);
|
||||
serializer(startup_time);
|
||||
serializer(begin_report_step);
|
||||
}
|
||||
};
|
||||
|
||||
WellTestConfig();
|
||||
@@ -68,12 +79,16 @@ 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;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(wells);
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<WTESTWell> wells;
|
||||
|
||||
|
||||
@@ -38,7 +38,11 @@ namespace Opm {
|
||||
bool operator==(const WellTracerProperties& other) const;
|
||||
bool operator!=(const WellTracerProperties& other) const;
|
||||
|
||||
const ConcentrationMap& getConcentrations() const;
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_tracerConcentrations);
|
||||
}
|
||||
|
||||
private:
|
||||
ConcentrationMap m_tracerConcentrations;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Opm {
|
||||
{
|
||||
serializer(keyword_);
|
||||
serializer(category_);
|
||||
serializer(loc);
|
||||
loc.serializeOp(serializer);
|
||||
serializer(type_);
|
||||
serializer(name_);
|
||||
serializer(number_);
|
||||
|
||||
@@ -113,15 +113,17 @@ public:
|
||||
return this->m_data;
|
||||
};
|
||||
|
||||
const index_type& index() const {
|
||||
return this->m_index;
|
||||
};
|
||||
|
||||
bool operator==(const IOrderSet<T>& data) const {
|
||||
return this->index() == data.index() &&
|
||||
return this->m_index == data.m_index &&
|
||||
this->data() == data.data();
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_index);
|
||||
serializer(m_data);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ namespace Opm {
|
||||
double SIoffset = 0.0);
|
||||
|
||||
double getSIScaling() const;
|
||||
double getSIScalingRaw() const;
|
||||
double getSIOffset() const;
|
||||
|
||||
double convertRawToSi(double rawValue) const;
|
||||
@@ -43,6 +42,13 @@ namespace Opm {
|
||||
bool operator==( const Dimension& ) const;
|
||||
bool operator!=( const Dimension& ) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_SIfactor);
|
||||
serializer(m_SIoffset);
|
||||
}
|
||||
|
||||
private:
|
||||
double m_SIfactor;
|
||||
double m_SIoffset;
|
||||
|
||||
@@ -96,7 +96,6 @@ namespace Opm {
|
||||
|
||||
bool hasDimension(const std::string& dimension) const;
|
||||
bool equal(const UnitSystem& other) const;
|
||||
const std::map<std::string,Dimension>& getDimensions() const;
|
||||
|
||||
bool operator==( const UnitSystem& ) const;
|
||||
bool operator!=( const UnitSystem& ) const;
|
||||
@@ -117,8 +116,21 @@ namespace Opm {
|
||||
static UnitSystem newLAB();
|
||||
static UnitSystem newPVT_M();
|
||||
static UnitSystem newINPUT();
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_name);
|
||||
serializer(m_unittype);
|
||||
serializer.map(m_dimensions);
|
||||
serializer(m_use_count);
|
||||
if (!serializer.isSerializing())
|
||||
init();
|
||||
}
|
||||
|
||||
private:
|
||||
Dimension parseFactor( const std::string& ) const;
|
||||
void init();
|
||||
void initINPUT();
|
||||
void initMETRIC();
|
||||
void initFIELD();
|
||||
|
||||
@@ -247,18 +247,6 @@ namespace Opm {
|
||||
return this->input_path;
|
||||
}
|
||||
|
||||
const std::unique_ptr<UnitSystem>& Deck::activeUnitSystem() const {
|
||||
return this->activeUnits;
|
||||
}
|
||||
|
||||
const std::vector<DeckKeyword>& Deck::keywords() const {
|
||||
return keywordList;
|
||||
}
|
||||
|
||||
std::size_t Deck::unitSystemAccessCount() const {
|
||||
return unit_system_access_count;
|
||||
}
|
||||
|
||||
std::string Deck::makeDeckPath(const std::string& path) const {
|
||||
if (path.size() > 0 && path[0] == '/')
|
||||
return path;
|
||||
@@ -314,17 +302,17 @@ namespace Opm {
|
||||
}
|
||||
|
||||
bool Deck::operator==(const Deck& data) const {
|
||||
if ((activeUnitSystem() && !data.activeUnitSystem()) ||
|
||||
(!activeUnitSystem() && data.activeUnitSystem()))
|
||||
if ((activeUnits && !data.activeUnits) ||
|
||||
(!activeUnits && data.activeUnits))
|
||||
return false;
|
||||
|
||||
if (activeUnitSystem() && *activeUnitSystem() != *data.activeUnitSystem())
|
||||
if (activeUnits && *activeUnits != *data.activeUnits)
|
||||
return false;
|
||||
return this->keywords() == data.keywords() &&
|
||||
this->getDefaultUnitSystem() == data.getDefaultUnitSystem() &&
|
||||
this->getDataFile() == data.getDataFile() &&
|
||||
this->getInputPath() == data.getInputPath() &&
|
||||
this->unitSystemAccessCount() == data.unitSystemAccessCount();
|
||||
return this->keywordList == data.keywordList &&
|
||||
this->defaultUnits == data.defaultUnits &&
|
||||
this->m_dataFile == data.m_dataFile &&
|
||||
this->input_path == data.input_path &&
|
||||
this->unit_system_access_count == data.unit_system_access_count;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const Deck& deck) {
|
||||
|
||||
@@ -491,39 +491,6 @@ bool DeckItem::to_bool(std::string string_value) {
|
||||
throw std::invalid_argument("Could not convert string " + string_value + " to bool ");
|
||||
}
|
||||
|
||||
const std::vector<double>& DeckItem::dVal() const {
|
||||
return dval;
|
||||
}
|
||||
|
||||
const std::vector<int>& DeckItem::iVal() const {
|
||||
return ival;
|
||||
}
|
||||
|
||||
const std::vector<std::string>& DeckItem::sVal() const {
|
||||
return sval;
|
||||
}
|
||||
|
||||
const std::vector<UDAValue>& DeckItem::uVal() const {
|
||||
return uval;
|
||||
}
|
||||
|
||||
const std::vector<value::status>& DeckItem::valueStatus() const {
|
||||
return value_status;
|
||||
}
|
||||
|
||||
bool DeckItem::rawData() const {
|
||||
return raw_data;
|
||||
}
|
||||
|
||||
const std::vector<Dimension>& DeckItem::activeDimensions() const {
|
||||
return active_dimensions;
|
||||
}
|
||||
|
||||
const std::vector<Dimension>& DeckItem::defaultDimensions() const {
|
||||
return default_dimensions;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Explicit template instantiations. These must be manually maintained and
|
||||
* updated with changes in DeckItem so that code is emitted.
|
||||
|
||||
@@ -344,13 +344,5 @@ namespace Opm {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
const std::vector<DeckRecord>& DeckKeyword::records() const {
|
||||
return m_recordList;
|
||||
}
|
||||
|
||||
bool DeckKeyword::isSlashTerminated() const {
|
||||
return m_slashTerminated;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -173,8 +173,4 @@ namespace Opm {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
const std::vector<DeckItem>& DeckRecord::getItems() const {
|
||||
return m_items;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -735,38 +735,12 @@ void RestartConfig::handleScheduleSection(const SCHEDULESection& schedule, const
|
||||
}
|
||||
|
||||
|
||||
const TimeMap& RestartConfig::timeMap() const {
|
||||
return m_timemap;
|
||||
}
|
||||
|
||||
|
||||
bool RestartConfig::writeInitialRst() const {
|
||||
return m_write_initial_RST_file;
|
||||
}
|
||||
|
||||
|
||||
const DynamicState<RestartSchedule>& RestartConfig::restartSchedule() const {
|
||||
return restart_schedule;
|
||||
}
|
||||
|
||||
|
||||
const DynamicState<std::map<std::string,int>>&
|
||||
RestartConfig::restartKeywords() const {
|
||||
return restart_keywords;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<bool>& RestartConfig::saveKeywords() const {
|
||||
return save_keywords;
|
||||
}
|
||||
|
||||
|
||||
bool RestartConfig::operator==(const RestartConfig& data) const {
|
||||
return this->timeMap() == data.timeMap() &&
|
||||
this->getFirstRestartStep() == data.getFirstRestartStep() &&
|
||||
this->writeInitialRst() == data.writeInitialRst() &&
|
||||
this->restartSchedule() == data.restartSchedule() &&
|
||||
this->restartKeywords() == data.restartKeywords() &&
|
||||
this->saveKeywords() == data.saveKeywords();
|
||||
return this->m_timemap == data.m_timemap &&
|
||||
this->m_first_restart_step == data.m_first_restart_step &&
|
||||
this->m_write_initial_RST_file == data.m_write_initial_RST_file &&
|
||||
this->restart_schedule == data.restart_schedule &&
|
||||
this->restart_keywords == data.restart_keywords &&
|
||||
this->save_keywords == data.save_keywords;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,21 +143,6 @@ Action::Result ASTNode::eval(const Action::Context& context) const {
|
||||
}
|
||||
|
||||
|
||||
const std::vector<std::string>& ASTNode::argList() const {
|
||||
return arg_list;
|
||||
}
|
||||
|
||||
|
||||
double ASTNode::getNumber() const {
|
||||
return number;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<ASTNode>& ASTNode::childrens() const {
|
||||
return children;
|
||||
}
|
||||
|
||||
|
||||
bool ASTNode::operator==(const ASTNode& data) const {
|
||||
return type == data.type &&
|
||||
func_type == data.func_type &&
|
||||
|
||||
@@ -51,11 +51,6 @@ Action::Result AST::eval(const Action::Context& context) const {
|
||||
}
|
||||
|
||||
|
||||
std::shared_ptr<ASTNode> AST::getCondition() const {
|
||||
return condition;
|
||||
}
|
||||
|
||||
|
||||
bool AST::operator==(const AST& data) const {
|
||||
if ((condition && !data.condition) ||
|
||||
(!condition && data.condition))
|
||||
|
||||
@@ -180,34 +180,16 @@ const std::vector<Condition>& ActionX::conditions() const {
|
||||
}
|
||||
|
||||
|
||||
const std::vector<DeckKeyword>& ActionX::getKeywords() const {
|
||||
return this->keywords;
|
||||
}
|
||||
|
||||
|
||||
size_t ActionX::getRunCount() const {
|
||||
return run_count;
|
||||
}
|
||||
|
||||
std::time_t ActionX::getLastRun() const {
|
||||
return last_run;
|
||||
}
|
||||
|
||||
const AST& ActionX::getCondition() const {
|
||||
return condition;
|
||||
}
|
||||
|
||||
|
||||
bool ActionX::operator==(const ActionX& data) const {
|
||||
return this->name() == data.name() &&
|
||||
this->max_run() == data.max_run() &&
|
||||
this->min_wait() == data.min_wait() &&
|
||||
this->start_time() == data.start_time() &&
|
||||
this->getKeywords() == data.getKeywords() &&
|
||||
this->getCondition() == data.getCondition() &&
|
||||
this->keywords == data.keywords &&
|
||||
this->condition == data.condition &&
|
||||
this->conditions() == data.conditions() &&
|
||||
this->getRunCount() == data.getRunCount() &&
|
||||
this->getLastRun() == data.getLastRun();
|
||||
this->run_count == data.run_count &&
|
||||
this->last_run == data.last_run;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -97,11 +97,6 @@ std::vector<ActionX>::const_iterator Actions::end() const {
|
||||
}
|
||||
|
||||
|
||||
const std::vector<ActionX>& Actions::getActions() const {
|
||||
return actions;
|
||||
}
|
||||
|
||||
|
||||
bool Actions::operator==(const Actions& data) const {
|
||||
return actions == data.actions;
|
||||
}
|
||||
|
||||
@@ -44,12 +44,8 @@ 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();
|
||||
return this->m_events == data.m_events;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -83,12 +83,8 @@ size_t GConSale::size() const {
|
||||
return groups.size();
|
||||
}
|
||||
|
||||
const std::map<std::string, GConSale::GCONSALEGroup>& GConSale::getGroups() const {
|
||||
return groups;
|
||||
}
|
||||
|
||||
bool GConSale::operator==(const GConSale& data) const {
|
||||
return this->getGroups() == data.getGroups();
|
||||
return this->groups == data.groups;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,12 +68,8 @@ size_t GConSump::size() const {
|
||||
return groups.size();
|
||||
}
|
||||
|
||||
const std::map<std::string,GConSump::GCONSUMPGroup>& GConSump::getGroups() const {
|
||||
return groups;
|
||||
}
|
||||
|
||||
bool GConSump::operator==(const GConSump& data) const {
|
||||
return this->getGroups() == data.getGroups();
|
||||
return this->groups == data.groups;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -85,22 +85,6 @@ std::size_t Group::insert_index() const {
|
||||
return this->m_insert_index;
|
||||
}
|
||||
|
||||
std::size_t Group::initStep() const {
|
||||
return this->init_step;
|
||||
}
|
||||
|
||||
double Group::udqUndefined() const {
|
||||
return this->udq_undefined;
|
||||
}
|
||||
|
||||
const UnitSystem& Group::units() const {
|
||||
return this->unit_system;
|
||||
}
|
||||
|
||||
Group::GroupType Group::type() const {
|
||||
return this->group_type;
|
||||
}
|
||||
|
||||
bool Group::defined(size_t timeStep) const {
|
||||
return (timeStep >= this->init_step);
|
||||
}
|
||||
@@ -121,14 +105,6 @@ int Group::getGroupNetVFPTable() const {
|
||||
return this->vfp_table;
|
||||
}
|
||||
|
||||
const IOrderSet<std::string>& Group::iwells() const {
|
||||
return m_wells;
|
||||
}
|
||||
|
||||
const IOrderSet<std::string>& Group::igroups() const {
|
||||
return m_groups;
|
||||
}
|
||||
|
||||
bool Group::updateNetVFPTable(int vfp_arg) {
|
||||
if (this->vfp_table != vfp_arg) {
|
||||
this->vfp_table = vfp_arg;
|
||||
@@ -617,16 +593,16 @@ bool Group::operator==(const Group& data) const
|
||||
{
|
||||
return this->name() == data.name() &&
|
||||
this->insert_index() == data.insert_index() &&
|
||||
this->initStep() == data.initStep() &&
|
||||
this->udqUndefined() == data.udqUndefined() &&
|
||||
this->units() == data.units() &&
|
||||
this->type() == data.type() &&
|
||||
this->init_step == data.init_step &&
|
||||
this->udq_undefined == data.udq_undefined &&
|
||||
this->unit_system == data.unit_system &&
|
||||
this->group_type == data.group_type &&
|
||||
this->getGroupEfficiencyFactor() == data.getGroupEfficiencyFactor() &&
|
||||
this->getTransferGroupEfficiencyFactor() == data.getTransferGroupEfficiencyFactor() &&
|
||||
this->getGroupNetVFPTable() == data.getGroupNetVFPTable() &&
|
||||
this->parent() == data.parent() &&
|
||||
this->iwells() == data.iwells() &&
|
||||
this->igroups() == data.igroups() &&
|
||||
this->m_wells == data.m_wells &&
|
||||
this->m_groups == data.m_groups &&
|
||||
this->m_topup_phase == data.m_topup_phase &&
|
||||
this->injection_properties == data.injection_properties &&
|
||||
this->productionProperties() == data.productionProperties();
|
||||
|
||||
@@ -97,27 +97,15 @@ bool GuideRateConfig::has_group(const std::string& group) const {
|
||||
return (this->groups.count(group) > 0);
|
||||
}
|
||||
|
||||
std::shared_ptr<GuideRateModel> GuideRateConfig::getModel() const {
|
||||
return m_model;
|
||||
}
|
||||
|
||||
const std::unordered_map<std::string, GuideRateConfig::WellTarget>& GuideRateConfig::getWells() const {
|
||||
return wells;
|
||||
}
|
||||
|
||||
const std::unordered_map<std::string, GuideRateConfig::GroupTarget>& GuideRateConfig::getGroups() const {
|
||||
return groups;
|
||||
}
|
||||
|
||||
bool GuideRateConfig::operator==(const GuideRateConfig& data) const {
|
||||
if ((m_model && !data.m_model) || (!m_model && data.m_model))
|
||||
if ((this->m_model && !data.m_model) || (!this->m_model && data.m_model))
|
||||
return false;
|
||||
|
||||
if (m_model && !(*m_model == *data.m_model))
|
||||
if (this->m_model && !(*this->m_model == *data.m_model))
|
||||
return false;
|
||||
|
||||
return getWells() == data.getWells() &&
|
||||
getGroups() == data.getGroups();
|
||||
return this->wells == data.wells &&
|
||||
this->groups == data.groups;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -310,23 +310,4 @@ GuideRateModel::Target GuideRateModel::convert_target(Group::GuideRateTarget gro
|
||||
throw std::logic_error("Can not convert this .... ");
|
||||
}
|
||||
|
||||
double GuideRateModel::timeInterval() const {
|
||||
return time_interval;
|
||||
}
|
||||
|
||||
std::array<double,6> GuideRateModel::coefs() const {
|
||||
return {A, B, C, D, E, F};
|
||||
}
|
||||
|
||||
bool GuideRateModel::free_gas() const {
|
||||
return use_free_gas;
|
||||
}
|
||||
|
||||
bool GuideRateModel::defaultModel() const {
|
||||
return default_model;
|
||||
}
|
||||
|
||||
std::array<UDAValue,3> GuideRateModel::udaCoefs() const {
|
||||
return {alpha, beta, gamma};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,10 +307,6 @@ static constexpr double invalid_value = -1.e100;
|
||||
return m_valve.get();
|
||||
}
|
||||
|
||||
const std::shared_ptr<Valve>& Segment::getValve() const {
|
||||
return m_valve;
|
||||
}
|
||||
|
||||
int Segment::ecl_type_id() const {
|
||||
switch (this->m_segment_type) {
|
||||
case SegmentType::REGULAR:
|
||||
|
||||
@@ -565,9 +565,4 @@ WellSegments::MultiPhaseModel WellSegments::MultiPhaseModelFromString(const std:
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<Segment>& WellSegments::segments() const {
|
||||
return m_segments;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -206,11 +206,6 @@ 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;
|
||||
|
||||
@@ -133,16 +133,4 @@ namespace Opm {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ RFTConfig::RFTConfig(const TimeMap& tmap,
|
||||
const std::pair<bool, std::size_t>& rftTime,
|
||||
const WellOpenTimeMap& rftName,
|
||||
const WellOpenTimeMap& wellOpen,
|
||||
const RFTMap& rconfig, const PLTMap& pconfig)
|
||||
const ConfigMap<RFT>& rconfig, const ConfigMap<PLT>& pconfig)
|
||||
: tm(tmap)
|
||||
, first_rft_event(first_rft)
|
||||
, well_open_rft_time(rftTime)
|
||||
@@ -266,34 +266,14 @@ const TimeMap& RFTConfig::timeMap() const {
|
||||
return tm;
|
||||
}
|
||||
|
||||
const std::pair<bool, std::size_t>& RFTConfig::wellOpenRftTime() const {
|
||||
return well_open_rft_time;
|
||||
}
|
||||
|
||||
const RFTConfig::WellOpenTimeMap& RFTConfig::wellOpenRftName() const {
|
||||
return well_open_rft_name;
|
||||
}
|
||||
|
||||
const RFTConfig::WellOpenTimeMap& RFTConfig::wellOpen() const {
|
||||
return well_open;
|
||||
}
|
||||
|
||||
const RFTConfig::RFTMap& RFTConfig::rftConfig() const {
|
||||
return rft_config;
|
||||
}
|
||||
|
||||
const RFTConfig::PLTMap& RFTConfig::pltConfig() const {
|
||||
return plt_config;
|
||||
}
|
||||
|
||||
bool RFTConfig::operator==(const RFTConfig& data) const {
|
||||
return this->timeMap() == data.timeMap() &&
|
||||
this->firstRFTOutput() == data.firstRFTOutput() &&
|
||||
this->wellOpenRftTime() == data.wellOpenRftTime() &&
|
||||
this->wellOpenRftName() == data.wellOpenRftName() &&
|
||||
this->wellOpen() == data.wellOpen() &&
|
||||
this->rftConfig() == data.rftConfig() &&
|
||||
this->pltConfig() == data.pltConfig();
|
||||
return this->tm == data.tm &&
|
||||
this->first_rft_event == data.first_rft_event &&
|
||||
this->well_open_rft_time == data.well_open_rft_time &&
|
||||
this->well_open_rft_name == data.well_open_rft_name &&
|
||||
this->well_open == data.well_open &&
|
||||
this->rft_config == data.rft_config &&
|
||||
this->plt_config == data.plt_config;
|
||||
}
|
||||
|
||||
bool RFTConfig::outputRftAtWellopen(WellOpenTimeMap::const_iterator well_iter, const std::size_t report_step) const {
|
||||
|
||||
@@ -56,12 +56,8 @@ WList::storage::const_iterator WList::end() const {
|
||||
return this->well_list.end();
|
||||
}
|
||||
|
||||
const WList::storage& WList::wellList() const {
|
||||
return this->well_list;
|
||||
}
|
||||
|
||||
bool WList::operator==(const WList& data) const {
|
||||
return this->wellList() == data.wellList();
|
||||
return this->well_list == data.well_list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,12 +54,8 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
const std::map<std::string,WList>& WListManager::lists() const {
|
||||
return this->wlists;
|
||||
}
|
||||
|
||||
bool WListManager::operator==(const WListManager& data) const {
|
||||
return this->lists() == data.lists();
|
||||
return this->wlists == data.wlists;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -328,15 +328,15 @@ Well::Well(const std::string& wname_arg,
|
||||
double efficiencyFactor,
|
||||
double solventFraction,
|
||||
bool predictionMode,
|
||||
std::shared_ptr<const WellEconProductionLimits> econLimits,
|
||||
std::shared_ptr<const WellFoamProperties> foamProperties,
|
||||
std::shared_ptr<const WellPolymerProperties> polymerProperties,
|
||||
std::shared_ptr<const WellBrineProperties> brineProperties,
|
||||
std::shared_ptr<const WellTracerProperties> tracerProperties,
|
||||
std::shared_ptr<WellEconProductionLimits> econLimits,
|
||||
std::shared_ptr<WellFoamProperties> foamProperties,
|
||||
std::shared_ptr<WellPolymerProperties> polymerProperties,
|
||||
std::shared_ptr<WellBrineProperties> brineProperties,
|
||||
std::shared_ptr<WellTracerProperties> tracerProperties,
|
||||
std::shared_ptr<WellConnections> connections_arg,
|
||||
std::shared_ptr<const WellProductionProperties> production_arg,
|
||||
std::shared_ptr<const WellInjectionProperties> injection_arg,
|
||||
std::shared_ptr<const WellSegments> segments_arg) :
|
||||
std::shared_ptr<WellProductionProperties> production_arg,
|
||||
std::shared_ptr<WellInjectionProperties> injection_arg,
|
||||
std::shared_ptr<WellSegments> segments_arg) :
|
||||
wname(wname_arg),
|
||||
group_name(gname),
|
||||
init_step(init_step_arg),
|
||||
@@ -1335,29 +1335,13 @@ Well::GuideRateTarget Well::GuideRateTargetFromString( const std::string& string
|
||||
throw std::invalid_argument("Unknown enum state string: " + stringValue );
|
||||
}
|
||||
|
||||
const Well::WellGuideRate& Well::wellGuideRate() const {
|
||||
return guide_rate;
|
||||
}
|
||||
|
||||
const UnitSystem& Well::units() const {
|
||||
return unit_system;
|
||||
}
|
||||
|
||||
double Well::udqUndefined() const {
|
||||
return udq_undefined;
|
||||
}
|
||||
|
||||
bool Well::hasSegments() const {
|
||||
return segments != nullptr;
|
||||
}
|
||||
|
||||
|
||||
bool Well::operator==(const Well& data) const {
|
||||
if (this->hasSegments() != data.hasSegments()) {
|
||||
if ((segments && !data.segments) || (!segments && data.segments)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this->hasSegments() && (this->getSegments() != data.getSegments())) {
|
||||
if (segments && (this->getSegments() != data.getSegments())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1369,14 +1353,14 @@ bool Well::operator==(const Well& data) const {
|
||||
this->getHeadJ() == data.getHeadJ() &&
|
||||
this->getRefDepth() == data.getRefDepth() &&
|
||||
this->getPreferredPhase() == data.getPreferredPhase() &&
|
||||
this->units() == data.units() &&
|
||||
this->udqUndefined() == data.udqUndefined() &&
|
||||
this->unit_system == data.unit_system &&
|
||||
this->udq_undefined == data.udq_undefined &&
|
||||
this->getStatus() == data.getStatus() &&
|
||||
this->getDrainageRadius() == data.getDrainageRadius() &&
|
||||
this->getAllowCrossFlow() == data.getAllowCrossFlow() &&
|
||||
this->getAutomaticShutIn() == data.getAutomaticShutIn() &&
|
||||
this->isProducer() == data.isProducer() &&
|
||||
this->wellGuideRate() == data.wellGuideRate() &&
|
||||
this->guide_rate == data.guide_rate &&
|
||||
this->getEfficiencyFactor() == data.getEfficiencyFactor() &&
|
||||
this->getSolventFraction() == data.getSolventFraction() &&
|
||||
this->getEconLimits() == data.getEconLimits() &&
|
||||
|
||||
@@ -513,18 +513,4 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
|
||||
m_connections.erase(new_end, m_connections.end());
|
||||
}
|
||||
|
||||
|
||||
int WellConnections::getHeadI() const {
|
||||
return headI;
|
||||
}
|
||||
|
||||
|
||||
int WellConnections::getHeadJ() const {
|
||||
return headJ;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<Connection>& WellConnections::getConnections() const {
|
||||
return m_connections;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,8 +385,4 @@ namespace Opm {
|
||||
return (update_count > 0);
|
||||
}
|
||||
|
||||
int Well::WellProductionProperties::getNumProductionControls() const {
|
||||
return m_productionControls;
|
||||
}
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
@@ -151,13 +151,8 @@ size_t WellTestConfig::size() const {
|
||||
}
|
||||
|
||||
|
||||
const std::vector<WellTestConfig::WTESTWell>& WellTestConfig::getWells() const {
|
||||
return wells;
|
||||
}
|
||||
|
||||
|
||||
bool WellTestConfig::operator==(const WellTestConfig& data) const {
|
||||
return this->getWells() == data.getWells();
|
||||
return this->wells == data.wells;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,7 +55,4 @@ namespace Opm {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
const WellTracerProperties::ConcentrationMap& WellTracerProperties::getConcentrations() const {
|
||||
return m_tracerConcentrations;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,6 @@ namespace Opm {
|
||||
return m_SIfactor;
|
||||
}
|
||||
|
||||
double Dimension::getSIScalingRaw() const {
|
||||
return m_SIfactor;
|
||||
}
|
||||
|
||||
double Dimension::getSIOffset() const {
|
||||
return m_SIoffset;
|
||||
}
|
||||
|
||||
@@ -799,31 +799,7 @@ namespace {
|
||||
UnitSystem::UnitSystem(const UnitType unit) :
|
||||
m_unittype( unit )
|
||||
{
|
||||
switch(unit) {
|
||||
case(UnitType::UNIT_TYPE_METRIC):
|
||||
this->initMETRIC();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_FIELD):
|
||||
this->initFIELD();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_LAB):
|
||||
this->initLAB();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_PVT_M):
|
||||
this->initPVT_M();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_INPUT):
|
||||
this->initINPUT();
|
||||
break;
|
||||
|
||||
default:
|
||||
throw std::runtime_error("Tried to construct UnitSystem with unknown unit family.");
|
||||
break;
|
||||
};
|
||||
init();
|
||||
}
|
||||
|
||||
UnitSystem::UnitSystem(const std::string& name, UnitType unit,
|
||||
@@ -834,31 +810,7 @@ namespace {
|
||||
, m_dimensions(dimensions)
|
||||
, m_use_count(use_count)
|
||||
{
|
||||
switch(unit) {
|
||||
case(UnitType::UNIT_TYPE_METRIC):
|
||||
this->initMETRIC();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_FIELD):
|
||||
this->initFIELD();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_LAB):
|
||||
this->initLAB();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_PVT_M):
|
||||
this->initPVT_M();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_INPUT):
|
||||
this->initINPUT();
|
||||
break;
|
||||
|
||||
default:
|
||||
throw std::runtime_error("Tried to construct UnitSystem with unknown unit family.");
|
||||
break;
|
||||
};
|
||||
init();
|
||||
}
|
||||
|
||||
void UnitSystem::initINPUT() {
|
||||
@@ -1303,9 +1255,33 @@ namespace {
|
||||
return system;
|
||||
}
|
||||
|
||||
const std::map<std::string,Dimension>& UnitSystem::getDimensions() const {
|
||||
return m_dimensions;
|
||||
void UnitSystem::init()
|
||||
{
|
||||
switch(m_unittype) {
|
||||
case(UnitType::UNIT_TYPE_METRIC):
|
||||
this->initMETRIC();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_FIELD):
|
||||
this->initFIELD();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_LAB):
|
||||
this->initLAB();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_PVT_M):
|
||||
this->initPVT_M();
|
||||
break;
|
||||
|
||||
case(UnitType::UNIT_TYPE_INPUT):
|
||||
this->initINPUT();
|
||||
break;
|
||||
|
||||
default:
|
||||
throw std::runtime_error("Tried to construct UnitSystem with unknown unit family.");
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user