From 4eb5e673e1cebb5e616efa6cd703d167ea08883d Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 30 Dec 2010 08:38:18 +0000 Subject: [PATCH] ENH: mapDistribute: allow -1 as global element --- .../mapPolyMesh/mapDistribute/mapDistribute.C | 12 ++++++++---- .../mapPolyMesh/mapDistribute/mapDistribute.H | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C index af5b4393b8..8315d3de21 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C @@ -307,7 +307,7 @@ Foam::mapDistribute::mapDistribute { label globalIndex = elements[i]; - if (!globalNumbering.isLocal(globalIndex)) + if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex)) { label procI = globalNumbering.whichProcID(globalIndex); nNonLocal[procI]++; @@ -329,7 +329,7 @@ Foam::mapDistribute::mapDistribute { label globalIndex = elements[i]; - if (!globalNumbering.isLocal(globalIndex)) + if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex)) { label procI = globalNumbering.whichProcID(globalIndex); label index = globalNumbering.toLocal(procI, globalIndex); @@ -452,7 +452,7 @@ Foam::mapDistribute::mapDistribute { label globalIndex = cCells[i]; - if (!globalNumbering.isLocal(globalIndex)) + if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex)) { label procI = globalNumbering.whichProcID(globalIndex); nNonLocal[procI]++; @@ -482,7 +482,7 @@ Foam::mapDistribute::mapDistribute { label globalIndex = cCells[i]; - if (!globalNumbering.isLocal(globalIndex)) + if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex)) { label procI = globalNumbering.whichProcID(globalIndex); label index = globalNumbering.toLocal(procI, globalIndex); @@ -603,6 +603,10 @@ Foam::label Foam::mapDistribute::renumber const label globalI ) { + if (globalI == -1) + { + return globalI; + } if (globalNumbering.isLocal(globalI)) { return globalNumbering.toLocal(globalI); diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H index ddd0486707..86895114e4 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H @@ -123,7 +123,7 @@ public: ); //- Construct from list of (possibly) remote elements in globalIndex - // numbering. Determines compact numbering (see above) and + // numbering (or -1). Determines compact numbering (see above) and // distribute map to get data into this ordering and renumbers the // elements to be in compact numbering. mapDistribute @@ -133,7 +133,7 @@ public: List >& compactMap ); - //- Special variant that works with the into sorted into bins + //- Special variant that works with the info sorted into bins // according to local indices. E.g. think cellCells where // cellCells[localCellI] is a list of global cells mapDistribute