diff --git a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp index 40dc5d2efd..f31218d7e3 100644 --- a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp @@ -304,10 +304,10 @@ public: quint64 timestepCount = (quint64)requestedTimesteps.size(); socketStream << timestepCount; - size_t doubleValueCount = cellCountI * cellCountJ * cellCountK * timestepCount * sizeof(double); - std::vector values(doubleValueCount); size_t valueIdx = 0; + std::vector values(rigGrid->cellCount()); + for (size_t tsIdx = 0; tsIdx < timestepCount; tsIdx++) { cvf::ref cellCenterDataAccessObject = rimCase->reservoirData()->dataAccessObject(rigGrid, porosityModelEnum, requestedTimesteps[tsIdx], scalarResultIndex); @@ -323,11 +323,11 @@ public: { cellValue = 0.0; } - values[valueIdx++] = cellValue; + values[cellIdx] = cellValue; } - } - server->currentClient()->write((const char *)values.data(), doubleValueCount); + server->currentClient()->write((const char *)values.data(), rigGrid->cellCount() * sizeof(double)); + } return true; }