From e958ee1139cbc357458f3312caa1b5dd2a616132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Mon, 15 Oct 2018 16:41:10 +0200 Subject: [PATCH] WellState FIBO: Initialize 'nseg_' in init() Needed to guarantee that numSegments(wellID) returns sensible values for wellID = numWells()-1 in the case of no multi-segment wells. --- opm/autodiff/WellStateFullyImplicitBlackoil.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/opm/autodiff/WellStateFullyImplicitBlackoil.hpp b/opm/autodiff/WellStateFullyImplicitBlackoil.hpp index 8f8a130cb..c2aa6e828 100644 --- a/opm/autodiff/WellStateFullyImplicitBlackoil.hpp +++ b/opm/autodiff/WellStateFullyImplicitBlackoil.hpp @@ -280,6 +280,7 @@ namespace Opm { // we need to create a trival segment related values to avoid there will be some // multi-segment wells added later. + nseg_ = nw; top_segment_index_.reserve(nw); for (int w = 0; w < nw; ++w) { top_segment_index_.push_back(w);