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:
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -235,7 +235,7 @@ bool Foam::functionObjects::energySpectrum::write()
|
||||
vectorField Uijk(nGlobalCells);
|
||||
vectorField Cijk(nGlobalCells);
|
||||
|
||||
for (label proci = 0; proci < Pstream::nProcs(); ++proci)
|
||||
for (const int proci : Pstream::allProcs())
|
||||
{
|
||||
UIPstream fromProc(proci, pBufs);
|
||||
vectorField Up;
|
||||
|
||||
Reference in New Issue
Block a user