Skip to content
Snippets Groups Projects
Commit 242e53ed authored by mattijs's avatar mattijs
Browse files

distributed regions

parent bbe1952b
Branches
Tags
No related merge requests found
......@@ -539,36 +539,29 @@ void Foam::refinementSurfaces::findHigherIntersection
return;
}
// Work arrays
labelList hitMap(identity(start.size()));
pointField p0(start);
pointField p1(end);
List<pointIndexHit> hitInfo(start.size());
// Precalculate per surface whether it has a minlevelfield
UPtrList<triSurfaceLabelField> minLevelFields(surfaces_.size());
forAll(surfaces_, surfI)
{
const searchableSurface& geom = allGeometry_[surfaces_[surfI]];
geom.findLineAny(p0, p1, hitInfo);
labelList minLevelField;
if (isA<triSurfaceMesh>(geom))
{
const triSurfaceMesh& triMesh = refCast<const triSurfaceMesh>(geom);
minLevelFields.set
triMesh.getField
(
surfI,
&const_cast<triSurfaceLabelField&>
(
triMesh.lookupObject<triSurfaceLabelField>("minLevel")
)
"minLevel",
hitInfo,
minLevelField
);
}
}
// Work arrays
labelList hitMap(identity(start.size()));
pointField p0(start);
pointField p1(end);
List<pointIndexHit> hitInfo(start.size());
forAll(surfaces_, surfI)
{
allGeometry_[surfaces_[surfI]].findLineAny(p0, p1, hitInfo);
// Copy all hits into arguments, continue with misses
......@@ -581,14 +574,9 @@ void Foam::refinementSurfaces::findHigherIntersection
if (hitInfo[hitI].hit())
{
// Check if minLevelField for this surface.
if
(
minLevelFields.set(surfI)
&& minLevelFields[surfI].size() > 0
)
if (minLevelField.size() > 0)
{
minLocalLevel =
minLevelFields[surfI][hitInfo[hitI].index()];
minLocalLevel = minLevelField[hitI];
}
else
{
......@@ -618,7 +606,7 @@ void Foam::refinementSurfaces::findHigherIntersection
}
// All done? Note that this decision should be synchronised
if (newI == 0)
if (returnReduce(newI, sumOp<label>()) == 0)
{
break;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment