From a172f0ccfe711225e06b591faf2db5d7667344c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Mon, 13 Nov 2017 11:51:52 +0100 Subject: [PATCH] #2133 Rft cases only returned if they actually contain the well. Simplified gridCasesForWell code as well. --- .../Flow/RimWellPlotTools.cpp | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp index 77cccf718e..89720fb197 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp @@ -442,21 +442,17 @@ RimWellPath* RimWellPlotTools::wellPathFromWellLogFile(const RimWellLogFile* wel std::vector RimWellPlotTools::gridCasesForWell(const QString& simWellName) { std::vector cases; - const RimProject* const project = RiaApplication::instance()->project(); + const RimProject* project = RiaApplication::instance()->project(); - for (RimEclipseCase* const eclCase : project->eclipseCases()) + for (RimEclipseCase* eclCase : project->eclipseCases()) { RimEclipseResultCase* resultCase = dynamic_cast(eclCase); if (resultCase != nullptr) { - RigEclipseCaseData* const eclipseCaseData = eclCase->eclipseCaseData(); - for (const cvf::ref& wellResult : eclipseCaseData->wellResults()) + if ( eclCase->eclipseCaseData()->findSimWellData(simWellName) ) { - if (wellResult->m_wellName == simWellName) - { - cases.push_back(resultCase); - break; - } + cases.push_back(resultCase); + break; } } } @@ -469,22 +465,17 @@ std::vector RimWellPlotTools::gridCasesForWell(const QStr std::vector RimWellPlotTools::rftCasesForWell(const QString& simWellName) { std::vector cases; - const RimProject* const project = RiaApplication::instance()->project(); + const RimProject* project = RiaApplication::instance()->project(); - for (RimEclipseCase* const eclCase : project->eclipseCases()) + for (RimEclipseCase* eclCase : project->eclipseCases()) { RimEclipseResultCase* resultCase = dynamic_cast(eclCase); - if (resultCase != nullptr && resultCase->rftReader() != nullptr) + + if (resultCase + && resultCase->rftReader() + && resultCase->rftReader()->wellNames().count(simWellName)) { - RigEclipseCaseData* const eclipseCaseData = eclCase->eclipseCaseData(); - for (const cvf::ref& wellResult : eclipseCaseData->wellResults()) - { - if (wellResult->m_wellName == simWellName) - { - cases.push_back(resultCase); - break; - } - } + cases.push_back(resultCase); } } return cases;