23#include <opm/input/eclipse/Schedule/UDQ/UDQEnums.hpp>
29#include <unordered_map>
130 operator bool()
const;
191 std::vector<std::size_t> numbers{};
196 template <
class Serializer>
199 serializer(this->well);
200 serializer(this->numbers);
204 static std::vector<EnumeratedWellItems>
205 getSegmentItems(
const SegmentSet& segmentSet);
314 static UDQSet segments(
const std::string&
name,
315 const std::vector<EnumeratedWellItems>& segments);
316 static UDQSet segments(
const std::string&
name,
317 const std::vector<EnumeratedWellItems>& segments,
318 const double scalar_value);
324 void assign(
const std::optional<double>& value);
333 void assign(std::size_t index,
const std::optional<double>& value);
341 void assign(
const std::string& wgname,
const std::optional<double>& value);
352 void assign(
const std::string& wgname, std::size_t number,
const std::optional<double>& value);
367 void assign(std::size_t index,
double value);
375 void assign(
const std::string& wgname,
double value);
463 std::vector<UDQScalar>::const_iterator
begin()
const;
466 std::vector<UDQScalar>::const_iterator
end()
const;
478 const std::string&
name()
const;
497 UDQVarType m_var_type = UDQVarType::NONE;
500 std::vector<UDQScalar> values;
Class for (de-)serializing.
Definition Serializer.hpp:84
void operator/=(const UDQScalar &rhs)
Divide this UDQ scalar by other.
UDQScalar(const double value, const std::size_t num=0)
Constructor.
void operator-=(const UDQScalar &rhs)
Subtract other UDQ scalar from this.
void operator/=(double rhs)
Divide this UDQ scalar by numeric value.
const std::optional< double > & value() const
Retrive contained numeric value.
Definition UDQSet.hpp:155
void assign(const std::optional< double > &value)
Assign numeric value to this UDQ scalar.
std::size_t number() const
Retrive numbered item, typically segment or connection, to which this scalar is associated.
Definition UDQSet.hpp:164
void operator+=(const UDQScalar &rhs)
Add other UDQ scalar to this.
void assign(double value)
Assign numeric value to this UDQ scalar.
std::optional< double > m_value
Scalar value.
Definition UDQSet.hpp:174
void operator+=(double rhs)
Add numeric value to this UDQ scalar.
void operator*=(double rhs)
Multiply numeric value into this.
const std::string & wgname() const
Retrive named well/group to which this scalar is associated.
Definition UDQSet.hpp:158
void operator*=(const UDQScalar &rhs)
Multiply UDQ scalar into this.
bool operator==(const UDQScalar &other) const
Equality predicate.
std::string m_wgname
Associated well/group name.
Definition UDQSet.hpp:177
bool defined() const
Predicate for whether or not this UDQ scalar has a defined value.
UDQScalar(const std::string &wgname, const std::size_t num=0)
Constructor.
std::size_t m_num
Numbered item.
Definition UDQSet.hpp:181
double get() const
Retrive contained numeric value.
void operator-=(double rhs)
Add other UDQ scalar to this.
Definition UDQSet.hpp:186
std::vector< UDQScalar >::const_iterator begin() const
Range-for traversal support (beginning of range)
void assign(const std::string &wgname, double value)
Assign value to specific element of the UDQ set.
void operator-=(double rhs)
Subtract numeric values from all defined elements of this UDQ set.
const UDQScalar & 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 nam...
void operator*=(double rhs)
Multiply every defined element with numeric element.
void operator-=(const UDQSet &rhs)
Subtract UDQ set from this.
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.
void operator+=(const UDQSet &rhs)
Add other UDQ set into this.
const UDQScalar & operator[](std::size_t index) const
Access individual UDQ scalar at particular index in UDQ set.
const std::string & name() const
Retrive the name of this UDQ set.
UDQSet(const std::string &name, std::size_t size)
Construct empty, named UDQ set of specific variable type.
void assign(double value)
Assign value to every element of the UDQ set.
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.
void operator/=(double rhs)
Divide every defined element with numeric element.
std::vector< double > defined_values() const
Retrive the UDQ set's defined values only.
void operator+=(double rhs)
Add numeric value to all defined elements of this UDQ set.
std::vector< std::string > wgnames() const
Retrive names of entities associate to this UDQ set.
std::vector< UDQScalar >::const_iterator end() const
Range-for traversal support (one past end of range)
UDQSet(const std::string &name, UDQVarType var_type, const std::vector< EnumeratedWellItems > &items)
Construct named UDQ set of specific variable type for numbered well items-typically segments or conne...
static UDQSet empty(const std::string &name)
Form an empty UDQ set.
bool operator==(const UDQSet &other) const
Equality comparison operator.
UDQSet(const std::string &name, UDQVarType var_type, std::size_t size)
Construct empty, named UDQ set of specific variable type.
void operator*=(const UDQSet &rhs)
Multiply other UDQ set into this.
void name(const std::string &name)
Assign the name of this UDQ set.
static UDQSet scalar(const std::string &name, double value)
Form a UDQ set pertaining to a single scalar value.
UDQSet(const std::string &name, UDQVarType var_type)
Construct empty, named UDQ set of specific variable type.
static UDQSet scalar(const std::string &name, const std::optional< double > &scalar_value)
Form a UDQ set pertaining to a single scalar value.
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(std::size_t index, const std::optional< double > &value)
Assign value to specific element of the UDQ set.
UDQVarType var_type() const
Retrive the variable type of this UDQ set (e.g., well, group, field, segment &c).
bool has(const std::string &name) const
Predicate for whether or not named UDQ element exists.
static UDQSet wells(const std::string &name, const std::vector< std::string > &wells)
Form a UDQ set pertaining to a set of named wells.
std::size_t defined_size() const
Retrive the UDQ set's number of defined values.
static UDQSet field(const std::string &name, double scalar_value)
Form a UDQ set at the field level.
std::size_t size() const
Number of elements in UDQ set.
void assign(const std::optional< 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.
static UDQSet groups(const std::string &name, const std::vector< std::string > &groups)
Form a UDQ set pertaining to a set of named groups.
void assign(const std::string &wgname, const std::optional< double > &value)
Assign value to specific element of the UDQ set.
void operator/=(const UDQSet &rhs)
Divide this UDQ set by other UDQ set.
const UDQScalar & operator[](const std::string &wgname) const
Access individual UDQ scalar assiociated to particular named entity (well or group).
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.
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition UDQSet.hpp:189