BUG: decomposePar: only write pointBoundaryMesh if needed

This commit is contained in:
mattijs 2024-12-16 12:13:28 +00:00
parent bd5d32035e
commit 1462a5effa

View File

@ -762,6 +762,9 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
pointBoundaryMesh& procBoundary = pointBoundaryMesh& procBoundary =
const_cast<pointBoundaryMesh&>(procPointMesh.boundary()); const_cast<pointBoundaryMesh&>(procPointMesh.boundary());
// Keep track if it differs from the polyBoundaryMesh since then
// we need to write the boundary file.
bool differsFromPoly = false;
// 2. Explicitly add subsetted meshPointPatches // 2. Explicitly add subsetted meshPointPatches
forAll(pMeshBoundary, patchi) forAll(pMeshBoundary, patchi)
@ -796,6 +799,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
meshPointPatch::typeName meshPointPatch::typeName
) )
); );
differsFromPoly = true;
} }
} }
@ -807,6 +811,12 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
if (!isA<processorPointPatch>(procBoundary[patchi])) if (!isA<processorPointPatch>(procBoundary[patchi]))
{ {
oldToNew[patchi] = newPatchi; oldToNew[patchi] = newPatchi;
if (newPatchi != patchi)
{
differsFromPoly = true;
}
newPatchi++; newPatchi++;
} }
} }
@ -824,6 +834,9 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
} }
procBoundary.reorder(oldToNew, true); procBoundary.reorder(oldToNew, true);
if (differsFromPoly)
{
// Write pointMesh/boundary // Write pointMesh/boundary
procBoundary.write(); procBoundary.write();
@ -840,6 +853,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
); );
IOListRef<label>(ioAddr, boundaryProcAddressing).write(); IOListRef<label>(ioAddr, boundaryProcAddressing).write();
} }
}
// Write points if pointsInstance differing from facesInstance // Write points if pointsInstance differing from facesInstance
if (facesInstancePointsPtr_) if (facesInstancePointsPtr_)