My Project
Loading...
Searching...
No Matches
Opm::Events Class Reference

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.
 

Detailed Description

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. ...

Member Function Documentation

◆ addEvent()

void Opm::Events::addEvent ( ScheduleEvents::Events  event)

Incorporate a new event into collection.

Parameters
[in]eventSingle event, such as a new well being introduced.

◆ clearEvent()

void Opm::Events::clearEvent ( std::uint64_t  eventMask)

Remove one or more events from collection.

Parameters
[in]eventMaskBit mask of events to clear from current collection.

◆ hasEvent()

bool Opm::Events::hasEvent ( std::uint64_t  eventMask) const

Event existence predicate.

Parameters
[in]eventMaskBit mask of events for which to check existence.
Returns
Whether not at least one of the events represented in eventMask is active in the current collection.

◆ merge()

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.

◆ operator==()

bool Opm::Events::operator== ( const Events data) const

Equality predicate.

Parameters
[in]dataObject against which
*this
will be tested for equality.
Returns
Whether or not
*this
is the same as data.

◆ serializeOp()

template<class Serializer >
void Opm::Events::serializeOp ( Serializer serializer)
inline

Convert between byte array and object representation.

Template Parameters
SerializerByte array conversion protocol.
Parameters
[in,out]serializerByte array conversion object.

The documentation for this class was generated from the following files: