Use SegmentState as backing store for segment pressure

This commit is contained in:
Joakim Hove
2021-06-01 08:10:58 +02:00
parent fc185afc02
commit eb937e8ba2
2 changed files with 11 additions and 13 deletions

View File

@@ -210,14 +210,14 @@ public:
double * segPress(std::size_t well_index)
{
const int top_segment_index = this->top_segment_index_[well_index];
return &seg_press_[top_segment_index];
auto& segment = this->segments(well_index);
return segment.pressure.data();
}
const double * segPress(std::size_t well_index) const
{
const int top_segment_index = this->top_segment_index_[well_index];
return &seg_press_[top_segment_index];
const auto& segment = this->segments(well_index);
return segment.pressure.data();
}
@@ -503,7 +503,6 @@ private:
// MS well related
// for StandardWell, the number of segments will be one
std::vector<double> seg_rates_;
std::vector<double> seg_press_;
// the index of the top segments, which is used to locate the
// multisegment well related information in WellState
std::vector<int> top_segment_index_;