|
opm-common
|
Public Member Functions | |
| UDQScalar (const double value, const std::size_t num=0) | |
| Constructor. | |
| UDQScalar (const std::string &wgname, const std::size_t num=0) | |
| Constructor. | |
| void | operator+= (const UDQScalar &rhs) |
| Add other UDQ scalar to this. | |
| void | operator+= (double rhs) |
| Add numeric value to this UDQ scalar. | |
| void | operator*= (const UDQScalar &rhs) |
| Multiply UDQ scalar into this. | |
| void | operator*= (double rhs) |
| Multiply numeric value into this. | |
| void | operator/= (const UDQScalar &rhs) |
| Divide this UDQ scalar by other. | |
| void | operator/= (double rhs) |
| Divide this UDQ scalar by numeric value. | |
| void | operator-= (const UDQScalar &rhs) |
| Subtract other UDQ scalar from this. | |
| void | operator-= (double rhs) |
| Add other UDQ scalar to this. | |
| operator bool () const | |
| Predicate for whether or not this UDQ scalar has a defined value. | |
| void | assign (const std::optional< double > &value) |
| Assign numeric value to this UDQ scalar. | |
| void | assign (double value) |
| Assign numeric value to this UDQ scalar. | |
| bool | defined () const |
| Predicate for whether or not this UDQ scalar has a defined value. | |
| double | get () const |
| Retrive contained numeric value. | |
| const std::optional< double > & | value () const |
| Retrive contained numeric value. | |
| const std::string & | wgname () const |
| Retrive named well/group to which this scalar is associated. | |
| std::size_t | number () const |
| Retrive numbered item, typically segment or connection, to which this scalar is associated. | |
| bool | operator== (const UDQScalar &other) const |
| Equality predicate. | |
Public Attributes | |
| std::optional< double > | m_value {} |
| Scalar value. | |
| std::string | m_wgname {} |
| Associated well/group name. | |
| std::size_t | m_num = 0 |
| Numbered item. | |
|
explicit |
Constructor.
Forms a UDQ scalar defined by its numeric value and, possibly, a particular numbered item.
| [in] | value | Numeric value |
| [in] | num | Item number. |
|
explicit |
Constructor.
Forms a UDQ scalar attached to a particular name and, possibly, a particular numbered item.
| [in] | wgname | Named well or group to which this scalar is associated. |
| [in] | num | Item number. |
| void Opm::UDQScalar::assign | ( | const std::optional< double > & | value | ) |
Assign numeric value to this UDQ scalar.
| [in] | value | Numeric value. Empty optional or non-finite value makes this UDQ scalar undefined. |
| void Opm::UDQScalar::assign | ( | double | value | ) |
Assign numeric value to this UDQ scalar.
| [in] | value | Numeric value. Non-finite value makes this UDQ scalar undefined. |
| double Opm::UDQScalar::get | ( | ) | const |
Retrive contained numeric value.
Throws an exception unless this UDQ scalar has a defined value.
|
inline |
Retrive numbered item, typically segment or connection, to which this scalar is associated.
Always zero for non-numbered UDQ scalars.
| Opm::UDQScalar::operator bool | ( | ) | const |
Predicate for whether or not this UDQ scalar has a defined value.
| void Opm::UDQScalar::operator*= | ( | const UDQScalar & | rhs | ) |
Multiply UDQ scalar into this.
Result is defined if both this and other scalar are defined, and if the product is a finite value.
| [in] | rhs | Other UDQ scalar. |
| void Opm::UDQScalar::operator*= | ( | double | rhs | ) |
Multiply numeric value into this.
Result is defined if *this is defined and the product is a finite value.
| [in] | rhs | Numeric value. |
| void Opm::UDQScalar::operator+= | ( | const UDQScalar & | rhs | ) |
Add other UDQ scalar to this.
Result is defined if both this and other scalar are defined, and the sum is a finite value.
| [in] | rhs | Other UDQ scalar. |
| void Opm::UDQScalar::operator+= | ( | double | rhs | ) |
Add numeric value to this UDQ scalar.
Result is defined if *this is defined and the sum is a finite value.
| [in] | rhs | Numeric value. |
| void Opm::UDQScalar::operator-= | ( | const UDQScalar & | rhs | ) |
Subtract other UDQ scalar from this.
Result is defined if both this and other scalar are defined, and if the difference is a finite value.
| [in] | rhs | Other UDQ scalar. |
| void Opm::UDQScalar::operator-= | ( | double | rhs | ) |
Add other UDQ scalar to this.
Result is defined if *this is defined and the difference is a finite value.
| [in] | rhs | Numeric value. |
| void Opm::UDQScalar::operator/= | ( | const UDQScalar & | rhs | ) |
Divide this UDQ scalar by other.
Result is defined if both this and other scalar are defined, and the quotient is a finite value.
| [in] | rhs | Other UDQ scalar. |
| void Opm::UDQScalar::operator/= | ( | double | rhs | ) |
Divide this UDQ scalar by numeric value.
Result is defined if *this is defined and the quotient is a finite value.
| [in] | rhs | Numeric value. |
| bool Opm::UDQScalar::operator== | ( | const UDQScalar & | other | ) | const |
Equality predicate.
| [in] | other | UDQ scalar to which this scalar will be compared for equality. |
|
inline |
Retrive contained numeric value.
Empty optional unless this scalar has a defined value.
| std::size_t Opm::UDQScalar::m_num = 0 |
Numbered item.
Typically segment or connection. Zero for non-numbered items.