From 5b5d0ffa5a9c44360193213803ae0d5adcdf8779 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 27 Oct 2014 08:00:23 +0100 Subject: [PATCH] Show generated static result for all time steps --- .../RiaPropertyDataCommands.cpp | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp index 048da8f0ca..0adb7e85cc 100644 --- a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp @@ -635,6 +635,26 @@ public: m_currentReservoir->reservoirData() && m_currentReservoir->reservoirData()->results(m_porosityModelEnum) ) { + // Adjust the result data if only one time step is requested so the result behaves like a static result + if (m_requestedTimesteps.size() == 1 && m_currentScalarIndex != cvf::UNDEFINED_SIZE_T) + { + std::vector< std::vector >* scalarResultFrames = NULL; + scalarResultFrames = &(m_currentReservoir->results(m_porosityModelEnum)->cellResults()->cellScalarResults(m_currentScalarIndex)); + size_t lastIndexWithDataPresent = cvf::UNDEFINED_SIZE_T; + for (size_t i = 0; i < scalarResultFrames->size(); i++) + { + if ((*scalarResultFrames)[i].size() > 0) + { + lastIndexWithDataPresent = i; + } + } + + if (lastIndexWithDataPresent == 0) + { + scalarResultFrames->resize(1); + } + } + m_currentReservoir->reservoirData()->results(m_porosityModelEnum)->recalculateStatistics(m_currentScalarIndex); } @@ -961,6 +981,26 @@ public: m_currentReservoir->reservoirData() && m_currentReservoir->reservoirData()->results(m_porosityModelEnum) ) { + // Adjust the result data if only one time step is requested so the result behaves like a static result + if (m_requestedTimesteps.size() == 1 && m_currentScalarIndex != cvf::UNDEFINED_SIZE_T) + { + std::vector< std::vector >* scalarResultFrames = NULL; + scalarResultFrames = &(m_currentReservoir->results(m_porosityModelEnum)->cellResults()->cellScalarResults(m_currentScalarIndex)); + size_t lastIndexWithDataPresent = cvf::UNDEFINED_SIZE_T; + for (size_t i = 0; i < scalarResultFrames->size(); i++) + { + if ((*scalarResultFrames)[i].size() > 0) + { + lastIndexWithDataPresent = i; + } + } + + if (lastIndexWithDataPresent == 0) + { + scalarResultFrames->resize(1); + } + } + m_currentReservoir->reservoirData()->results(m_porosityModelEnum)->recalculateStatistics(m_currentScalarIndex); }