polyMesh: Prevent "no points/cells" warnings on processor cases

This commit is contained in:
Will Bainbridge
2023-07-28 14:43:26 +01:00
parent 2f579ca041
commit 32a877d236

View File

@ -326,12 +326,13 @@ Foam::polyMesh::polyMesh(const IOobject& io)
boundary_.calcGeometry();
// Warn if global empty mesh
if (returnReduce(nPoints(), sumOp<label>()) == 0)
const bool complete = Pstream::parRun() || !time().processorCase();
if (complete && returnReduce(nPoints(), sumOp<label>()) == 0)
{
WarningInFunction
<< "no points in mesh" << endl;
}
if (returnReduce(nCells(), sumOp<label>()) == 0)
if (complete && returnReduce(nCells(), sumOp<label>()) == 0)
{
WarningInFunction
<< "no cells in mesh" << endl;