Skip to content
Snippets Groups Projects

Pstream ranges

Merged Mark OLESEN requested to merge Pstream-ranges into develop
  1. Sep 28, 2020
    • Mark OLESEN's avatar
      ENH: add UPstream::subProcs() static method · 5dc5ea92
      Mark OLESEN authored
      - 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
            )
            {
                ...
            }
      5dc5ea92
    • Mark OLESEN's avatar
      ENH: add UPstream::allProcs() method · e18ff114
      Mark OLESEN authored
      - 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) { ... }
      e18ff114