From 0314a045e793a64daacac024b44d5852c1c428b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Tue, 15 Aug 2017 10:12:02 +0200 Subject: [PATCH 1/4] Fix issue with flow diagnostics loading with assertion error --- .../RigSingleWellResultsData.cpp | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp index 116a9d1e3e..16844365e5 100644 --- a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp @@ -37,12 +37,12 @@ const RigWellResultFrame& RigSingleWellResultsData::wellResultFrame(size_t resul //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector& simulationTimeSteps) +void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector& resultTimes) { m_resultTimeStepIndexToWellTimeStepIndex.clear(); if (m_wellCellsTimeSteps.size() == 0) return; - m_resultTimeStepIndexToWellTimeStepIndex.resize(simulationTimeSteps.size(), cvf::UNDEFINED_SIZE_T); + m_resultTimeStepIndexToWellTimeStepIndex.resize(resultTimes.size(), cvf::UNDEFINED_SIZE_T); if (false) { @@ -54,23 +54,28 @@ void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndi } qDebug() << "Result TimeStamps"; - for (size_t i = 0; i < simulationTimeSteps.size(); i++) + for (size_t i = 0; i < resultTimes.size(); i++) { - qDebug() << simulationTimeSteps[i].toString(); + qDebug() << resultTimes[i].toString(); } } - for (size_t resultTimeStepIndex = 0; resultTimeStepIndex< simulationTimeSteps.size(); resultTimeStepIndex++) - { - size_t wellTimeStepIndex = 0; + int resultIdx = 0; + size_t wellIdx = 0; + size_t activeWellIdx = cvf::UNDEFINED_SIZE_T; - while (wellTimeStepIndex < m_wellCellsTimeSteps.size() && - m_wellCellsTimeSteps[wellTimeStepIndex].m_timestamp < simulationTimeSteps[resultTimeStepIndex]) + while (wellIdx <= m_wellCellsTimeSteps.size() && resultIdx < static_cast(resultTimes.size())) + { + if (wellIdx < m_wellCellsTimeSteps.size() && m_wellCellsTimeSteps[wellIdx].m_timestamp <= resultTimes[resultIdx]) { - wellTimeStepIndex++; + activeWellIdx = wellIdx; + wellIdx++; } - m_resultTimeStepIndexToWellTimeStepIndex[resultTimeStepIndex] = wellTimeStepIndex; + CVF_ASSERT(resultIdx < static_cast(m_resultTimeStepIndexToWellTimeStepIndex.size())); + m_resultTimeStepIndexToWellTimeStepIndex[resultIdx] = activeWellIdx; + + resultIdx++; } } From 0674d13e025958153fa7381a5a06e7abf0020ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Tue, 15 Aug 2017 10:32:41 +0200 Subject: [PATCH 2/4] Set version number to 2017.05.2-dev.1 --- ResInsightVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index 20dc1d4419..86f47ce5bd 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -1,7 +1,7 @@ set(RESINSIGHT_MAJOR_VERSION 2017) set(RESINSIGHT_MINOR_VERSION 05) -set(RESINSIGHT_INCREMENT_VERSION "pre-proto.15") +set(RESINSIGHT_INCREMENT_VERSION "2-dev.1") # https://github.com/CRAVA/crava/tree/master/libs/nrlib From 6912ee0081d9826aa5e34d957da4d04edc8dbb86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Tue, 15 Aug 2017 14:51:18 +0200 Subject: [PATCH 3/4] #1765 Fix of mapping between well timesteps and result timesteps, handling holes in both well and result timesteps. --- .../RigSingleWellResultsData.cpp | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp index 16844365e5..9ea472dc6a 100644 --- a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp @@ -37,12 +37,12 @@ const RigWellResultFrame& RigSingleWellResultsData::wellResultFrame(size_t resul //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector& resultTimes) +void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector& simulationTimeSteps) { m_resultTimeStepIndexToWellTimeStepIndex.clear(); if (m_wellCellsTimeSteps.size() == 0) return; - m_resultTimeStepIndexToWellTimeStepIndex.resize(resultTimes.size(), cvf::UNDEFINED_SIZE_T); + m_resultTimeStepIndexToWellTimeStepIndex.resize(simulationTimeSteps.size(), cvf::UNDEFINED_SIZE_T); if (false) { @@ -54,28 +54,30 @@ void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndi } qDebug() << "Result TimeStamps"; - for (size_t i = 0; i < resultTimes.size(); i++) + for (size_t i = 0; i < simulationTimeSteps.size(); i++) { - qDebug() << resultTimes[i].toString(); + qDebug() << simulationTimeSteps[i].toString(); } } - int resultIdx = 0; - size_t wellIdx = 0; - size_t activeWellIdx = cvf::UNDEFINED_SIZE_T; - - while (wellIdx <= m_wellCellsTimeSteps.size() && resultIdx < static_cast(resultTimes.size())) + size_t wellTimeStepIndex = 0; + for (size_t resultTimeStepIndex = 0; resultTimeStepIndex < simulationTimeSteps.size(); resultTimeStepIndex++) { - if (wellIdx < m_wellCellsTimeSteps.size() && m_wellCellsTimeSteps[wellIdx].m_timestamp <= resultTimes[resultIdx]) + while ( wellTimeStepIndex < m_wellCellsTimeSteps.size() && + m_wellCellsTimeSteps[wellTimeStepIndex].m_timestamp < simulationTimeSteps[resultTimeStepIndex]) { - activeWellIdx = wellIdx; - wellIdx++; + wellTimeStepIndex++; } - CVF_ASSERT(resultIdx < static_cast(m_resultTimeStepIndexToWellTimeStepIndex.size())); - m_resultTimeStepIndexToWellTimeStepIndex[resultIdx] = activeWellIdx; - - resultIdx++; + if ( wellTimeStepIndex < m_wellCellsTimeSteps.size() + && m_wellCellsTimeSteps[wellTimeStepIndex].m_timestamp == simulationTimeSteps[resultTimeStepIndex]) + { + m_resultTimeStepIndexToWellTimeStepIndex[resultTimeStepIndex] = wellTimeStepIndex; + } + else + { + m_resultTimeStepIndexToWellTimeStepIndex[resultTimeStepIndex] = cvf::UNDEFINED_SIZE_T; + } } } From 4bda27c627f739dba6be6bd627ecf9ccb6e020b4 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 15 Aug 2017 15:16:29 +0200 Subject: [PATCH 4/4] #1771 Add missing allocation of well path --- ApplicationCode/FileInterface/RifWellPathImporter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ApplicationCode/FileInterface/RifWellPathImporter.cpp b/ApplicationCode/FileInterface/RifWellPathImporter.cpp index de8199efa0..46181be233 100644 --- a/ApplicationCode/FileInterface/RifWellPathImporter.cpp +++ b/ApplicationCode/FileInterface/RifWellPathImporter.cpp @@ -166,6 +166,7 @@ RifWellPathImporter::WellData RifWellPathImporter::readJsonWellData(const QStrin double datumElevation = jsonMap["datumElevation"].toDouble(); QList pathList = jsonMap["path"].toList(); WellData wellData; + wellData.m_wellPathGeometry = new RigWellPath; wellData.m_wellPathGeometry->setDatumElevation(datumElevation); wellData.m_name = jsonMap["name"].toString();