|
My Project
|
Events tied to a time and applicable to the simulation or an individual well or group. More...
#include <Events.hpp>
Public Member Functions | |
| void | addEvent (ScheduleEvents::Events event) |
| Incorporate a new event into collection. | |
| void | clearEvent (std::uint64_t eventMask) |
| Remove one or more events from collection. | |
| void | reset () |
| Remove all events from collection. | |
| void | merge (const Events &events) |
| Merge current event collection with other. | |
| bool | hasEvent (std::uint64_t eventMask) const |
| Event existence predicate. | |
| bool | operator== (const Events &data) const |
| Equality predicate. | |
| template<class Serializer > | |
| void | serializeOp (Serializer &serializer) |
| Convert between byte array and object representation. | |
Static Public Member Functions | |
| static Events | serializationTestObject () |
| Create a serialisation test object. | |
Events tied to a time and applicable to the simulation or an individual well or group.
The event time typically coincides with the start of a report step, although could be different if the event is triggered in an ACTION block.
This class implements a simple system for recording when various events happen in the Schedule file. The purpose of the class is that downstream code can query this system whether a certain a event has taken place, and then perform potentially expensive calculations conditionally:
auto events = schedule->getEvents(); if (events.hasEvent(SchedulEvents::NEW_WELL, reportStep)) // Perform expensive calculation which must be performed // when a new well is introduced. ...
| void Opm::Events::addEvent | ( | ScheduleEvents::Events | event | ) |
Incorporate a new event into collection.
| [in] | event | Single event, such as a new well being introduced. |
| void Opm::Events::clearEvent | ( | std::uint64_t | eventMask | ) |
Remove one or more events from collection.
| [in] | eventMask | Bit mask of events to clear from current collection. |
| bool Opm::Events::hasEvent | ( | std::uint64_t | eventMask | ) | const |
Event existence predicate.
| [in] | eventMask | Bit mask of events for which to check existence. |
eventMask is active in the current collection. | void Opm::Events::merge | ( | const Events & | events | ) |
Merge current event collection with other.
Resulting collection (*this) has the union of the events in both collections.
| bool Opm::Events::operator== | ( | const Events & | data | ) | const |
Equality predicate.
| [in] | data | Object against which *this
|
data.
|
inline |
Convert between byte array and object representation.
| Serializer | Byte array conversion protocol. |
| [in,out] | serializer | Byte array conversion object. |