mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use read/write functions of the stream to increase performance
p4#: 21698
This commit is contained in:
parent
d5fd09f658
commit
511ea74d4e
@ -523,30 +523,25 @@ public:
|
||||
std::vector<double> cellCornerValues(doubleValueCount);
|
||||
|
||||
cvf::Vec3d cornerVerts[8];
|
||||
|
||||
quint64 coordCount = 0;
|
||||
for (size_t localGridCellIdx = 0; localGridCellIdx < rigGrid->cellCount(); localGridCellIdx++)
|
||||
{
|
||||
rigGrid->cellCornerVertices(localGridCellIdx, cornerVerts);
|
||||
|
||||
for (size_t j = 0; j < 8; j++)
|
||||
{
|
||||
/*
|
||||
cellCornerValues[localGridCellIdx * 3 + 0] = cornerVerts[j].x();
|
||||
cellCornerValues[localGridCellIdx * 3 + 1] = cornerVerts[j].y();
|
||||
cellCornerValues[localGridCellIdx * 3 + 2] = cornerVerts[j].z();
|
||||
*/
|
||||
cellCornerValues[coordCount * 3 + 0] = cornerVerts[j].x();
|
||||
cellCornerValues[coordCount * 3 + 1] = cornerVerts[j].y();
|
||||
cellCornerValues[coordCount * 3 + 2] = cornerVerts[j].z();
|
||||
|
||||
socketStream << cornerVerts[j].x();
|
||||
socketStream << cornerVerts[j].y();
|
||||
socketStream << cornerVerts[j].z();
|
||||
coordCount++;
|
||||
}
|
||||
}
|
||||
|
||||
//server->currentClient()->write((const char *)cellCornerValues.data(), byteCount);
|
||||
server->currentClient()->write((const char *)cellCornerValues.data(), byteCount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static bool RiaGetCellCorners_init = RiaSocketCommandFactory::instance()->registerCreator<RiaGetCellCorners>(RiaGetCellCorners::commandName());
|
||||
|
@ -98,7 +98,7 @@ void getCellCorners(NDArray& cellCornerValues, const QString &hostName, quint16
|
||||
double* internalMatrixData = cellCornerValues.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