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:
@ -1303,7 +1303,7 @@ void Foam::refinementHistory::distribute(const mapDistributePolyMesh& map)
|
||||
|
||||
// Create subsetted refinement tree consisting of all parents that
|
||||
// move in their whole to other processor.
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
for (const int proci : Pstream::allProcs())
|
||||
{
|
||||
//Pout<< "-- Subetting for processor " << proci << endl;
|
||||
|
||||
@ -1412,7 +1412,7 @@ void Foam::refinementHistory::distribute(const mapDistributePolyMesh& map)
|
||||
visibleCells_.setSize(mesh.nCells());
|
||||
visibleCells_ = -1;
|
||||
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
for (const int proci : Pstream::allProcs())
|
||||
{
|
||||
IPstream fromNbr(Pstream::commsTypes::blocking, proci);
|
||||
List<splitCell8> newSplitCells(fromNbr);
|
||||
|
||||
Reference in New Issue
Block a user