My Project
Loading...
Searching...
No Matches
Opm::Action::ActionX Class Reference

Public Member Functions

 ActionX ()
 Default constructor.
 
 ActionX (const std::string &name, std::size_t max_run, double min_wait, std::time_t start_time)
 Constructor.
 
 ActionX (const DeckRecord &record, std::time_t start_time)
 Constructor.
 
 ActionX (const RestartIO::RstAction &rst_action)
 Constructor.
 
 ActionX (const std::string &name, std::size_t max_run, double min_wait, std::time_t start_time, std::vector< Condition > &&conditions, const std::vector< std::string > &tokens)
 Constructor.
 
void addKeyword (const DeckKeyword &kw)
 Include SCHEDULE section keyword in block executed when action triggers.
 
bool ready (const State &state, std::time_t sim_time) const
 Query whether or not the current ActionX object is ready to run.
 
Result eval (const Context &context) const
 Evaluate the action's conditions at current dynamic state.
 
std::vector< std::string > wellpi_wells (const WellMatcher &well_matcher, const Result::MatchingEntities &matches) const
 Retrive list of well names used in action block WELPI keywords.
 
void required_summary (std::unordered_set< std::string > &required_summary) const
 Export all summary vectors needed to evaluate the conditions of the current ActionX object.
 
std::string name () const
 Retrieve name of action object.
 
std::size_t max_run () const
 Retrieve maximum number of times this action can run/trigger.
 
double min_wait () const
 Retrieve minimum wait time, in seconds of simulated time, between action triggers.
 
std::size_t id () const
 Retrieve distinguishing numeric ID of this action object.
 
void update_id (std::size_t id)
 Assign distinguishing numeric ID of this action object.
 
std::time_t start_time () const
 Retrieve point in time at which this action object is created.
 
auto begin () const
 Start of action block SCHEDULE keyword sequence.
 
auto end () const
 End of action block SCHEDULE keyword sequence.
 
const std::vector< Condition > & conditions () const
 Intermediate representation of triggering conditions for restart file output purposes.
 
std::vector< std::string > keyword_strings () const
 Textual representation of action block SCHEDULE keywords.
 
bool operator== (const ActionX &data) const
 Equality predicate.
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 Convert between byte array and object representation.
 

Static Public Member Functions

static bool valid_keyword (const std::string &keyword)
 Keyword validity predicate.
 
static ActionX serializationTestObject ()
 Create a serialisation test object.
 

Constructor & Destructor Documentation

◆ ActionX() [1/5]

Opm::Action::ActionX::ActionX ( )

Default constructor.

Creates an invalid object that is only usable as a target for a deserialisation process.

◆ ActionX() [2/5]

Opm::Action::ActionX::ActionX ( const std::string &  name,
std::size_t  max_run,
double  min_wait,
std::time_t  start_time 
)

Constructor.

Creates an invalid object without any triggering conditions. Mostly usable as an error state.

Parameters
[in]nameName of action object. Typically from first record of ACTIONX keyword.
[in]max_runMaximum number of times this action can run/trigger. A value of zero is treated as an unlimited number of runs.
[in]min_waitMinimum wait time, in seconds, between two successful triggerings of this action object.
[in]start_timePoint in time at which this action object is created. Typically the simulated time at the start of the report step at which an ACTIONX keyword is encountered. The first wait time is relative to this start time.

◆ ActionX() [3/5]

Opm::Action::ActionX::ActionX ( const DeckRecord record,
std::time_t  start_time 
)

Constructor.

Creates an invalid object that is mostly usable as an error state. Delegates to four argument constructor.

Parameters
[in]recordFirst record of an ACTIONX keyword.
[in]start_timePoint in time at which this action object is created. Typically the simulated time at the start of the report step at which an ACTIONX keyword is encountered. The first wait time is relative to this start time.

◆ ActionX() [4/5]

Opm::Action::ActionX::ActionX ( const RestartIO::RstAction rst_action)
explicit

Constructor.

Forms the ActionX object based on restart file information.

Parameters
[in]rst_actionRestart file representation of an ACTIONX block.

◆ ActionX() [5/5]

Opm::Action::ActionX::ActionX ( const std::string &  name,
std::size_t  max_run,
double  min_wait,
std::time_t  start_time,
std::vector< Condition > &&  conditions,
const std::vector< std::string > &  tokens 
)

Constructor.

Internalises the triggering condition into an expression tree and records minimum wait time and maximum run counts. Associate SCHEDULE keywords to run when the action triggers must be included through addKeyword() calls.

Parameters
[in]nameName of action object. Typically from first record of ACTIONX keyword.
[in]max_runMaximum number of times this action can run/trigger. A value of zero is treated as an unlimited number of runs.
[in]min_waitMinimum wait time, in seconds, between two successful triggerings of this action object.
[in]start_timePoint in time at which this action object is created. Typically the simulated time at the start of the report step at which an ACTIONX keyword is encountered. The first wait time is relative to this start time.
[in]conditionsPartially formed individual statements of the triggering conditions for this action. For restart file output purposes.
[in]tokensTextual representation of condition block. Will be used to form the internal expression tree representation of the triggering condition.

Member Function Documentation

◆ addKeyword()

void Opm::Action::ActionX::addKeyword ( const DeckKeyword kw)

Include SCHEDULE section keyword in block executed when action triggers.

Parameters
[in]kwSCHEDULE section keyword.

◆ eval()

Result Opm::Action::ActionX::eval ( const Context context) const

Evaluate the action's conditions at current dynamic state.

Parameters
[in]contextCurrent summary vectors and wells
Returns
Condition value. A 'true' result means the condition is satisfied while a 'false' result means the condition is not satisfied. Any wells for which the expression is true will be included in the result set. A 'false' result has no matching wells.

◆ keyword_strings()

std::vector< std::string > Opm::Action::ActionX::keyword_strings ( ) const

Textual representation of action block SCHEDULE keywords.

For restart file output purposes.

◆ operator==()

bool Opm::Action::ActionX::operator== ( const ActionX 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.

◆ ready()

bool Opm::Action::ActionX::ready ( const State state,
std::time_t  sim_time 
) const

Query whether or not the current ActionX object is ready to run.

Will typically consider at least the object's current run count and wait times.

Parameters
[in]stateDynamic run count and run time.
[in]sim_timeSimulated time since simulation start.
Returns
Whether or not this ActionX object is ready to run.

◆ required_summary()

void Opm::Action::ActionX::required_summary ( std::unordered_set< std::string > &  required_summary) const

Export all summary vectors needed to evaluate the conditions of the current ActionX object.

Parameters
[in,out]required_summaryNamed summary vectors. Upon completion, any additional summary vectors needed to evaluate full condition block of the current ActionX object will be included in this set.

◆ serializeOp()

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

Convert between byte array and object representation.

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

◆ start_time()

std::time_t Opm::Action::ActionX::start_time ( ) const
inline

Retrieve point in time at which this action object is created.

Typically the simulated time at the start of the report step at which an ACTIONX keyword is encountered. The first wait time is relative to this start time.

◆ update_id()

void Opm::Action::ActionX::update_id ( std::size_t  id)

Assign distinguishing numeric ID of this action object.

Typically invoked only if encountering an ACTIONX keyword naming the same action object as an earlier ACTIONX keyword.

◆ valid_keyword()

bool Opm::Action::ActionX::valid_keyword ( const std::string &  keyword)
static

Keyword validity predicate.

Parameters
[in]keywordName of SCHEDULE section keyword.
Returns
Whether or not the current implementation supports using keyword in an ACTIONX block.

◆ wellpi_wells()

std::vector< std::string > Opm::Action::ActionX::wellpi_wells ( const WellMatcher &  well_matcher,
const Result::MatchingEntities matches 
) const

Retrive list of well names used in action block WELPI keywords.

Parameters
[in]well_matcherFinal arbiter for wells currently known to simulator.
[in]matchesList of entities for which the current action triggered. Function wellpi_wells() will only inspect the set of matching/triggering wells, and only if a WELPI keyword in the current action's keyword block uses the well name pattern "?".
Returns
List of well names used in this action's WELPI keywords, if any. List returned in sorted order defined by well_matcher.

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