mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
Use read/write functions of the stream to increase performance
p4#: 21699
This commit is contained in:
parent
511ea74d4e
commit
f556171bec
@ -365,15 +365,19 @@ public:
|
||||
quint64 byteCount = cellCount * 3 * sizeof(double);
|
||||
socketStream << byteCount;
|
||||
|
||||
for (size_t i = 0; i < cellCount; i++)
|
||||
{
|
||||
cvf::Vec3d center = rigGrid->cell(i).center();
|
||||
std::vector<double> cellCenterValues(cellCount * 3);
|
||||
|
||||
socketStream << center.x();
|
||||
socketStream << center.y();
|
||||
socketStream << center.z();
|
||||
for (size_t localGridCellIdx = 0; localGridCellIdx < rigGrid->cellCount(); localGridCellIdx++)
|
||||
{
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
@ -92,7 +92,7 @@ void getCellCenters(NDArray& cellCenterValues, const QString &hostName, quint16
|
||||
|
||||
double* internalMatrixData = cellCenterValues.fortran_vec();
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
double val;
|
||||
for (octave_idx_type i = 0; i < valueCount; i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user