From 0d99686e97cf23b65604ed6e93e9008ee7cfbfa3 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Fri, 22 Mar 2019 09:41:29 +0100 Subject: [PATCH] fixing the segment treatment in the init of WellStateFullyImplicitBlackoil --- opm/autodiff/WellStateFullyImplicitBlackoil.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/opm/autodiff/WellStateFullyImplicitBlackoil.hpp b/opm/autodiff/WellStateFullyImplicitBlackoil.hpp index e20325659..ad2d45a86 100644 --- a/opm/autodiff/WellStateFullyImplicitBlackoil.hpp +++ b/opm/autodiff/WellStateFullyImplicitBlackoil.hpp @@ -462,12 +462,11 @@ namespace Opm // we need to create a trival segment related values to avoid there will be some // multi-segment wells added later. nseg_ = nw; - seg_number_.clear(); - top_segment_index_.reserve(nw); - seg_number_.reserve(nw); + top_segment_index_.resize(nw); + seg_number_.resize(nw); for (int w = 0; w < nw; ++w) { - top_segment_index_.push_back(w); - seg_number_.push_back(1); // Top segment is segment #1 + top_segment_index_[w] = w; + seg_number_[w] = 1; // Top segment is segment #1 } segpress_ = bhp(); segrates_ = wellRates();