Loading...
Searching...
No Matches
Opm::Action::Value Class Reference

Numeric value of an AST sub-expression. More...

`#include <ActionValue.hpp>`

## Public Member Functions

| Value ()=default
| Default constructor.
| Value (double value)
| Constructor.
| Value (std::string_view wname, double value)
| Constructor.
Result | eval_cmp (TokenType op, const Value &rhs) const
| Compare current Value to another Value.
void | add_well (std::string_view well, double value)
| Incorporate well level function value into Value object.
double | scalar () const
| Retrieve scalar function value.

## Detailed Description

Numeric value of an AST sub-expression.

## Constructor & Destructor Documentation

## Value() [1/3]

Opm::Action::Value::Value | ( |  | ) |

default

Default constructor.

Resulting object is meaningful only if calling code later invokes the add_well() member function.

## Value() [2/3]

Opm::Action::Value::Value | ( | double | value | ) |

explicit

Constructor.

Creates a scalar Value object.

Parameters

  [in] | value | Numeric value of scalar Value object.

## Value() [3/3]

Opm::Action::Value::Value | ( | std::string_view | wname,
|  | double | value )

Constructor.

Creates a non-scalar Value object associated to a single well.

## Member Function Documentation

## add_well()

void Opm::Action::Value::add_well | ( | std::string_view | well,
|  | double | value )

Incorporate well level function value into Value object.

Will throw an exception of type std::invalid_argument if

was created as a scalar object.

Parameters

  [in] | well | Named well for which to incorporate a function value.
  [in] | value | Numeric function value for `well`.

## eval_cmp()

Opm::Action::Result Opm::Action::Value::eval_cmp | ( | TokenType | op,
|  | const Value & | rhs ) const

Compare current Value to another Value.

Parameters

  [in]

  op

  Comparison operator. Must be one of
  - TokenType::op_eq (==)
  - TokenType::op_ge (>=)
  - TokenType::op_le (<=)
  - TokenType::op_ne (!=)
  - TokenType::op_gt (>)
  - TokenType::op_lt (<) Function eval_cmp() will throw an exception of type std::invalid_argument unless `op` is one of these operators.

  [in] | rhs | Value object against which will be compared through `op`. Should be a scalar value. The `rhs` object will be used on the right-hand side of the comparison operator while will be used on the left-hand side of `op`. Function eval_cmp() will throw an exception of type std::invalid_argument if `rhs` is not a scalar Value object.

Returns
  Result of comparison "*this op rhs". If
  is non-scalar, then any wells for which the comparison holds will be included in the result set.

## scalar()

double Opm::Action::Value::scalar | ( |  | ) | const

Retrieve scalar function value.

Will throw an exception of type std::invalid_argument if

was not created as a scalar object.

The documentation for this class was generated from the following files:

- opm/input/eclipse/Schedule/Action/ActionValue.hpp
- opm/input/eclipse/Schedule/Action/ActionValue.cpp