mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -489,7 +489,7 @@ Foam::label Foam::DistributedDelaunayMesh<Triangulation>::referVertices
|
||||
|
||||
pointMap.distribute(parallelVertices);
|
||||
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
for (const int proci : Pstream::allProcs())
|
||||
{
|
||||
const labelList& constructMap = pointMap.constructMap()[proci];
|
||||
|
||||
|
||||
@ -473,7 +473,7 @@ void Foam::backgroundMeshDecomposition::printMeshData
|
||||
|
||||
// globalIndex globalBoundaryFaces(mesh.nBoundaryFaces());
|
||||
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
for (const int proci : Pstream::allProcs())
|
||||
{
|
||||
Info<< "Processor " << proci << " "
|
||||
<< "Number of cells = " << globalCells.localSize(proci)
|
||||
|
||||
@ -703,7 +703,7 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseSurfaceTrees
|
||||
label nStoppedInsertion = 0;
|
||||
|
||||
// Do the nearness tests here
|
||||
for (label proci = 0; proci < Pstream::nProcs(); ++proci)
|
||||
for (const int proci : Pstream::allProcs())
|
||||
{
|
||||
// Skip own points
|
||||
if (proci >= Pstream::myProcNo())
|
||||
@ -795,7 +795,7 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseEdgeTrees
|
||||
label nStoppedInsertion = 0;
|
||||
|
||||
// Do the nearness tests here
|
||||
for (label proci = 0; proci < Pstream::nProcs(); ++proci)
|
||||
for (const int proci : Pstream::allProcs())
|
||||
{
|
||||
// Skip own points
|
||||
if (proci >= Pstream::myProcNo())
|
||||
|
||||
@ -130,7 +130,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<< endl
|
||||
<< "Processor " << proci << nl
|
||||
|
||||
Reference in New Issue
Block a user