meshCheck::checkTopology: Multiple disconnected region sets now only written for allTopology

NCC cases have multiple disconnected regions that polyMesh topology checking
considers a potential error and meshCheck::checkTopology can generate diagnostic
cell and point sets relating to these regions but these are now only written if
allTopology is set true to remove unnecessary clutter when checking the mesh at
run-time for moving mesh cases using the checkMesh functionObject.
This commit is contained in:
Henry Weller
2023-11-10 20:42:28 +00:00
parent ad1f953f6a
commit fbc3a122c5

View File

@ -333,8 +333,11 @@ Foam::label Foam::meshCheck::checkTopology
Info<< " *Number of regions: " << rs.nRegions() << endl; Info<< " *Number of regions: " << rs.nRegions() << endl;
Info<< " The mesh has multiple regions which are not connected " Info<< " The mesh has multiple regions which are not connected "
"by any face." << endl "by any face." << endl;
<< " <<Writing region information to "
if (allTopology)
{
Info<< " <<Writing region information to "
<< mesh.time().name()/"cellToRegion" << mesh.time().name()/"cellToRegion"
<< endl; << endl;
@ -351,8 +354,12 @@ Foam::label Foam::meshCheck::checkTopology
rs rs
); );
ctr.write(); ctr.write();
}
// Write region sets for allTopology
if (allTopology)
{
// Points in multiple regions // Points in multiple regions
pointSet points pointSet points
( (
@ -402,12 +409,14 @@ Foam::label Foam::meshCheck::checkTopology
} }
} }
Pstream::listCombineGather(regionDisconnected, andEqOp<bool>()); Pstream::listCombineGather
(
regionDisconnected,
andEqOp<bool>()
);
Pstream::listCombineScatter(regionDisconnected); Pstream::listCombineScatter(regionDisconnected);
} }
// write cellSet for each region // write cellSet for each region
PtrList<cellSet> cellRegions(rs.nRegions()); PtrList<cellSet> cellRegions(rs.nRegions());
for (label i = 0; i < rs.nRegions(); i++) for (label i = 0; i < rs.nRegions(); i++)
@ -432,8 +441,7 @@ Foam::label Foam::meshCheck::checkTopology
for (label i = 0; i < rs.nRegions(); i++) for (label i = 0; i < rs.nRegions(); i++)
{ {
Info<< " <<Writing region " << i; Info<< " <<Writing region " << i;
if (allTopology)
{
if (regionDisconnected[i]) if (regionDisconnected[i])
{ {
Info<< " (fully disconnected)"; Info<< " (fully disconnected)";
@ -442,11 +450,13 @@ Foam::label Foam::meshCheck::checkTopology
{ {
Info<< " (point connected)"; Info<< " (point connected)";
} }
}
Info<< " with " Info<< " with "
<< returnReduce(cellRegions[i].size(), sumOp<scalar>()) << returnReduce(cellRegions[i].size(), sumOp<scalar>())
<< " cells to cellSet " << cellRegions[i].name() << endl; << " cells to cellSet " << cellRegions[i].name()
<< endl;
cellRegions[i].instance() = mesh.pointsInstance();
cellRegions[i].write(); cellRegions[i].write();
} }
@ -456,6 +466,8 @@ Foam::label Foam::meshCheck::checkTopology
Info<< " <<Writing " << nPoints Info<< " <<Writing " << nPoints
<< " points that are in multiple regions to set " << " points that are in multiple regions to set "
<< points.name() << endl; << points.name() << endl;
points.instance() = mesh.pointsInstance();
points.write(); points.write();
if (setWriter.valid()) if (setWriter.valid())
{ {
@ -464,6 +476,7 @@ Foam::label Foam::meshCheck::checkTopology
} }
} }
} }
}
{ {