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

Classes

struct  EnumeratedItems

Public Member Functions

 UDQSet (const std::string &name, UDQVarType var_type)
 Construct empty, named UDQ set of specific variable type.
 UDQSet (const std::string &name, UDQVarType var_type, const std::vector< std::string > &wgnames)
 Construct named UDQ set of specific variable type for particular set of well/group names.
 UDQSet (const std::string &name, UDQVarType var_type, const std::vector< EnumeratedItems > &items)
 Construct named UDQ set of specific variable type for numbered well items-typically segments or connections.
 UDQSet (const std::string &name, UDQVarType var_type, std::size_t size)
 Construct empty, named UDQ set of specific variable type.
 UDQSet (const std::string &name, std::size_t size)
 Construct empty, named UDQ set of specific variable type.
void assign (const std::optional< double > &value)
 Assign value to every element of the UDQ set.
void assign (std::size_t index, const std::optional< double > &value)
 Assign value to specific element of the UDQ set.
void assign (const std::string &wgname, const std::optional< double > &value)
 Assign value to specific element of the UDQ set.
void assign (const std::string &wgname, std::size_t number, const std::optional< double > &value)
 Assign value to specific element of the UDQ set.
void assign (double value)
 Assign value to every element of the UDQ set.
void assign (std::size_t index, double value)
 Assign value to specific element of the UDQ set.
void assign (const std::string &wgname, double value)
 Assign value to specific element of the UDQ set.
bool has (const std::string &name) const
 Predicate for whether or not named UDQ element exists.
std::size_t size () const
 Number of elements in UDQ set.
void operator+= (const UDQSet &rhs)
 Add other UDQ set into this.
void operator+= (double rhs)
 Add numeric value to all defined elements of this UDQ set.
void operator-= (const UDQSet &rhs)
 Subtract UDQ set from this.
void operator-= (double rhs)
 Subtract numeric values from all defined elements of this UDQ set.
void operator*= (const UDQSet &rhs)
 Multiply other UDQ set into this.
void operator*= (double rhs)
 Multiply every defined element with numeric element.
void operator/= (const UDQSet &rhs)
 Divide this UDQ set by other UDQ set.
void operator/= (double rhs)
 Divide every defined element with numeric element.
const UDQScalaroperator[] (std::size_t index) const
 Access individual UDQ scalar at particular index in UDQ set.
const UDQScalaroperator[] (const std::string &wgname) const
 Access individual UDQ scalar assiociated to particular named entity (well or group).
const UDQScalaroperator() (const std::string &well, const std::size_t item) const
 Access individual UDQ scalar assiociated to particular named well and numbered sub-entity of that named well.
std::vector< UDQScalar >::const_iterator begin () const
 Range-for traversal support (beginning of range).
std::vector< UDQScalar >::const_iterator end () const
 Range-for traversal support (one past end of range).
std::vector< std::string > wgnames () const
 Retrive names of entities associate to this UDQ set.
std::vector< double > defined_values () const
 Retrive the UDQ set's defined values only.
std::size_t defined_size () const
 Retrive the UDQ set's number of defined values.
const std::string & name () const
 Retrive the name of this UDQ set.
void name (const std::string &name)
 Assign the name of this UDQ set.
UDQVarType var_type () const
 Retrive the variable type of this UDQ set (e.g., well, group, field, segment &c).
bool operator== (const UDQSet &other) const
 Equality comparison operator.

Static Public Member Functions

static std::vector< EnumeratedItemsenumerateItems (const RegionSetMatchResult &regionSet)
static std::vector< EnumeratedItemsenumerateItems (const SegmentSet &segmentSet)
static UDQSet scalar (const std::string &name, const std::optional< double > &scalar_value)
 Form a UDQ set pertaining to a single scalar value.
static UDQSet scalar (const std::string &name, double value)
 Form a UDQ set pertaining to a single scalar value.
static UDQSet empty (const std::string &name)
 Form an empty UDQ set.
static UDQSet wells (const std::string &name, const std::vector< std::string > &wells)
 Form a UDQ set pertaining to a set of named wells.
static UDQSet wells (const std::string &name, const std::vector< std::string > &wells, double scalar_value)
 Form a UDQ set pertaining to a set of named wells.
static UDQSet groups (const std::string &name, const std::vector< std::string > &groups)
 Form a UDQ set pertaining to a set of named groups.
static UDQSet groups (const std::string &name, const std::vector< std::string > &groups, double scalar_value)
 Form a UDQ set pertaining to a set of named groups.
static UDQSet field (const std::string &name, double scalar_value)
 Form a UDQ set at the field level.
static UDQSet segments (const std::string &name, const std::vector< EnumeratedItems > &segments)
static UDQSet segments (const std::string &name, const std::vector< EnumeratedItems > &segments, const double scalar_value)
static UDQSet regions (const std::string &name, const std::vector< EnumeratedItems > &regSetColl)
static UDQSet regions (const std::string &name, const std::vector< EnumeratedItems > &regSetColl, const double scalar_value)

Constructor & Destructor Documentation

◆ UDQSet() [1/5]

Opm::UDQSet::UDQSet ( const std::string & name,
UDQVarType var_type )

Construct empty, named UDQ set of specific variable type.

Parameters
[in]nameUDQ set name
[in]var_typeUDQ set's variable type.

◆ UDQSet() [2/5]

Opm::UDQSet::UDQSet ( const std::string & name,
UDQVarType var_type,
const std::vector< std::string > & wgnames )

Construct named UDQ set of specific variable type for particular set of well/group names.

Parameters
[in]nameUDQ set name
[in]var_typeUDQ set's variable type.
[in]wgnamesWell or group names.

◆ UDQSet() [3/5]

Opm::UDQSet::UDQSet ( const std::string & name,
UDQVarType var_type,
const std::vector< EnumeratedItems > & items )

Construct named UDQ set of specific variable type for numbered well items-typically segments or connections.

Parameters
[in]nameUDQ set name
[in]var_typeUDQ set's variable type.
[in]itemsEnumerated entities for which this UDQ set is defined. Typically represents a set of segments in an MS well or a set of well/reservoir connections.

◆ UDQSet() [4/5]

Opm::UDQSet::UDQSet ( const std::string & name,
UDQVarType var_type,
std::size_t size )

Construct empty, named UDQ set of specific variable type.

Parameters
[in]nameUDQ set name
[in]var_typeUDQ set's variable type.
[in]sizeSize of value

◆ UDQSet() [5/5]

Opm::UDQSet::UDQSet ( const std::string & name,
std::size_t size )

Construct empty, named UDQ set of specific variable type.

Parameters
[in]nameUDQ set name
[in]sizeSize of value

Member Function Documentation

◆ assign() [1/7]

void Opm::UDQSet::assign ( const std::optional< double > & value)

Assign value to every element of the UDQ set.

Parameters
[in]valueNumeric value for each element. Empty optional removes element from UDQ set.

◆ assign() [2/7]

void Opm::UDQSet::assign ( const std::string & wgname,
const std::optional< double > & value )

Assign value to specific element of the UDQ set.

Parameters
[in]wgnameNamed element of UDQ set defined for wells/groups.
[in]valueNumeric value of specific UDQ set element. Empty optional removes element from UDQ set.

◆ assign() [3/7]

void Opm::UDQSet::assign ( const std::string & wgname,
double value )

Assign value to specific element of the UDQ set.

Parameters
[in]wgnameNamed element of UDQ set defined for wells/groups.
[in]valueNumeric value of specific UDQ set element. Non-finite numeric value removes element from UDQ set.

◆ assign() [4/7]

void Opm::UDQSet::assign ( const std::string & wgname,
std::size_t number,
const std::optional< double > & value )

Assign value to specific element of the UDQ set.

Parameters
[in]wgnameNamed element of UDQ set defined for wells.
[in]numberNumbered sub-element of named UDQ set element referred to by wgname.
[in]valueNumeric value of specific UDQ set element. Empty optional removes element from UDQ set.

◆ assign() [5/7]

void Opm::UDQSet::assign ( double value)

Assign value to every element of the UDQ set.

Parameters
[in]valueNumeric value for each element. Non-finite numeric value removes element from UDQ set.

◆ assign() [6/7]

void Opm::UDQSet::assign ( std::size_t index,
const std::optional< double > & value )

Assign value to specific element of the UDQ set.

Parameters
[in]indexLinear index into UDQ set. Must be in the range 0..size()-1 inclusive.
[in]valueNumeric value of specific UDQ set element. Empty optional removes element from UDQ set.

◆ assign() [7/7]

void Opm::UDQSet::assign ( std::size_t index,
double value )

Assign value to specific element of the UDQ set.

Parameters
[in]indexLinear index into UDQ set. Must be in the range 0..size()-1 inclusive.
[in]valueNumeric value of specific UDQ set element. Non-finite numeric value removes element from UDQ set.

◆ empty()

UDQSet Opm::UDQSet::empty ( const std::string & name)
static

Form an empty UDQ set.

Parameters
[in]nameUDQ set name

◆ field()

UDQSet Opm::UDQSet::field ( const std::string & name,
double scalar_value )
static

Form a UDQ set at the field level.

Parameters
[in]nameUDQ set name
[in]scalar_valueInitial numeric value of every element of this UDQ set. Non-finite value leaves the UDQ set element undefined.

◆ groups() [1/2]

UDQSet Opm::UDQSet::groups ( const std::string & name,
const std::vector< std::string > & groups )
static

Form a UDQ set pertaining to a set of named groups.

Parameters
[in]nameUDQ set name
[in]groupsCollection of named groups.

◆ groups() [2/2]

UDQSet Opm::UDQSet::groups ( const std::string & name,
const std::vector< std::string > & groups,
double scalar_value )
static

Form a UDQ set pertaining to a set of named groups.

Parameters
[in]nameUDQ set name
[in]groupsCollection of named groups.
[in]scalar_valueInitial numeric value of every element of this UDQ set. Non-finite value leaves the UDQ set elements undefined.

◆ operator()()

const UDQScalar & Opm::UDQSet::operator() ( const std::string & well,
const std::size_t item ) const

Access individual UDQ scalar assiociated to particular named well and numbered sub-entity of that named well.

Parameters
[in]wellWell name. Indexing operator throws an exception if no element exists for this named well.
[in]itemNumbered sub-entity of named well. Typically a segment or connection number. Indexing operator throws an exception if no element exists for the numbered sub-entity of this well.

◆ operator*=() [1/2]

void Opm::UDQSet::operator*= ( const UDQSet & rhs)

Multiply other UDQ set into this.

Defined elements in result is intersection of defined elements in *this and rhs. Multiplication is performed per element.

Parameters
[in]rhsOther UDQ set.

◆ operator*=() [2/2]

void Opm::UDQSet::operator*= ( double rhs)

Multiply every defined element with numeric element.

Parameters
[in]rhsNumeric value.

◆ operator+=() [1/2]

void Opm::UDQSet::operator+= ( const UDQSet & rhs)

Add other UDQ set into this.

Defined elements in result is intersection of defined elements in *this and rhs.

Parameters
[in]rhsOther UDQ set.

◆ operator+=() [2/2]

void Opm::UDQSet::operator+= ( double rhs)

Add numeric value to all defined elements of this UDQ set.

Parameters
[in]rhsNumeric value.

◆ operator-=() [1/2]

void Opm::UDQSet::operator-= ( const UDQSet & rhs)

Subtract UDQ set from this.

Defined elements in result is intersection of defined elements in *this and rhs.

Parameters
[in]rhsOther UDQ set.

◆ operator-=() [2/2]

void Opm::UDQSet::operator-= ( double rhs)

Subtract numeric values from all defined elements of this UDQ set.

Parameters
[in]rhsNumeric value.

◆ operator/=() [1/2]

void Opm::UDQSet::operator/= ( const UDQSet & rhs)

Divide this UDQ set by other UDQ set.

Defined elements in result is intersection of defined elements in *this and rhs. Division is performed per element.

Parameters
[in]rhsOther UDQ set.

◆ operator/=() [2/2]

void Opm::UDQSet::operator/= ( double rhs)

Divide every defined element with numeric element.

Parameters
[in]rhsNumeric value.

◆ operator==()

bool Opm::UDQSet::operator== ( const UDQSet & other) const

Equality comparison operator.

Parameters
[in]otherUDQ set to which this set will be compared for equality.

◆ operator[]() [1/2]

const UDQScalar & Opm::UDQSet::operator[] ( const std::string & wgname) const

Access individual UDQ scalar assiociated to particular named entity (well or group).

Parameters
[in]wgnameNamed entity. Indexing operator throws an exception if no element exists for this named entity.

◆ operator[]() [2/2]

const UDQScalar & Opm::UDQSet::operator[] ( std::size_t index) const

Access individual UDQ scalar at particular index in UDQ set.

Parameters
[in]indexLinear index into UDQ set. Must be in the range 0..size()-1 inclusive. Indexing operator throws an exception if the index is out of bounds.

◆ scalar() [1/2]

UDQSet Opm::UDQSet::scalar ( const std::string & name,
const std::optional< double > & scalar_value )
static

Form a UDQ set pertaining to a single scalar value.

Parameters
[in]nameUDQ set name
[in]scalar_valueInitial numeric value of this scalar set. Empty optional or non-finite contained value leaves the UDQ set undefined.

◆ scalar() [2/2]

UDQSet Opm::UDQSet::scalar ( const std::string & name,
double value )
static

Form a UDQ set pertaining to a single scalar value.

Parameters
[in]nameUDQ set name
[in]valueInitial numeric value of this scalar set. Non-finite value leaves the UDQ set undefined.

◆ size()

std::size_t Opm::UDQSet::size ( ) const

Number of elements in UDQ set.

Undefined elements counted the same as defined elements.

◆ wells() [1/2]

UDQSet Opm::UDQSet::wells ( const std::string & name,
const std::vector< std::string > & wells )
static

Form a UDQ set pertaining to a set of named wells.

Parameters
[in]nameUDQ set name
[in]wellsCollection of named wells.

◆ wells() [2/2]

UDQSet Opm::UDQSet::wells ( const std::string & name,
const std::vector< std::string > & wells,
double scalar_value )
static

Form a UDQ set pertaining to a set of named wells.

Parameters
[in]nameUDQ set name
[in]wellsCollection of named wells.
[in]scalar_valueInitial numeric value of every element of this UDQ set. Non-finite value leaves the UDQ set elements undefined.

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