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:
@ -148,12 +148,7 @@ int main(int argc, char *argv[])
|
||||
Pout<< "full: " << flatOutput(idl3.values()) << nl
|
||||
<< "send: " << flatOutput(idl3) << endl;
|
||||
|
||||
for
|
||||
(
|
||||
int proci = Pstream::firstSlave();
|
||||
proci <= Pstream::lastSlave();
|
||||
++proci
|
||||
)
|
||||
for (const int proci : Pstream::subProcs())
|
||||
{
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, proci);
|
||||
toSlave << idl3;
|
||||
|
||||
Reference in New Issue
Block a user