From 119cbc33f7ae09c5ef8464ec0c7789191e6d9765 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Wed, 31 Jul 2019 13:28:24 +0200 Subject: [PATCH] Sort the child wells according to insert index --- src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index b5fff7f1d..bb7dbf97c 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -2018,6 +2018,11 @@ namespace { wells.push_back( this->getWell2( well_name, timeStep )); } } + + std::sort(wells.begin(), wells.end(), [](const Well2& well1, const Well2& well2) + { + return well1.seqIndex() < well2.seqIndex(); + }); return wells; } }