mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
Use read/write functions of the stream to increase performance
p4#: 21699
This commit is contained in:
@@ -365,15 +365,19 @@ public:
|
|||||||
quint64 byteCount = cellCount * 3 * sizeof(double);
|
quint64 byteCount = cellCount * 3 * sizeof(double);
|
||||||
socketStream << byteCount;
|
socketStream << byteCount;
|
||||||
|
|
||||||
for (size_t i = 0; i < cellCount; i++)
|
std::vector<double> cellCenterValues(cellCount * 3);
|
||||||
{
|
|
||||||
cvf::Vec3d center = rigGrid->cell(i).center();
|
|
||||||
|
|
||||||
socketStream << center.x();
|
for (size_t localGridCellIdx = 0; localGridCellIdx < rigGrid->cellCount(); localGridCellIdx++)
|
||||||
socketStream << center.y();
|
{
|
||||||
socketStream << center.z();
|
cvf::Vec3d center = rigGrid->cell(localGridCellIdx).center();
|
||||||
|
|
||||||
|
cellCenterValues[localGridCellIdx * 3 + 0] = center.x();
|
||||||
|
cellCenterValues[localGridCellIdx * 3 + 1] = center.y();
|
||||||
|
cellCenterValues[localGridCellIdx * 3 + 2] = center.z();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server->currentClient()->write((const char *)cellCenterValues.data(), byteCount);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ void getCellCenters(NDArray& cellCenterValues, const QString &hostName, quint16
|
|||||||
|
|
||||||
double* internalMatrixData = cellCenterValues.fortran_vec();
|
double* internalMatrixData = cellCenterValues.fortran_vec();
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
double val;
|
double val;
|
||||||
for (octave_idx_type i = 0; i < valueCount; i++)
|
for (octave_idx_type i = 0; i < valueCount; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user