Commit 2bfe3cef authored by laurence's avatar laurence
Browse files

ENH: Do not add empty patches to the patch list

parent a153b8ef
......@@ -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>());
if (totalPatchSize > 0)
{
patches[nValidPatches] = polyPatch::New
(
patchTypes[p],
patchNames[p],
patchSizes[p],
patchStarts[p],
nValidPatches,
mesh.boundaryMesh()
).ptr();
nValidPatches++;
nValidPatches++;
}
}
}
......
Supports Markdown
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