Skip to content
Permalink
Browse files

cuttingPlane: Corrected handling of intersection between a plane and …

…a cellZone in parallel

Patch contributed by Federico Piscaglia
Resolves bug-report https://bugs.openfoam.org/view.php?id=3283
  • Loading branch information...
Henry Weller
Henry Weller committed May 26, 2019
1 parent 0a3b7a7 commit 47d2e03ae3673e4042b5ab9d07513989aff4f0f9
Showing with 18 additions and 2 deletions.
  1. +18 −2 src/sampling/cuttingPlane/cuttingPlane.C
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -58,6 +58,12 @@ void Foam::cuttingPlane::calcCutCells
cutCells_.setSize(listSize);
label cutcelli(0);

// fp: check if the list (cellZone) is not empty.
const bool isZoneEmpty
(
(returnReduce(cellIdLabels.size(), sumOp<label>()) > 0) ? false : true
);

// Find the cut cells by detecting any cell that uses points with
// opposing dotProducts.
for (label listI = 0; listI < listSize; ++listI)
@@ -68,7 +74,17 @@ void Foam::cuttingPlane::calcCutCells
{
celli = cellIdLabels[listI];
}

else
{
// fp: in parallel computation, if the cellZone exists globally
// but not locally, the postprocessing must be still be limited to
// the crossing plane.
if (!isZoneEmpty)
{
cutCells_.setSize(0);
return;
}
}
const labelList& cEdges = cellEdges[celli];

label nCutEdges = 0;

0 comments on commit 47d2e03

Please sign in to comment.
You can’t perform that action at this time.