ENH: extend globalIndex toGlobal methods

- now applicable to labelLists.

Note:
  in some situations it will be more efficient to use
  Foam::identity() directly. Eg,

     globalIndex globalCells(mesh.nCells());
     ...
     labelList cellIds
     (
         identity(globalCells.localSize(), globalCells.localStart())
     );
This commit is contained in:
Mark Olesen
2018-11-05 16:23:33 +01:00
parent dfb652bcac
commit f5baa9a583
16 changed files with 127 additions and 136 deletions

View File

@ -455,18 +455,17 @@ void Foam::meshToMesh::distributeCells
}
// tgt cells into global numbering
labelList globalElems(sendElems.size());
forAll(sendElems, i)
labelList globalElems(globalI.toGlobal(sendElems));
if (debug > 1)
{
if (debug > 1)
forAll(sendElems, i)
{
Pout<< "tgtProc:" << Pstream::myProcNo()
<< " sending tgt cell " << sendElems[i]
<< "[" << globalI.toGlobal(sendElems[i]) << "]"
<< "[" << globalElems[i] << "]"
<< " to srcProc " << domain << endl;
}
globalElems[i] = globalI.toGlobal(sendElems[i]);
}
// pass data