From 23a6cadfa68f412b14f67e679c253faaeec0b056 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 19 Dec 2016 12:58:49 +0000 Subject: [PATCH] BUG: redistributePar: remove inconsistent *ProcAddressing. Fixes #351. --- .../manipulation/renumberMesh/renumberMesh.C | 24 ++++++++++- .../renumberMesh/renumberMeshDict | 2 +- .../redistributePar/redistributePar.C | 40 +++++++++++++++---- 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 80a4dc58e8..4275238815 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -1111,6 +1111,11 @@ int main(int argc, char *argv[]) cellProcAddressing.writeOpt() = IOobject::NO_WRITE; } } + else + { + cellProcAddressing.writeOpt() = IOobject::NO_WRITE; + } + if (faceProcAddressing.headerOk()) { if (faceProcAddressing.size() == mesh.nFaces()) @@ -1146,6 +1151,11 @@ int main(int argc, char *argv[]) faceProcAddressing.writeOpt() = IOobject::NO_WRITE; } } + else + { + faceProcAddressing.writeOpt() = IOobject::NO_WRITE; + } + if (pointProcAddressing.headerOk()) { if (pointProcAddressing.size() == mesh.nPoints()) @@ -1160,20 +1170,30 @@ int main(int argc, char *argv[]) } else { - Info<< "Not writing consistent processor point decomposition" + Info<< "Not writing inconsistent processor point decomposition" << " map " << pointProcAddressing.filePath() << endl; pointProcAddressing.writeOpt() = IOobject::NO_WRITE; } } + else + { + pointProcAddressing.writeOpt() = IOobject::NO_WRITE; + } + if (boundaryProcAddressing.headerOk()) { if (boundaryProcAddressing.size() != mesh.boundaryMesh().size()) { - Info<< "Not writing consistent processor patch decomposition" + Info<< "Not writing inconsistent processor patch decomposition" << " map " << boundaryProcAddressing.filePath() << endl; boundaryProcAddressing.writeOpt() = IOobject::NO_WRITE; } } + else + { + boundaryProcAddressing.writeOpt() = IOobject::NO_WRITE; + } + diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMeshDict b/applications/utilities/mesh/manipulation/renumberMesh/renumberMeshDict index c6321991cc..886285c952 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMeshDict +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMeshDict @@ -16,7 +16,7 @@ FoamFile // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Write maps from renumbered back to original mesh -writeMaps true; +writeMaps false; // Optional entry: sort cells on coupled boundaries to last for use with // e.g. nonBlockingGaussSeidel. diff --git a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C index aee47e55fd..3c53c60c6a 100644 --- a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C +++ b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C @@ -2532,14 +2532,40 @@ int main(int argc, char *argv[]) bool haveAddressing = false; if (haveMesh[Pstream::myProcNo()]) { - haveAddressing = IOobject + // Read faces (just to know their size) + faceCompactIOList faces ( - "faceProcAddressing", - facesInstance, - meshSubDir, - runTime, - IOobject::READ_IF_PRESENT - ).typeHeaderOk(true); + IOobject + ( + "faces", + facesInstance, + meshSubDir, + runTime, + IOobject::MUST_READ + ) + ); + + // Check faceProcAddressing + labelIOList faceProcAddressing + ( + IOobject + ( + "faceProcAddressing", + facesInstance, + meshSubDir, + runTime, + IOobject::READ_IF_PRESENT + ), + labelList(0) + ); + if + ( + faceProcAddressing.headerOk() + && faceProcAddressing.size() == faces.size() + ) + { + haveAddressing = true; + } } else {