ENH: Do not add empty patches to the patch list

This commit is contained in:
laurence
2013-02-01 11:43:13 +00:00
parent a153b8ef17
commit 2bfe3cefd0

View File

@ -1027,17 +1027,24 @@ void Foam::conformalVoronoiMesh::writeMesh
}
else
{
patches[nValidPatches] = polyPatch::New
(
patchTypes[p],
patchNames[p],
patchSizes[p],
patchStarts[p],
nValidPatches,
mesh.boundaryMesh()
).ptr();
// Check that the patch is not empty on every processor
label totalPatchSize = patchSizes[p];
reduce(totalPatchSize, sumOp<label>());
nValidPatches++;
if (totalPatchSize > 0)
{
patches[nValidPatches] = polyPatch::New
(
patchTypes[p],
patchNames[p],
patchSizes[p],
patchStarts[p],
nValidPatches,
mesh.boundaryMesh()
).ptr();
nValidPatches++;
}
}
}