mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Performance: Reduce memory use for riGetPropertyData
This commit is contained in:
parent
a36d4c9b73
commit
c74851bfff
@ -304,10 +304,10 @@ public:
|
|||||||
quint64 timestepCount = (quint64)requestedTimesteps.size();
|
quint64 timestepCount = (quint64)requestedTimesteps.size();
|
||||||
socketStream << timestepCount;
|
socketStream << timestepCount;
|
||||||
|
|
||||||
size_t doubleValueCount = cellCountI * cellCountJ * cellCountK * timestepCount * sizeof(double);
|
|
||||||
std::vector<double> values(doubleValueCount);
|
|
||||||
size_t valueIdx = 0;
|
size_t valueIdx = 0;
|
||||||
|
|
||||||
|
std::vector<double> values(rigGrid->cellCount());
|
||||||
|
|
||||||
for (size_t tsIdx = 0; tsIdx < timestepCount; tsIdx++)
|
for (size_t tsIdx = 0; tsIdx < timestepCount; tsIdx++)
|
||||||
{
|
{
|
||||||
cvf::ref<cvf::StructGridScalarDataAccess> cellCenterDataAccessObject = rimCase->reservoirData()->dataAccessObject(rigGrid, porosityModelEnum, requestedTimesteps[tsIdx], scalarResultIndex);
|
cvf::ref<cvf::StructGridScalarDataAccess> cellCenterDataAccessObject = rimCase->reservoirData()->dataAccessObject(rigGrid, porosityModelEnum, requestedTimesteps[tsIdx], scalarResultIndex);
|
||||||
@ -323,11 +323,11 @@ public:
|
|||||||
{
|
{
|
||||||
cellValue = 0.0;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user