ENH: add UPstream::allProcs() method

- returns a range of `int` values that can be iterated across.
  For example,

      for (const int proci : Pstream::allProcs()) { ... }

  instead of

      for (label proci = 0; proci < Pstream::nProcs(); ++proci) { ... }
This commit is contained in:
Mark Olesen
2020-09-28 11:41:24 +02:00
parent f8a8728f8f
commit e18ff114a6
35 changed files with 102 additions and 99 deletions

View File

@ -185,7 +185,7 @@ void printMeshData(const polyMesh& mesh)
label totProcPatches = 0;
label maxProcFaces = 0;
for (label procI = 0; procI < Pstream::nProcs(); ++procI)
for (const int procI : Pstream::allProcs())
{
Info<< nl
<< "Processor " << procI << nl