#2717 Compaction: Use OpenMP for calculation

This commit is contained in:
Magne Sjaastad 2018-05-04 14:41:57 +02:00
parent 7a7a8bed0e
commit 085a3ea18a

View File

@ -1470,7 +1470,17 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateCompactionValues
frameCountProgress.incrementProgress(); frameCountProgress.incrementProgress();
compactionFrame.resize(nodeCount); compactionFrame.resize(nodeCount);
for (size_t n = 0; n < nodeCount; n++)
// Make sure the AABB-tree is created before using OpenMP
{
cvf::BoundingBox bb;
std::vector<size_t> refElementCandidates;
part->findIntersectingCells(bb, &refElementCandidates);
}
#pragma omp parallel for
for (long n = 0; n < nodeCount; n++)
{ {
RefElement refElement; RefElement refElement;
findReferenceElementForNode(*part, n, resVarAddr.refKLayerIndex, &refElement); findReferenceElementForNode(*part, n, resVarAddr.refKLayerIndex, &refElement);