From 9bee3023d11ff3136073fd7af6f627e4752fab44 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 29 Nov 2012 15:43:12 +0000 Subject: [PATCH] ENH: polyBoundaryMesh: allow reordering without parallel sync --- .../polyMesh/polyBoundaryMesh/polyBoundaryMesh.C | 11 +++++++++-- .../polyMesh/polyBoundaryMesh/polyBoundaryMesh.H | 7 ++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index a54438f105..b4148405cf 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -1078,7 +1078,11 @@ void Foam::polyBoundaryMesh::updateMesh() } -void Foam::polyBoundaryMesh::reorder(const labelUList& oldToNew) +void Foam::polyBoundaryMesh::reorder +( + const labelUList& oldToNew, + const bool validBoundary +) { // Change order of patches polyPatchList::reorder(oldToNew); @@ -1091,7 +1095,10 @@ void Foam::polyBoundaryMesh::reorder(const labelUList& oldToNew) patches[patchI].index() = patchI; } - updateMesh(); + if (validBoundary) + { + updateMesh(); + } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H index 34f0a6d409..ad937a86fd 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H @@ -219,9 +219,10 @@ public: //- Reorders patches. Ordering does not have to be done in // ascending or descending order. Reordering has to be unique. - // (is shuffle) Calls updateMesh() after reordering to recalculate - // data. - void reorder(const labelUList&); + // (is shuffle) If validBoundary calls updateMesh() + // after reordering to recalculate data (so call needs to be parallel + // sync in that case) + void reorder(const labelUList&, const bool validBoundary); //- writeData member function required by regIOobject bool writeData(Ostream&) const;