mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: mapDistribute: allow -1 as global element
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user