opm-common
Loading...
Searching...
No Matches
Opm::WListManager Class Reference

Collection of run's known well lists. More...

#include <WListManager.hpp>

Public Member Functions

 WListManager ()=default
 Default constructor.
 WListManager (const RestartIO::RstState &rst_state)
 Constructor.
std::size_t WListSize () const
 Number of well lists in current collection.
bool hasWell (const std::string &pattern) const
 Whether or not one or more wells matching a well list name or well list template exists.
bool hasList (const std::string &wlistName) const
 Predicate for existence of particular well lists.
WListgetList (const std::string &name)
 Access individual well list by name.
const WListgetList (const std::string &name) const
 Access individual well list by name.
WListnewList (const std::string &name, const std::vector< std::string > &wname)
 Create a new well list with initial sequence of wells.
auto begin () const
 Start of sequence of run's current well lists.
auto end () const
 End of sequence of run's current well lists.
const std::vector< std::string > & getWListNames (const std::string &wname) const
 Sequence of well lists containing named well.
std::size_t getNoWListsWell (const std::string &wname) const
 Number of well lists containing named well.
bool hasWList (const std::string &wname) const
 Whether or not named well is on any current well list.
void addWListWell (const std::string &wname, const std::string &wlname)
 Add named well to named well list.
void addOrCreateWellList (const std::string &wlname, const std::vector< std::string > &wnames)
 Add sequence of wells to a named well list.
bool delWell (const std::string &wname)
 Remove named well from all existing well lists.
bool delWListWell (const std::string &wname, const std::string &wlname)
 Remove named well from specific, named well list.
bool operator== (const WListManager &data) const
 Equality predicate.
std::vector< std::string > wells (const std::string &wlist_pattern) const
 All wells on all well lists matching a name pattern.
template<class Serializer>
void serializeOp (Serializer &serializer)
 Convert between byte array and object representation.

Static Public Member Functions

static WListManager serializationTestObject ()
 Create a serialisation test object.

Detailed Description

Collection of run's known well lists.

Manages how well lists are created (NEW), how new wells are added to new or existing lists (ADD), how wells move between well lists (MOV), and how to remove a set of wells from an existing well list (DEL).

Constructor & Destructor Documentation

◆ WListManager()

Opm::WListManager::WListManager ( const RestartIO::RstState & rst_state)
explicit

Constructor.

Forms collection of well lists from restart file information.

Parameters
[in]rst_stateRestart file information.

Member Function Documentation

◆ addOrCreateWellList()

void Opm::WListManager::addOrCreateWellList ( const std::string & wlname,
const std::vector< std::string > & wnames )

Add sequence of wells to a named well list.

Will create the well list if it does not already exist. Implements the ADD operation.

Parameters
[in]wlnameWell list name, including the leading asterisk.
[in]wnamesSequence of named wells that will be added to well list wlname.

◆ addWListWell()

void Opm::WListManager::addWListWell ( const std::string & wname,
const std::string & wlname )

Add named well to named well list.

Will throw an exception if the well list does not already exist.

Parameters
[in]wnameWell name.
[in]wlnameWell list name, including leading asterisk.

◆ begin()

auto Opm::WListManager::begin ( ) const
inline

Start of sequence of run's current well lists.

Sorted by well list name.

◆ delWell()

bool Opm::WListManager::delWell ( const std::string & wname)

Remove named well from all existing well lists.

No change if named well is not on any existing well list. Implements the DEL operation.

Parameters
[in]wnameWell name.
Returns
Whether or not any well list changed as a result of removing well wname.

◆ delWListWell()

bool Opm::WListManager::delWListWell ( const std::string & wname,
const std::string & wlname )

Remove named well from specific, named well list.

Parameters
[in]wnameNamed well.
[in]wlnameWell list name, including leading asterisk.
Returns
Whether or not wlname changed.

◆ getList() [1/2]

WList & Opm::WListManager::getList ( const std::string & name)

Access individual well list by name.

Mutable version.

Will throw an exception if the well list does not exist. Use predicate hasList() to check for existence before using this function.

Parameters
[in]nameWell list name, including the leading asterisk.
Returns
Mutable well list named name.

◆ getList() [2/2]

const WList & Opm::WListManager::getList ( const std::string & name) const

Access individual well list by name.

Read only version.

Will throw an exception if the well list does not exist. Use predicate hasList() to check for existence before using this function.

Parameters
[in]nameWell list name, including the leading asterisk.
Returns
Immutable well list named name.

◆ getNoWListsWell()

std::size_t Opm::WListManager::getNoWListsWell ( const std::string & wname) const

Number of well lists containing named well.

Parameters
[in]wnameWell name.
Returns
Number of well lists containing well wname.

◆ getWListNames()

const std::vector< std::string > & Opm::WListManager::getWListNames ( const std::string & wname) const

Sequence of well lists containing named well.

Parameters
[in]wnameWell name.
Returns
Sequence of well lists containing well wname.

◆ hasList()

bool Opm::WListManager::hasList ( const std::string & wlistName) const

Predicate for existence of particular well lists.

Parameters
[in]wlistNameWell list name, including leading asterisk.
Returns
Whether or not well list named wlistName exists in current collection.

◆ hasWell()

bool Opm::WListManager::hasWell ( const std::string & pattern) const

Whether or not one or more wells matching a well list name or well list template exists.

This predicate checks whether or not a well list exists matching the pattern and that that well list is non-empty.

Parameters
[in]patternWell list name or well list template.
Returns
Whether or not there are any current wells matching pattern.

◆ hasWList()

bool Opm::WListManager::hasWList ( const std::string & wname) const

Whether or not named well is on any current well list.

Parameters
[in]wnameWell name.
Returns
Whether or not well wname is on any well list.

◆ newList()

WList & Opm::WListManager::newList ( const std::string & name,
const std::vector< std::string > & wname )

Create a new well list with initial sequence of wells.

Implements the NEW operation.

Parameters
[in]nameWell list name, including the leading asterisk.
[in]wnameInitial collection of wells in well list name.
Returns
New well list name.

◆ operator==()

bool Opm::WListManager::operator== ( const WListManager & data) const

Equality predicate.

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

◆ serializeOp()

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

Convert between byte array and object representation.

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

◆ wells()

std::vector< std::string > Opm::WListManager::wells ( const std::string & wlist_pattern) const

All wells on all well lists matching a name pattern.

Well names are unique.

Parameters
[in]wlist_patternWell list name or well list name pattern. Should include the leading asterisk.
Returns
Unique well names from all well lists matching the wlist_pattern. Empty if no such list exists, or if all matching well lists are empty.

The documentation for this class was generated from the following files:
  • opm/input/eclipse/Schedule/Well/WListManager.hpp
  • opm/input/eclipse/Schedule/Well/WListManager.cpp