20#ifndef SEGMENT_MATCHER_HPP
21#define SEGMENT_MATCHER_HPP
46 using WellSegmentRangeIterator = std::vector<int>::const_iterator;
53 WellSegmentRangeIterator
begin()
const {
return this->begin_; }
56 WellSegmentRangeIterator
end()
const {
return this->end_; }
59 std::string_view
well()
const {
return this->well_; }
61 friend class SegmentSet;
65 WellSegmentRangeIterator begin_{};
68 WellSegmentRangeIterator end_{};
71 std::string_view well_{};
78 WellSegmentRange() =
default;
88 WellSegmentRange(WellSegmentRangeIterator
begin,
89 WellSegmentRangeIterator
end,
90 std::string_view
well)
105 return this->segments_.empty();
115 bool isScalar()
const
117 return this->segments_.size() == std::vector<int>::size_type{1};
123 std::vector<std::string_view> wells()
const;
128 std::size_t numWells()
const
130 return this->wells_.size();
141 WellSegmentRange segments(std::string_view well)
const;
151 WellSegmentRange segments(
const std::size_t well)
const;
153 friend class SegmentMatcher;
157 std::vector<std::string> wells_{};
163 std::vector<std::vector<std::string>::size_type> wellNameIndex_{};
166 std::vector<std::vector<int>::size_type> segmentStart_{};
170 std::vector<int> segments_{};
175 void establishNameLookupIndex();
185 void addWellSegments(
const std::string& well,
186 const std::vector<int>& segments);
222 SetDescriptor() =
default;
231 SetDescriptor& segmentNumber(
const int segNum);
244 SetDescriptor& segmentNumber(std::string_view segNum);
249 const std::optional<int>& segmentNumber()
const
251 return this->segmentNumber_;
259 SetDescriptor& wellNames(std::string_view wellNamePattern);
265 const std::optional<std::string>& wellNames()
const
267 return this->wellNamePattern_;
273 std::optional<std::string> wellNamePattern_{};
277 std::optional<int> segmentNumber_{};
283 SegmentMatcher() =
delete;
290 explicit SegmentMatcher(
const ScheduleState& mswInputData);
297 SegmentMatcher(
const SegmentMatcher& rhs) =
delete;
302 SegmentMatcher(SegmentMatcher&& rhs);
311 SegmentMatcher& operator=(
const SegmentMatcher& rhs) =
delete;
318 SegmentMatcher& operator=(SegmentMatcher&& rhs);
344 SegmentSet findSegments(
const SetDescriptor& segments)
const;
351 std::unique_ptr<Impl> pImpl_{};
Segment Range for Single MS Well.
Definition SegmentMatcher.hpp:50
WellSegmentRangeIterator begin() const
Start of Range.
Definition SegmentMatcher.hpp:53
std::string_view well() const
Name of well to which this segment range is attached.
Definition SegmentMatcher.hpp:59
WellSegmentRangeIterator end() const
End of Range.
Definition SegmentMatcher.hpp:56
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30