mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5429 Pre-allocate cellCornerWeights array
This commit is contained in:
parent
fefd4d2fe8
commit
fbf1d12fb4
@ -152,6 +152,8 @@ void RivSurfaceIntersectionGeometryGenerator::calculateArrays()
|
|||||||
const std::vector<unsigned>& nativeTriangleIndices = m_usedSurfaceData->triangleIndices();
|
const std::vector<unsigned>& nativeTriangleIndices = m_usedSurfaceData->triangleIndices();
|
||||||
cvf::Vec3d displayModelOffset = m_hexGrid->displayOffset();
|
cvf::Vec3d displayModelOffset = m_hexGrid->displayOffset();
|
||||||
|
|
||||||
|
m_triVxToCellCornerWeights.reserve( nativeTriangleIndices.size() * 24 );
|
||||||
|
|
||||||
// Loop local memory allocation.
|
// Loop local memory allocation.
|
||||||
// Must be thread private in omp paralellization
|
// Must be thread private in omp paralellization
|
||||||
|
|
||||||
@ -229,13 +231,10 @@ void RivSurfaceIntersectionGeometryGenerator::calculateArrays()
|
|||||||
p2,
|
p2,
|
||||||
&clippedTriangleVxes,
|
&clippedTriangleVxes,
|
||||||
&cellFaceForEachClippedTriangleEdge );
|
&cellFaceForEachClippedTriangleEdge );
|
||||||
|
if ( clippedTriangleVxes.empty() ) continue;
|
||||||
|
|
||||||
size_t clippedTriangleCount = clippedTriangleVxes.size() / 3;
|
for ( uint triVxIdx = 0; triVxIdx < clippedTriangleVxes.size(); triVxIdx += 3 )
|
||||||
|
|
||||||
for ( uint clippTrIdx = 0; clippTrIdx < clippedTriangleCount; ++clippTrIdx )
|
|
||||||
{
|
{
|
||||||
uint triVxIdx = clippTrIdx * 3;
|
|
||||||
|
|
||||||
// Accumulate triangle vertices
|
// Accumulate triangle vertices
|
||||||
|
|
||||||
cvf::Vec3d point0( clippedTriangleVxes[triVxIdx + 0] - displayModelOffset );
|
cvf::Vec3d point0( clippedTriangleVxes[triVxIdx + 0] - displayModelOffset );
|
||||||
|
Loading…
Reference in New Issue
Block a user