mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: add UPstream::subProcs() static method
- returns a range of `int` values that can be iterated across.
For example,
for (const int proci : Pstream::subProcs()) { ... }
instead of
for
(
int proci = Pstream::firstSlave();
proci <= Pstream::lastSlave();
++proci
)
{
...
}
This commit is contained in:
@ -297,12 +297,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (Pstream::master())
|
||||
{
|
||||
for
|
||||
(
|
||||
int proci = Pstream::firstSlave();
|
||||
proci <= Pstream::lastSlave();
|
||||
++proci
|
||||
)
|
||||
for (const int proci : Pstream::subProcs())
|
||||
{
|
||||
IPstream fromSlave(Pstream::commsTypes::blocking, proci);
|
||||
FixedList<label, 2> list3(fromSlave);
|
||||
|
||||
Reference in New Issue
Block a user