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

Container of action keywords. More...

#include <Actions.hpp>

Public Member Functions

 Actions ()=default
 Default constructor.
 
 Actions (const std::vector< ActionX > &action, const std::vector< PyAction > &pyactions)
 Constructor.
 
void add (const ActionX &action)
 Include ActionX object in current collection.
 
void add (const PyAction &pyaction)
 Include PyAction object in current collection.
 
std::size_t ecl_size () const
 Number of ActionX objects in this collection.
 
std::size_t py_size () const
 Number of PyAction objects in this collection.
 
int max_input_lines () const
 Maximum number of records in any one ACTIONX block.
 
bool empty () const
 Whether or not this collection is empty.
 
bool ready (const State &state, std::time_t sim_time) const
 Runnability predicate.
 
const ActionXoperator[] (const std::string &name) const
 Look up ActionX object by name.
 
const ActionXoperator[] (std::size_t index) const
 Look up ActionX object by linear index.
 
std::vector< const ActionX * > pending (const State &state, std::time_t sim_time) const
 Retrieve ActionX objects that are ready to run.
 
std::vector< const PyAction * > pending_python (const State &state) const
 Retrieve PyAction objects that are ready to run.
 
bool has (const std::string &name) const
 ActionX object existence predicate.
 
auto begin () const
 Beginning of this collection's ActionX objects.
 
auto end () const
 End of this collection's ActionX objects.
 
bool operator== (const Actions &data) const
 Equality predicate.
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 Convert between byte array and object representation.
 

Static Public Member Functions

static Actions serializationTestObject ()
 Create a serialisation test object.
 

Detailed Description

Container of action keywords.

Mainly provides a list of action keywords, i.e., ACTIONX and/or PYACTION, whose conditions are ready for evaluation.

Constructor & Destructor Documentation

◆ Actions() [1/2]

Opm::Action::Actions::Actions ( )
default

Default constructor.

Resulting object is primarily useful as a target of a deserialisation operation, although may be subsequently populated through the add() member functions.

◆ Actions() [2/2]

Opm::Action::Actions::Actions ( const std::vector< ActionX > &  action,
const std::vector< PyAction > &  pyactions 
)

Constructor.

Forms collection from sequences of individual action objects.

Parameters
[in]actionSequence of action objects formed from ACTIONX keywords.
[in]pyactionsSequence of action objects formed from PYACTION keywords.

Member Function Documentation

◆ add() [1/2]

void Opm::Action::Actions::add ( const ActionX action)

Include ActionX object in current collection.

Any existing ActionX object with the same name will be replaced.

Parameters
[in]actionAction object to include in the current collection.

◆ add() [2/2]

void Opm::Action::Actions::add ( const PyAction pyaction)

Include PyAction object in current collection.

Any existing PyAction object with the same name will be replaced.

Parameters
[in]actionAction object to include in the current collection.

◆ empty()

bool Opm::Action::Actions::empty ( ) const

Whether or not this collection is empty.

True if this collection has neither ActionX nor PyAction objects.

◆ has()

bool Opm::Action::Actions::has ( const std::string &  name) const

ActionX object existence predicate.

Parameters
[in]nameAction name.
Returns
Whether or not name is among this collection's ActionX objects.

◆ max_input_lines()

int Opm::Action::Actions::max_input_lines ( ) const

Maximum number of records in any one ACTIONX block.

Needed for restart file output purposes.

◆ operator==()

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

◆ operator[]() [1/2]

const ActionX & Opm::Action::Actions::operator[] ( const std::string &  name) const

Look up ActionX object by name.

Throws an exception of type

std::range_error

if no ActionX object with the particular name exists in the current collection.

Parameters
[in]nameActionX object name.
Returns
ActionX object whose

◆ operator[]() [2/2]

const ActionX & Opm::Action::Actions::operator[] ( std::size_t  index) const

Look up ActionX object by linear index.

Parameters
[in]indexObject index. Must be in the range 0..ecl_size()-1.
Returns
Associated ActionX object.

◆ pending()

std::vector< const ActionX * > Opm::Action::Actions::pending ( const State state,
std::time_t  sim_time 
) const

Retrieve ActionX objects that are ready to run.

List comprised of those ActionX objects from the internal collection whose run counts have not exceeded their associate maximum limit, and for which the minimum wait time since last execution has passed.

Parameters
[in]stateCurrent run's action state, especially run counts and trigger times.
[in]sim_timeCurrent simulation time.
Returns
Those ActionX objects that are ready to run at this time.

◆ pending_python()

std::vector< const PyAction * > Opm::Action::Actions::pending_python ( const State state) const

Retrieve PyAction objects that are ready to run.

Parameters
[in]stateCurrent run's action state, especially run counts.
Returns
Those PyAction objects that are ready to run.

◆ ready()

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

Runnability predicate.

Parameters
[in]stateCurrent run's action state, especially run counts and trigger times.
[in]sim_timeCurrent simulation time.
Returns
Whether or not any ActionX objects in the current collection are ready to run at time sim_time.

◆ serializeOp()

template<class Serializer >
void Opm::Action::Actions::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: