19#ifndef SCHEDULE_EVENTS_HPP
20#define SCHEDULE_EVENTS_HPP
24#include <unordered_map>
28 namespace ScheduleEvents {
30 enum Events : std::uint64_t {
36 NEW_WELL = (UINT64_C(1) << 0),
41 WELL_WELSPECS_UPDATE = (UINT64_C(1) << 1),
47 NEW_GROUP = (UINT64_C(1) << 3),
54 PRODUCTION_UPDATE = (UINT64_C(1) << 4),
55 INJECTION_UPDATE = (UINT64_C(1) << 5),
61 WELL_STATUS_CHANGE = (UINT64_C(1) << 7),
64 COMPLETION_CHANGE = (UINT64_C(1) << 8),
67 GROUP_CHANGE = (UINT64_C(1) << 9),
70 GEO_MODIFIER = (UINT64_C(1) << 10),
73 TUNING_CHANGE = (UINT64_C(1) << 11),
76 VFPINJ_UPDATE = (UINT64_C(1) << 12),
77 VFPPROD_UPDATE = (UINT64_C(1) << 13),
80 GROUP_PRODUCTION_UPDATE = (UINT64_C(1) << 14),
81 GROUP_INJECTION_UPDATE = (UINT64_C(1) << 15),
84 WELL_PRODUCTIVITY_INDEX = (UINT64_C(1) << 16),
87 WELLGROUP_EFFICIENCY_UPDATE = (UINT64_C(1) << 17),
90 INJECTION_TYPE_CHANGED = (UINT64_C(1) << 18),
93 WELL_SWITCHED_INJECTOR_PRODUCER = (UINT64_C(1) << 19),
96 ACTIONX_WELL_EVENT = (UINT64_C(1) << 20),
103 REQUEST_OPEN_WELL = (UINT64_C(1) << 21),
134 void addEvent(ScheduleEvents::Events event);
158 bool hasEvent(std::uint64_t eventMask)
const;
174 template<
class Serializer>
177 serializer(m_events);
182 std::uint64_t m_events = 0;
196 void addWell(
const std::string& wname);
202 void addGroup(
const std::string& gname);
210 void addEvent(
const std::string& wgname, ScheduleEvents::Events event);
220 void clearEvent(
const std::string& wgname, std::uint64_t eventMask);
241 bool has(
const std::string& wgname)
const;
253 bool hasEvent(
const std::string& wgname, std::uint64_t eventMask)
const;
264 const Events&
at(
const std::string& wgname)
const;
280 template<
class Serializer>
283 serializer(m_wellgroup_events);
288 std::unordered_map<std::string, Events> m_wellgroup_events{};
Events tied to a time and applicable to the simulation or an individual well or group.
Definition Events.hpp:126
void clearEvent(std::uint64_t eventMask)
Remove one or more events from collection.
Definition Events.cpp:43
void reset()
Remove all events from collection.
Definition Events.cpp:50
void merge(const Events &events)
Merge current event collection with other.
Definition Events.cpp:55
bool operator==(const Events &data) const
Equality predicate.
Definition Events.cpp:65
static Events serializationTestObject()
Create a serialisation test object.
Definition Events.cpp:31
void addEvent(ScheduleEvents::Events event)
Incorporate a new event into collection.
Definition Events.cpp:38
bool hasEvent(std::uint64_t eventMask) const
Event existence predicate.
Definition Events.cpp:60
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition Events.hpp:175
Class for (de-)serializing.
Definition Serializer.hpp:94
Collection of events tied to a time and associated to specific, named wells or groups.
Definition Events.hpp:188
void merge(const WellGroupEvents &events)
Merge current event collection with other.
Definition Events.cpp:129
void addWell(const std::string &wname)
Include a named well into the events collection.
Definition Events.cpp:80
bool operator==(const WellGroupEvents &data) const
Equality predicate.
Definition Events.cpp:167
bool hasEvent(const std::string &wgname, std::uint64_t eventMask) const
Query current collection for one or more specific events associated to a specific well or group.
Definition Events.cpp:144
const Events & at(const std::string &wgname) const
Look up collection of events for named well or group.
Definition Events.cpp:155
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition Events.hpp:281
void addGroup(const std::string &gname)
Include a named group in the events collection.
Definition Events.cpp:88
void addEvent(const std::string &wgname, ScheduleEvents::Events event)
Add a single event for a named well or group.
Definition Events.cpp:96
bool has(const std::string &wgname) const
Check if any events have ever been registered for a named well or group.
Definition Events.cpp:138
void reset()
Remove all events for all known wells and groups.
Definition Events.cpp:118
void clearEvent(const std::string &wgname, std::uint64_t eventMask)
Remove one or more individual events from the collection tied to a single named well or group.
Definition Events.cpp:109
static WellGroupEvents serializationTestObject()
Create a serialisation test object.
Definition Events.cpp:72
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30