Commit 4eb5e673 authored by mattijs's avatar mattijs
Browse files

ENH: mapDistribute: allow -1 as global element

parent 041f7c4e
......@@ -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);
......
......@@ -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<Map<label> >& 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment