mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5420 Fix and improve mutithreading for "Additional-NNC" computations
This commit is contained in:
parent
15aeb8036e
commit
3c05ae04e6
@ -178,13 +178,14 @@ std::vector<RigConnection> RigCellFaceGeometryTools::computeOtherNncs( const Rig
|
|||||||
std::set<CellPair> otherCellPairs;
|
std::set<CellPair> otherCellPairs;
|
||||||
|
|
||||||
const cvf::Collection<RigFault>& faults = mainGrid->faults();
|
const cvf::Collection<RigFault>& faults = mainGrid->faults();
|
||||||
|
|
||||||
for ( size_t faultIdx = 0; faultIdx < faults.size(); faultIdx++ )
|
for ( size_t faultIdx = 0; faultIdx < faults.size(); faultIdx++ )
|
||||||
{
|
{
|
||||||
const RigFault* fault = faults.at( faultIdx );
|
const RigFault* fault = faults.at( faultIdx );
|
||||||
|
|
||||||
const std::vector<RigFault::FaultFace>& faultFaces = fault->faultFaces();
|
const std::vector<RigFault::FaultFace>& faultFaces = fault->faultFaces();
|
||||||
|
|
||||||
// #pragma omp parallel for
|
#pragma omp parallel for
|
||||||
for ( int faceIdx = 0; faceIdx < static_cast<int>( faultFaces.size() ); faceIdx++ )
|
for ( int faceIdx = 0; faceIdx < static_cast<int>( faultFaces.size() ); faceIdx++ )
|
||||||
{
|
{
|
||||||
const RigFault::FaultFace& f = faultFaces[faceIdx];
|
const RigFault::FaultFace& f = faultFaces[faceIdx];
|
||||||
@ -282,11 +283,6 @@ std::vector<RigConnection> RigCellFaceGeometryTools::computeOtherNncs( const Rig
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( otherCellPairs.count( candidate ) > 0 )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<size_t> polygon;
|
std::vector<size_t> polygon;
|
||||||
std::vector<cvf::Vec3d> intersections;
|
std::vector<cvf::Vec3d> intersections;
|
||||||
|
|
||||||
@ -313,8 +309,11 @@ std::vector<RigConnection> RigCellFaceGeometryTools::computeOtherNncs( const Rig
|
|||||||
|
|
||||||
#pragma omp critical( critical_section_nnc_computations )
|
#pragma omp critical( critical_section_nnc_computations )
|
||||||
{
|
{
|
||||||
otherCellPairs.emplace( candidate );
|
auto itBoolPair = otherCellPairs.insert( candidate );
|
||||||
otherConnections.emplace_back( conn );
|
if ( itBoolPair.second )
|
||||||
|
{
|
||||||
|
otherConnections.emplace_back( conn );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user