Loading...
Searching...
No Matches
Opm::RegionSetMatchResult::RegionIndexRange::Iterator Class Reference

Simple forward iterator over a region index range. More...

`#include <RegionSetMatcher.hpp>`

## Public Types

using | iterator_category = std::forward_iterator_tag
| Iterator's category (forward iterator)
using | value_type = int
| Iterator's value type.
using | difference_type = int
| Iterator's difference type.
using | pointer = int *
| Iterator's pointer type (return type from operator->())
using | reference = int &
| Iterator's reference type (return type from operator*())

## Public Member Functions

Iterator & | operator++ ()
| Pre-increment operator.
Iterator | operator++ (int)
| Post-increment operator.
reference | operator* ()
| Dereference operator.
pointer | operator-> ()
| Indirection operator.
bool | operator== (Iterator that) const
| Equality predicate.
RegionIndexRange | regions (std::string_view regSet) const
| Inequality predicate.
RegionIndexRange | regions (const std::size_t regSet) const
| Retrieve result set's region indices for a single region set.

## Friends

class | RegionSetMatcher

## Detailed Description

Simple forward iterator over a region index range.

## Member Function Documentation

## operator*()

reference Opm::RegionSetMatchResult::RegionIndexRange::Iterator::operator* | ( |  | ) |

inline

Dereference operator.

Returns
  Element at current position.

## operator++() [1/2]

Iterator & Opm::RegionSetMatchResult::RegionIndexRange::Iterator::operator++ | ( |  | ) |

inline

Pre-increment operator.

Returns
  *this.

## operator++() [2/2]

Iterator Opm::RegionSetMatchResult::RegionIndexRange::Iterator::operator++ | ( | int |  | ) |

inline

Post-increment operator.

Returns
  Iterator pointing to element prior to increment result.

## operator->()

pointer Opm::RegionSetMatchResult::RegionIndexRange::Iterator::operator-> | ( |  | ) |

inline

Indirection operator.

Returns
  Pointer to element at current position.

## operator==()

bool Opm::RegionSetMatchResult::RegionIndexRange::Iterator::operator== | ( | Iterator | that | ) | const

inline

Equality predicate.

Parameters

  [in] | that | Object to which `*this` will be compared for equality.

Returns
  Whether or not `*this` equals `that`.

## regions() [1/2]

RegionIndexRange Opm::RegionSetMatchResult::RegionIndexRange::Iterator::regions | ( | const std::size_t | regSet | ) | const

Retrieve result set's region indices for a single region set.

Parameters

  [in] | regSet | Region set number. Should be between zero and numRegionSets() - 1 inclusive.

Returns
  range of `regSet's` region indices matching the input request. Empty unless `regSet` is between zero and
  numRegionSets() - 1
  inclusive.

## regions() [2/2]

RegionIndexRange Opm::RegionSetMatchResult::RegionIndexRange::Iterator::regions | ( | std::string_view | regSet | ) | const

Inequality predicate.

Parameters

  [in] | that | Object to which `*this` will be compared for inequality.

Returns
  ! (*this == that)
  bool operator!=(Iterator that) const
  {
  return ! (*this == that);
  }
  friend class RegionIndexRange;
  private:
  Constructor
  Accessible to RegionIndexRange only.
  \param[in] index range element value.
  explicit Iterator(int i) : i_{i} {}
  Index range element value
  int i_;
  };
  Start of Range.
  Iterator begin() const { return Iterator{this->begin_}; }
  End of Range.
  Iterator end() const { return Iterator{this->end_}; }
  Predicate for empty index range.
  bool empty() const { return this->end_ <= this->begin_; }
  Name of region set to which this index range is attached.
  std::string_view regionSet() const { return this->region_; }
  friend class RegionSetMatchResult;
  private:
  Beginning of index range
  int begin_{};
  End of Range
  int end_{};
  Name of region set to which this region index range is attached
  std::string_view region_{};
  Default Constructor.
  Empty range.
  For use by RegionSetMatchResult only.
  RegionIndexRange() = default;
  Non-Empty Range
  For use by RegionSetMatchResult only.
  \param[in] beginID Minimum region index value.
  \param[in] endID One more than the maximum region index value.
  \param[in] region Name of region set to which this index range
  is attached.
  RegionIndexRange(int beginID, int endID, std::string_view region)
  : begin_ { beginID }
  , end_ { endID }
  , region_ { region }
  {}
  };
  Predicate for whether or not result set is empty.
  \return Whether or not result set is empty.
  bool empty() const
  {
  return this->regionIDRange_.empty();
  }
  Predicate for whether or not result set applies to a single
  region in a single region set.
  \return Whether or not result set is a single region in a single
  region set. Useful to distinguish whether or not this result set
  generates a scalar UDQ or a UDQ set in the context of a region
  level UDQ.
  bool isScalar() const
  {
  return (this->regionIDRange_.size() == std::vector<int>::size_type{2})
  && (this->regionIDRange_.back() == this->regionIDRange_.front() + 1);
  }
  Retrieve list of (MS) well names covered by this result set.
  \return List MS well names covered by this result set.
  std::vector<std::string_view> regionSets() const;
  Retrieve number of region sets covered by this result set.
  \return Number of region sets covered by this result set.
  std::size_t numRegionSets() const
  {
  return this->regionSets_.size();
  }
  Retrieve result set's region indices for a single region set.
  \param[in] regSet Named region set--e.g., FIPNUM or FIPABC. Should
  usually be one of the items in the return value from \code
  regionSets()
  Opm::RegionSetMatchResult::RegionIndexRange::Iterator
  Simple forward iterator over a region index range.
  Definition RegionSetMatcher.hpp:52
  Opm::RegionSetMatchResult::RegionIndexRange
  Region Index Range for Single Region Set.
  Definition RegionSetMatcher.hpp:48
  Opm::unit::convert::to
  constexpr double to(const double q, const double unit)
  Convert from internal units of measurements to equivalent external units of measurements.
  Definition Units.hpp:250
  .
  range of `regSet's` region indices matching the input request. Empty unless `regSet` is one of the return values from
  regionSets()
  .

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

- opm/input/eclipse/EclipseState/Grid/RegionSetMatcher.hpp